Skip to content
Permalink
Browse files
Add a convenience constructor from QString to QgsSearchString
git-svn-id: http://svn.osgeo.org/qgis/trunk@13944 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Jul 20, 2010
1 parent 50734ac commit e9828f8ef39889f4b085ffe3e791e401e242f9cf
Showing with 18 additions and 3 deletions.
  1. +4 −0 python/core/qgssearchstring.sip
  2. +9 −2 src/core/qgssearchstring.cpp
  3. +5 −1 src/core/qgssearchstring.h
@@ -9,6 +9,10 @@ class QgsSearchString
//! constructor
QgsSearchString();

//! construct and parse a string
//! @note added in v1.6
QgsSearchString( const QString & str );

//! copy constructor - makes also copy of search tree
QgsSearchString( const QgsSearchString& str );

@@ -30,6 +30,11 @@ QgsSearchString::QgsSearchString()
mTree = NULL;
}

QgsSearchString::QgsSearchString( const QString & str )
{
mTree = NULL;
setString( str );
}

QgsSearchString::QgsSearchString( const QgsSearchString& str )
{
@@ -62,8 +67,10 @@ QgsSearchString::~QgsSearchString()

bool QgsSearchString::setString( QString str )
{
mParserErrorMsg.clear();

// empty string
if ( str == "" )
if ( str.isEmpty() )
{
clear();
return true;
@@ -107,5 +114,5 @@ void QgsSearchString::clear()
{
delete mTree;
mTree = NULL;
mString = "";
mString.clear();
}
@@ -35,9 +35,13 @@ class QgsSearchTreeNode;
class CORE_EXPORT QgsSearchString
{
public:
//! constructor
//! construct an empty string
QgsSearchString();

//! construct and parse a string
//! @note added in v1.6
QgsSearchString( const QString & str );

//! copy constructor - makes also copy of search tree
QgsSearchString( const QgsSearchString& str );

0 comments on commit e9828f8

Please sign in to comment.