Skip to content

Commit 05a311b

Browse files
committed
Code modernization
1 parent c8191ff commit 05a311b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/gui/qgsvariableeditorwidget.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,8 @@ void QgsVariableEditorTree::refreshScopeVariables( QgsExpressionContextScope *sc
339339
bool isCurrent = scopeIndex == mEditableScopeIndex;
340340
QTreeWidgetItem *scopeItem = mScopeToItem.value( scopeIndex );
341341

342-
Q_FOREACH ( const QString &name, scope->filteredVariableNames() )
342+
const QStringList names = scope->filteredVariableNames();
343+
for ( const QString &name : names )
343344
{
344345
QTreeWidgetItem *item = mVariableToItem.value( qMakePair( scopeIndex, name ) );
345346
if ( !item )
@@ -720,7 +721,7 @@ void VariableEditorDelegate::setModelData( QWidget *widget, QAbstractItemModel *
720721
//edited variable name
721722
QString newName = lineEdit->text();
722723
newName = newName.trimmed();
723-
newName = newName.replace( QStringLiteral( " " ), "_" );
724+
newName = newName.replace( ' ', '_' );
724725

725726
//test for validity
726727
if ( newName == variableName )

0 commit comments

Comments
 (0)