Skip to content
Permalink
Browse files

- replace SaQueryBuilder with QgsQueryBuilder

- 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 ed70b941e85bec981036882aad33a1cb38ed8045
@@ -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();
@@ -6,8 +6,6 @@ SET (sqlanywhere_SRCS
sasourceselect.cpp
sanewconnection.cpp
sadbtablemodel.cpp
sadbfilterproxymodel.cpp
saquerybuilder.cpp
)

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

SET (sqlanywhere_RCCS sqlanywhere.qrc)

This file was deleted.

This file was deleted.

0 comments on commit ed70b94

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