Skip to content

Commit

Permalink
fix #1789
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@11105 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jul 18, 2009
1 parent c4b6e7b commit bcf09ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/app/qgspgquerybuilder.cpp
Expand Up @@ -187,7 +187,7 @@ void QgsPgQueryBuilder::fillValues( QString theSQL )

// determine the field type
QgsField field = mFieldMap[mModelFields->data( lstFields->currentIndex() ).toString()];
mActualFieldIsChar = field.typeName().contains( "char" ) || field.typeName().contains( "text" ); // really should be: field.type()==QVariant::String - but is not set correctly above
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,7 +429,7 @@ void QgsPgQueryBuilder::on_lstFields_doubleClicked( const QModelIndex &index )

void QgsPgQueryBuilder::on_lstValues_doubleClicked( const QModelIndex &index )
{
if ( mActualFieldIsChar )
if ( mQuoteValue )
{
txtSQL->insertPlainText( "'" + mModelValues->data( index ).toString() + "'" );
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgspgquerybuilder.h
Expand Up @@ -153,8 +153,8 @@ class QgsPgQueryBuilder : public QDialog, private Ui::QgsPgQueryBuilderBase
QStandardItemModel *mModelFields;
//! Model for values ListView
QStandardItemModel *mModelValues;
//! Actual field char?
bool mActualFieldIsChar;
//! value needs to be quoted (char, boolean)
bool mQuoteValue;
//! Previous field row to delete model
int mPreviousFieldRow;
};
Expand Down

0 comments on commit bcf09ab

Please sign in to comment.