Skip to content
Permalink
Browse files

correctly create new function file (fix #16752)

(cherry picked from commit d839840)
  • Loading branch information
alexbruy committed Nov 15, 2017
1 parent d4b2895 commit 26e4d4f4d23a9dfeff54f6998fe40c991ad49e83
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/gui/qgsexpressionbuilderwidget.cpp
@@ -221,11 +221,13 @@ void QgsExpressionBuilderWidget::newFunctionFile( const QString& fileName )
if ( !items.isEmpty() )
return;

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

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

0 comments on commit 26e4d4f

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