Bug 74505

Summary: search in files should offer option of case insensitive search (e.g. grep -i)
Product: [Developer tools] kdevplatform Reporter: Jeff Mast <jeff.mast>
Component: grepviewAssignee: KDevelop Developers <kdevelop-devel>
Status: RESOLVED FIXED    
Severity: wishlist    
Priority: NOR    
Version: unspecified   
Target Milestone: 1.3.0   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

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);