Skip to content
Permalink
Browse files

incremental wild card searching done

  • Loading branch information
tecoholic committed Jul 9, 2012
1 parent 08b40d8 commit b5ffa145cead5fb779a2bbd8f679df0fa3cf6afb
@@ -596,7 +596,7 @@ QStringList QgsStyleV2::findSymbols( QString qword )
{
QByteArray array = qword.toUtf8();
char *query;
query = sqlite3_mprintf( "SELECT name FROM symbol WHERE xml LIKE '\%%q\%'", array.constData() );
query = sqlite3_mprintf( "SELECT name FROM symbol WHERE xml LIKE '%%%q%%';", array.constData() );

QStringList symbols;
sqlite3 *db = openDB( mFileName );
@@ -44,7 +44,6 @@
QgsStyleV2ManagerDialog::QgsStyleV2ManagerDialog( QgsStyleV2* style, QWidget* parent )
: QDialog( parent ), mStyle( style ), mModified( false )
{

setupUi( this );

QSettings settings;
@@ -105,6 +104,8 @@ QgsStyleV2ManagerDialog::QgsStyleV2ManagerDialog( QgsStyleV2* style, QWidget* pa
connect( tabItemType, SIGNAL( currentChanged( int ) ), this, SLOT( populateList() ) );
populateList();

connect( searchBox, SIGNAL( textChanged( QString ) ), this, SLOT( filterSymbols( QString ) ) );

}

void QgsStyleV2ManagerDialog::onFinished()
@@ -955,3 +956,8 @@ void QgsStyleV2ManagerDialog::tagSymbolsAction()
QgsDebugMsg( "tagging symbols now" );
}

void QgsStyleV2ManagerDialog::filterSymbols( QString qword )
{
QStringList symbols = mStyle->findSymbols( qword );
populateSymbols( symbols );
}
@@ -60,6 +60,9 @@ class GUI_EXPORT QgsStyleV2ManagerDialog : public QDialog, private Ui::QgsStyleV
void tagSymbolsAction();
void regrouped( QStandardItem* );

//! filter the symbols based on input search term
void filterSymbols( QString );

protected:

//! populate combo box with known style items (symbols, color ramps)

0 comments on commit b5ffa14

Please sign in to comment.
You can’t perform that action at this time.