Bug 74505 - search in files should offer option of case insensitive search (e.g. grep -i)
Summary: search in files should offer option of case insensitive search (e.g. grep -i)
Status: RESOLVED FIXED
Alias: None
Product: kdevplatform
Classification: Developer tools
Component: grepview (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR wishlist
Target Milestone: 1.3.0
Assignee: KDevelop Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-07 19:26 UTC by Jeff Mast
Modified: 2013-03-31 01:17 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Mast 2004-02-07 19:26:08 UTC
Version:            (using KDE KDE 3.2.0)
Installed from:    Gentoo Packages

It would be nice if there was a checkbox in the "Search in Files" dialog
to allow case insensitive searches.
Comment 1 Jens Dagerbo 2004-02-08 03:56:38 UTC
Yeah.. why not? :)
Comment 2 Robert Gruber 2004-05-26 18:42:53 UTC
CVS commit by rgruber: 

Added possibility to search case insensitive
CCMAIL: 74505-done@bugs.kde.org 


  M +5 -0      grepdlg.cpp   1.25
  M +3 -0      grepdlg.h   1.8
  M +11 -2     grepviewwidget.cpp   1.33


--- kdevelop/parts/grepview/grepdlg.cpp  #1.24:1.25
@@ -150,4 +150,9 @@ GrepDialog::GrepDialog( GrepViewPart * p
     dir_layout->addWidget(ignore_scm_box);
 
+    case_sens_box = new QCheckBox(i18n("Case &sensitive"), this);
+    case_sens_box->setChecked(true);
+    dir_layout->addSpacing(10);
+    dir_layout->addWidget(case_sens_box);
+    
     QBoxLayout *button_layout = new QHBoxLayout(4);
     layout->addLayout(button_layout, 5, 1);

--- kdevelop/parts/grepview/grepdlg.h  #1.7:1.8
@@ -54,4 +54,6 @@ public:
     bool ignoreSCMDirsFlag() const
         { return ignore_scm_box->isChecked(); }
+    bool caseSensitiveFlag() const
+        { return case_sens_box->isChecked(); }
 
 signals:
@@ -72,4 +74,5 @@ private:
     QCheckBox *recursive_box;
     QCheckBox *ignore_scm_box;
+    QCheckBox *case_sens_box;
     KConfig* config;
     QPushButton *search_button;

--- kdevelop/parts/grepview/grepviewwidget.cpp  #1.32:1.33
@@ -208,10 +208,19 @@ void GrepViewWidget::searchActivated()
 
 #ifndef USE_SOLARIS
-    command += "egrep -H -n -e ";
+    command += "egrep -H -n ";
+    if (!grepdlg->caseSensitiveFlag()) {
+      command += "-i ";
+    }
+    command += "-e ";
 #else
     // -H reported as not being available on Solaris,
     // but we're buggy without it on Linux.
-    command += "egrep -n -e ";
+    command += "egrep -n ";
+    if (!grepdlg->caseSensitiveFlag()) {
+      command += "-i ";
+    }
+    command += "-e ";
 #endif
+
     command += KShellProcess::quote(pattern);
     startJob("", command);