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@13179 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Mar 28, 2010
1 parent 0d2e05f commit c39ef3de3219f10fef272d1a05824debcb68602f
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 c39ef3d

Please sign in to comment.