Skip to content

Commit ed70b94

Browse files
committed
- replace SaQueryBuilder with QgsQueryBuilder
- replace SaDbFilterProxyModel with QgsDbFilterProxyModel - remove spurious copy of QgsDbFilterProxyModel from postgres provider - fix #4491
1 parent 3c6f917 commit ed70b94

10 files changed

+18
-705
lines changed

src/gui/qgsquerybuilder.cpp

+14-17
Original file line numberDiff line numberDiff line change
@@ -181,26 +181,23 @@ void QgsQueryBuilder::test()
181181

182182
void QgsQueryBuilder::accept()
183183
{
184-
// if user hits Ok and there is no query, skip the validation
185-
if ( !txtSQL->toPlainText().trimmed().isEmpty() )
184+
if ( !mLayer->setSubsetString( txtSQL->toPlainText() ) )
186185
{
187-
if ( !mLayer->setSubsetString( txtSQL->toPlainText() ) )
186+
//error in query - show the problem
187+
if ( mLayer->dataProvider()->hasErrors() )
188188
{
189-
//error in query - show the problem
190-
if ( mLayer->dataProvider()->hasErrors() )
191-
{
192-
QMessageBox::warning( this,
193-
tr( "Query Failed" ),
194-
tr( "An error occurred when executing the query." )
195-
+ tr( "\nThe data provider said:\n%1" ).arg( mLayer->dataProvider()->errors().join( "\n" ) ) );
196-
mLayer->dataProvider()->clearErrors();
197-
}
198-
else
199-
{
200-
QMessageBox::warning( this, tr( "Error in Query" ), tr( "The subset string could not be set" ) );
201-
}
202-
return;
189+
QMessageBox::warning( this,
190+
tr( "Query Failed" ),
191+
tr( "An error occurred when executing the query." )
192+
+ tr( "\nThe data provider said:\n%1" ).arg( mLayer->dataProvider()->errors().join( "\n" ) ) );
193+
mLayer->dataProvider()->clearErrors();
203194
}
195+
else
196+
{
197+
QMessageBox::warning( this, tr( "Error in Query" ), tr( "The subset string could not be set" ) );
198+
}
199+
200+
return;
204201
}
205202

206203
QDialog::accept();

src/plugins/sqlanywhere/CMakeLists.txt

-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ SET (sqlanywhere_SRCS
66
sasourceselect.cpp
77
sanewconnection.cpp
88
sadbtablemodel.cpp
9-
sadbfilterproxymodel.cpp
10-
saquerybuilder.cpp
119
)
1210

1311
SET (sqlanywhere_UIS
@@ -21,7 +19,6 @@ SET (sqlanywhere_MOC_HDRS
2119
sanewconnection.h
2220
salayer.h
2321
sadbtablemodel.h
24-
saquerybuilder.h
2522
)
2623

2724
SET (sqlanywhere_RCCS sqlanywhere.qrc)

src/plugins/sqlanywhere/sadbfilterproxymodel.cpp

-63
This file was deleted.

src/plugins/sqlanywhere/sadbfilterproxymodel.h

-47
This file was deleted.

0 commit comments

Comments
 (0)