Skip to content
Permalink
Browse files

Code modernization

  • Loading branch information
nyalldawson committed Aug 27, 2018
1 parent c8191ff commit 05a311bdcfa1a3c626743dc16eacb962c3e01711
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/gui/qgsvariableeditorwidget.cpp
@@ -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 )
@@ -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 )

0 comments on commit 05a311b

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