Skip to content

Commit

Permalink
- replace SaQueryBuilder with QgsQueryBuilder
Browse files Browse the repository at this point in the history
- replace SaDbFilterProxyModel with QgsDbFilterProxyModel
- remove spurious copy of QgsDbFilterProxyModel from postgres provider
- fix #4491
  • Loading branch information
jef-n committed May 26, 2012
1 parent 3c6f917 commit ed70b94
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 705 deletions.
31 changes: 14 additions & 17 deletions src/gui/qgsquerybuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,26 +181,23 @@ void QgsQueryBuilder::test()

void QgsQueryBuilder::accept()
{
// if user hits Ok and there is no query, skip the validation
if ( !txtSQL->toPlainText().trimmed().isEmpty() )
if ( !mLayer->setSubsetString( txtSQL->toPlainText() ) )
{
if ( !mLayer->setSubsetString( txtSQL->toPlainText() ) )
//error in query - show the problem
if ( mLayer->dataProvider()->hasErrors() )
{
//error in query - show the problem
if ( mLayer->dataProvider()->hasErrors() )
{
QMessageBox::warning( this,
tr( "Query Failed" ),
tr( "An error occurred when executing the query." )
+ tr( "\nThe data provider said:\n%1" ).arg( mLayer->dataProvider()->errors().join( "\n" ) ) );
mLayer->dataProvider()->clearErrors();
}
else
{
QMessageBox::warning( this, tr( "Error in Query" ), tr( "The subset string could not be set" ) );
}
return;
QMessageBox::warning( this,
tr( "Query Failed" ),
tr( "An error occurred when executing the query." )
+ tr( "\nThe data provider said:\n%1" ).arg( mLayer->dataProvider()->errors().join( "\n" ) ) );
mLayer->dataProvider()->clearErrors();
}
else
{
QMessageBox::warning( this, tr( "Error in Query" ), tr( "The subset string could not be set" ) );
}

return;
}

QDialog::accept();
Expand Down
3 changes: 0 additions & 3 deletions src/plugins/sqlanywhere/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ SET (sqlanywhere_SRCS
sasourceselect.cpp
sanewconnection.cpp
sadbtablemodel.cpp
sadbfilterproxymodel.cpp
saquerybuilder.cpp
)

SET (sqlanywhere_UIS
Expand All @@ -21,7 +19,6 @@ SET (sqlanywhere_MOC_HDRS
sanewconnection.h
salayer.h
sadbtablemodel.h
saquerybuilder.h
)

SET (sqlanywhere_RCCS sqlanywhere.qrc)
Expand Down
63 changes: 0 additions & 63 deletions src/plugins/sqlanywhere/sadbfilterproxymodel.cpp

This file was deleted.

47 changes: 0 additions & 47 deletions src/plugins/sqlanywhere/sadbfilterproxymodel.h

This file was deleted.

0 comments on commit ed70b94

Please sign in to comment.