Skip to content
Permalink
Browse files
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
  • Loading branch information
wonder committed Mar 28, 2010
1 parent d83af5b commit 492f0189a35ca970c5fff57330178aa348833ca4
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/core/qgssearchtreenode.cpp
@@ -320,15 +320,21 @@ bool QgsSearchTreeNode::checkAgainst( const QgsFieldMap& fields, const QgsAttrib
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:

0 comments on commit 492f018

Please sign in to comment.