Skip to content

Commit 492f018

Browse files
author
wonder
committed
Restored quick search behaviour (#2407) - was a side effect when fixing #2007
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13179 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent d83af5b commit 492f018

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/core/qgssearchtreenode.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -320,15 +320,21 @@ bool QgsSearchTreeNode::checkAgainst( const QgsFieldMap& fields, const QgsAttrib
320320
return false;
321321
}
322322

323+
// TODO: reuse QRegExp
324+
323325
QString str = value2.string();
324326
if ( mOp == opLike ) // change from LIKE syntax to regexp
325327
{
326328
// XXX escape % and _ ???
327329
str.replace( "%", ".*" );
328330
str.replace( "_", "." );
331+
return QRegExp( str ).exactMatch( value1.string() );
332+
}
333+
else
334+
{
335+
return ( QRegExp( str ).indexIn( value1.string() ) != -1 );
329336
}
330337

331-
return QRegExp( str ).exactMatch( value1.string() );
332338
}
333339

334340
default:

0 commit comments

Comments
 (0)