Skip to content

Commit bcf09ab

Browse files
author
jef
committedJul 18, 2009
fix #1789
git-svn-id: http://svn.osgeo.org/qgis/trunk@11105 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent c4b6e7b commit bcf09ab

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎src/app/qgspgquerybuilder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ void QgsPgQueryBuilder::fillValues( QString theSQL )
187187

188188
// determine the field type
189189
QgsField field = mFieldMap[mModelFields->data( lstFields->currentIndex() ).toString()];
190-
mActualFieldIsChar = field.typeName().contains( "char" ) || field.typeName().contains( "text" ); // really should be: field.type()==QVariant::String - but is not set correctly above
190+
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
191191

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

@@ -429,7 +429,7 @@ void QgsPgQueryBuilder::on_lstFields_doubleClicked( const QModelIndex &index )
429429

430430
void QgsPgQueryBuilder::on_lstValues_doubleClicked( const QModelIndex &index )
431431
{
432-
if ( mActualFieldIsChar )
432+
if ( mQuoteValue )
433433
{
434434
txtSQL->insertPlainText( "'" + mModelValues->data( index ).toString() + "'" );
435435
}

‎src/app/qgspgquerybuilder.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ class QgsPgQueryBuilder : public QDialog, private Ui::QgsPgQueryBuilderBase
153153
QStandardItemModel *mModelFields;
154154
//! Model for values ListView
155155
QStandardItemModel *mModelValues;
156-
//! Actual field char?
157-
bool mActualFieldIsChar;
156+
//! value needs to be quoted (char, boolean)
157+
bool mQuoteValue;
158158
//! Previous field row to delete model
159159
int mPreviousFieldRow;
160160
};

0 commit comments

Comments
 (0)
Please sign in to comment.