Skip to content
Permalink
Browse files

correctly create new function file (fix #16752)

  • Loading branch information
alexbruy committed Nov 14, 2017
1 parent c09c96b commit d8398400f989147e8b9c89bf3c4beb87e2f8f97f
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/gui/qgsexpressionbuilderwidget.cpp
@@ -234,11 +234,13 @@ void QgsExpressionBuilderWidget::newFunctionFile( const QString &fileName )
if ( !items.isEmpty() )
return;

QListWidgetItem *item = new QListWidgetItem( QgsApplication::getThemeIcon( QStringLiteral( "console/iconTabEditorConsole.png" ) ), fileName );
cmbFileNames->insertItem( 0, item );
cmbFileNames->setCurrentRow( 0 );

QString templatetxt;
QgsPythonRunner::eval( QStringLiteral( "qgis.user.expressions.template" ), templatetxt );
txtPython->setText( templatetxt );
cmbFileNames->insertItem( 0, fileName );
cmbFileNames->setCurrentRow( 0 );
saveFunctionFile( fileName );
}

0 comments on commit d839840

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