[Bug 74505] search in files should offer option of case insensitive search (e.g. grep -i)

Robert Gruber rgruber at users.sourceforge.net
Fri May 28 00:24:56 UTC 2004


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
      
http://bugs.kde.org/show_bug.cgi?id=74505      
rgruber users sourceforge net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From rgruber users sourceforge net  2004-05-26 18:42 -------
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);




More information about the KDevelop-devel mailing list