Skip to content

Commit

Permalink
correctly create new function file (fix #16752)
Browse files Browse the repository at this point in the history
(cherry picked from commit d839840)
  • Loading branch information
alexbruy committed Nov 15, 2017
1 parent d4b2895 commit 26e4d4f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/gui/qgsexpressionbuilderwidget.cpp
Expand Up @@ -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 );
}

Expand Down

0 comments on commit 26e4d4f

Please sign in to comment.