[QGIS Commit] r13179 - trunk/qgis/src/core

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sun Mar 28 06:13:12 EDT 2010


Author: wonder
Date: 2010-03-28 06:13:10 -0400 (Sun, 28 Mar 2010)
New Revision: 13179

Modified:
   trunk/qgis/src/core/qgssearchtreenode.cpp
Log:
Restored quick search behaviour (#2407) - was a side effect when fixing #2007


Modified: trunk/qgis/src/core/qgssearchtreenode.cpp
===================================================================
--- trunk/qgis/src/core/qgssearchtreenode.cpp	2010-03-28 09:48:08 UTC (rev 13178)
+++ trunk/qgis/src/core/qgssearchtreenode.cpp	2010-03-28 10:13:10 UTC (rev 13179)
@@ -320,15 +320,21 @@
         return false;
       }
 
+      // TODO: reuse QRegExp
+
       QString str = value2.string();
       if ( mOp == opLike ) // change from LIKE syntax to regexp
       {
         // XXX escape % and _  ???
         str.replace( "%", ".*" );
         str.replace( "_", "." );
+        return QRegExp( str ).exactMatch( value1.string() );
       }
+      else
+      {
+        return ( QRegExp( str ).indexIn( value1.string() ) != -1 );
+      }
 
-      return QRegExp( str ).exactMatch( value1.string() );
     }
 
     default:



More information about the QGIS-commit mailing list