Skip to content

Commit

Permalink
fix #1789 (take 2)
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11106 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jul 18, 2009
1 parent 5274c8f commit b7c2b63
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
10 changes: 1 addition & 9 deletions src/app/qgspgquerybuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ void QgsPgQueryBuilder::fillValues( QString theSQL )

// determine the field type
QgsField field = mFieldMap[mModelFields->data( lstFields->currentIndex() ).toString()];
mQuoteValue = field.typeName().contains( "char" ) || field.typeName().contains( "text" ) || field.typeName().contains("bool"); // really should be: field.type()==QVariant::String - but is not set correctly above

PGresult *result = PQexec( mPgConnection, theSQL.toUtf8() );

Expand Down Expand Up @@ -429,14 +428,7 @@ void QgsPgQueryBuilder::on_lstFields_doubleClicked( const QModelIndex &index )

void QgsPgQueryBuilder::on_lstValues_doubleClicked( const QModelIndex &index )
{
if ( mQuoteValue )
{
txtSQL->insertPlainText( "'" + mModelValues->data( index ).toString() + "'" );
}
else
{
txtSQL->insertPlainText( mModelValues->data( index ).toString() );
}
txtSQL->insertPlainText( "'" + mModelValues->data( index ).toString() + "'" );
}

void QgsPgQueryBuilder::on_btnLessEqual_clicked()
Expand Down
2 changes: 0 additions & 2 deletions src/app/qgspgquerybuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ class QgsPgQueryBuilder : public QDialog, private Ui::QgsPgQueryBuilderBase
QStandardItemModel *mModelFields;
//! Model for values ListView
QStandardItemModel *mModelValues;
//! value needs to be quoted (char, boolean)
bool mQuoteValue;
//! Previous field row to delete model
int mPreviousFieldRow;
};
Expand Down

0 comments on commit b7c2b63

Please sign in to comment.