Skip to content
Permalink
Browse files

fix #1789

git-svn-id: http://svn.osgeo.org/qgis/trunk@11105 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Jul 18, 2009
1 parent c4b6e7b commit bcf09abbc00bfd3a3a0894f8cf78f457a500b4f2
Showing with 4 additions and 4 deletions.
  1. +2 −2 src/app/qgspgquerybuilder.cpp
  2. +2 −2 src/app/qgspgquerybuilder.h
@@ -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() );

@@ -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() + "'" );
}
@@ -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;
};

0 comments on commit bcf09ab

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