Skip to content

Commit

Permalink
Restored quick search behaviour (#2407) - was a side effect when fixing
Browse files Browse the repository at this point in the history
#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 492f018
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/core/qgssearchtreenode.cpp
Expand Up @@ -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:
Expand Down

0 comments on commit 492f018

Please sign in to comment.