Skip to content
Permalink
Browse files
fix #6726
  • Loading branch information
jef-n committed Jan 6, 2013
1 parent 55e3409 commit 66ca8f421a39e57c3f2b3159cf6a3059d6771303
Showing with 1 addition and 4 deletions.
  1. +1 −4 src/gui/qgssearchquerybuilder.cpp
@@ -73,14 +73,11 @@ void QgsSearchQueryBuilder::populateFields()
return;

QgsDebugMsg( "entering." );
QRegExp reQuote( "[A-Za-z_][A-Za-z0-9_]*" );
const QgsFieldMap& fields = mLayer->pendingFields();
for ( QgsFieldMap::const_iterator it = fields.begin(); it != fields.end(); ++it )
{
QString fieldName = it->name();
mFieldMap[fieldName] = it.key();
if ( !reQuote.exactMatch( fieldName ) ) // quote if necessary
fieldName = QgsExpression::quotedColumnRef( fieldName );
QStandardItem *myItem = new QStandardItem( fieldName );
myItem->setEditable( false );
mModelFields->insertRow( mModelFields->rowCount(), myItem );
@@ -314,7 +311,7 @@ void QgsSearchQueryBuilder::setSearchString( QString searchString )

void QgsSearchQueryBuilder::on_lstFields_doubleClicked( const QModelIndex &index )
{
txtSQL->insertPlainText( "\"" + mModelFields->data( index ).toString() + "\"" );
txtSQL->insertPlainText( QgsExpression::quotedColumnRef( mModelFields->data( index ).toString() ) );
}

void QgsSearchQueryBuilder::on_lstValues_doubleClicked( const QModelIndex &index )

0 comments on commit 66ca8f4

Please sign in to comment.