Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Advanced attribute search dialog replaced with query builder
based on Postgres' query builder.


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5034 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Mar 16, 2006
1 parent f9257e9 commit 29be5dc
Show file tree
Hide file tree
Showing 10 changed files with 432 additions and 208 deletions.
8 changes: 6 additions & 2 deletions src/core/qgssearchstring.h
Expand Up @@ -16,8 +16,11 @@
* *
***************************************************************************/
/* $Id$ */

#include <qstring.h>

#ifndef QGSSEARCHSTRING_H
#define QGSSEARCHSTRING_H

#include <QString>

class QgsSearchTreeNode;

Expand Down Expand Up @@ -75,3 +78,4 @@ class QgsSearchString
QString mParserErrorMsg;
};

#endif
8 changes: 4 additions & 4 deletions src/gui/Makefile.am
Expand Up @@ -69,7 +69,6 @@ libqgis_guiHEADERS = \
qgisinterface.h \
qgsabout.h \
qgsaddattrdialog.h \
qgsadvancedattrsearch.h \
qgsattributeaction.h \
qgsattributeactiondialog.h \
qgsattributedialog.h \
Expand Down Expand Up @@ -130,6 +129,7 @@ libqgis_guiHEADERS = \
qgsrasterlayerproperties.h \
qgsrubberband.h \
qgsrunprocess.h \
qgssearchquerybuilder.h \
qgsserversourceselect.h \
qgssinglesymboldialog.h \
qgssinglesymbolrenderer.h \
Expand All @@ -146,7 +146,6 @@ libqgis_gui_la_MOC = \
qgisinterface.moc.cpp \
qgsabout.moc.cpp \
qgsaddattrdialog.moc.cpp \
qgsadvancedattrsearch.moc.cpp \
qgsattributeactiondialog.moc.cpp \
qgsattributedialog.moc.cpp \
qgsattributetabledisplay.moc.cpp \
Expand Down Expand Up @@ -187,6 +186,7 @@ libqgis_gui_la_MOC = \
qgsprojectproperties.moc.cpp \
qgsrasterlayerproperties.moc.cpp \
qgsrunprocess.moc.cpp \
qgssearchquerybuilder.moc.cpp \
qgsserversourceselect.moc.cpp \
qgssinglesymboldialog.moc.cpp \
qgsuniquevaluedialog.moc.cpp \
Expand All @@ -199,8 +199,7 @@ libqgis_gui_la_SOURCES = \
qgisinterface.cpp \
qgsabout.cpp \
qgsaddattrdialog.cpp \
qgsadvancedattrsearch.cpp \
qgsattributeaction.cpp \
qgsattributeaction.cpp \
qgsattributeactiondialog.cpp \
qgsattributedialog.cpp \
qgsattributetable.cpp \
Expand Down Expand Up @@ -258,6 +257,7 @@ libqgis_gui_la_SOURCES = \
qgsrasterlayerproperties.cpp \
qgsrubberband.cpp \
qgsrunprocess.cpp \
qgssearchquerybuilder.cpp \
qgsserversourceselect.cpp \
qgssinglesymboldialog.cpp \
qgssinglesymbolrenderer.cpp \
Expand Down
55 changes: 0 additions & 55 deletions src/gui/qgsadvancedattrsearch.cpp

This file was deleted.

40 changes: 0 additions & 40 deletions src/gui/qgsadvancedattrsearch.h

This file was deleted.

14 changes: 8 additions & 6 deletions src/gui/qgsattributetabledisplay.cpp
Expand Up @@ -21,9 +21,9 @@

#include "qgsapplication.h"
#include "qgsaddattrdialog.h"
#include "qgsadvancedattrsearch.h"
#include "qgsdelattrdialog.h"
#include "qgsfeature.h"
#include "qgssearchquerybuilder.h"
#include "qgssearchtreenode.h"
#include "qgsvectorlayer.h"
#include "qgsvectordataprovider.h"
Expand Down Expand Up @@ -252,12 +252,12 @@ void QgsAttributeTableDisplay::search()

void QgsAttributeTableDisplay::advancedSearch()
{
QgsAdvancedAttrSearch* searchDlg = new QgsAdvancedAttrSearch(this);
if (searchDlg->exec())
QgsSearchQueryBuilder dlg(mLayer, this);
dlg.setSearchString(mSearchString);
if (dlg.exec())
{
doSearch(searchDlg->searchString());
doSearch(dlg.searchString());
}
delete searchDlg;
}


Expand Down Expand Up @@ -287,6 +287,8 @@ void QgsAttributeTableDisplay::searchShowResultsChanged(int item)

void QgsAttributeTableDisplay::doSearch(const QString& searchString)
{
mSearchString = searchString;

// parse search string (and build parsed tree)
QgsSearchString search;
if (!search.setString(searchString))
Expand Down Expand Up @@ -314,7 +316,7 @@ void QgsAttributeTableDisplay::doSearch(const QString& searchString)
QgsVectorDataProvider* provider = mLayer->getDataProvider();
provider->reset();
mSearchIds.clear();
while (fet = provider->getNextFeature(true))
while ((fet = provider->getNextFeature(true)))
{
if (searchTree->checkAgainst(fet->attributeMap()))
{
Expand Down
2 changes: 2 additions & 0 deletions src/gui/qgsattributetabledisplay.h
Expand Up @@ -66,6 +66,8 @@ class QgsAttributeTableDisplay:public QDialog, private Ui::QgsAttributeTableBase
private:
/** Set the icon theme for this dialog */
void setTheme();

QString mSearchString;
};

#endif

0 comments on commit 29be5dc

Please sign in to comment.