Skip to content

Commit

Permalink
Code modernization
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Aug 27, 2018
1 parent c8191ff commit 05a311b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/gui/qgsvariableeditorwidget.cpp
Expand Up @@ -339,7 +339,8 @@ void QgsVariableEditorTree::refreshScopeVariables( QgsExpressionContextScope *sc
bool isCurrent = scopeIndex == mEditableScopeIndex;
QTreeWidgetItem *scopeItem = mScopeToItem.value( scopeIndex );

Q_FOREACH ( const QString &name, scope->filteredVariableNames() )
const QStringList names = scope->filteredVariableNames();
for ( const QString &name : names )
{
QTreeWidgetItem *item = mVariableToItem.value( qMakePair( scopeIndex, name ) );
if ( !item )
Expand Down Expand Up @@ -720,7 +721,7 @@ void VariableEditorDelegate::setModelData( QWidget *widget, QAbstractItemModel *
//edited variable name
QString newName = lineEdit->text();
newName = newName.trimmed();
newName = newName.replace( QStringLiteral( " " ), "_" );
newName = newName.replace( ' ', '_' );

//test for validity
if ( newName == variableName )
Expand Down

0 comments on commit 05a311b

Please sign in to comment.