Skip to content

Commit

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

Expand Down

0 comments on commit d839840

Please sign in to comment.