Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix #6726
  • Loading branch information
jef-n committed Jan 6, 2013
1 parent 55e3409 commit 66ca8f4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/gui/qgssearchquerybuilder.cpp
Expand Up @@ -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 );
Expand Down Expand Up @@ -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 )
Expand Down

0 comments on commit 66ca8f4

Please sign in to comment.