Skip to content

Commit b5ffa14

Browse files
author
Arunmozhi
committedJul 9, 2012
incremental wild card searching done
1 parent 08b40d8 commit b5ffa14

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed
 

‎src/core/symbology-ng/qgsstylev2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ QStringList QgsStyleV2::findSymbols( QString qword )
596596
{
597597
QByteArray array = qword.toUtf8();
598598
char *query;
599-
query = sqlite3_mprintf( "SELECT name FROM symbol WHERE xml LIKE '\%%q\%'", array.constData() );
599+
query = sqlite3_mprintf( "SELECT name FROM symbol WHERE xml LIKE '%%%q%%';", array.constData() );
600600

601601
QStringList symbols;
602602
sqlite3 *db = openDB( mFileName );

‎src/gui/symbology-ng/qgsstylev2managerdialog.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
QgsStyleV2ManagerDialog::QgsStyleV2ManagerDialog( QgsStyleV2* style, QWidget* parent )
4545
: QDialog( parent ), mStyle( style ), mModified( false )
4646
{
47-
4847
setupUi( this );
4948

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

107+
connect( searchBox, SIGNAL( textChanged( QString ) ), this, SLOT( filterSymbols( QString ) ) );
108+
108109
}
109110

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

959+
void QgsStyleV2ManagerDialog::filterSymbols( QString qword )
960+
{
961+
QStringList symbols = mStyle->findSymbols( qword );
962+
populateSymbols( symbols );
963+
}

‎src/gui/symbology-ng/qgsstylev2managerdialog.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ class GUI_EXPORT QgsStyleV2ManagerDialog : public QDialog, private Ui::QgsStyleV
6060
void tagSymbolsAction();
6161
void regrouped( QStandardItem* );
6262

63+
//! filter the symbols based on input search term
64+
void filterSymbols( QString );
65+
6366
protected:
6467

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

0 commit comments

Comments
 (0)
Please sign in to comment.