Skip to content

Commit

Permalink
[processing] reset variables list in field calculator on layer change (
Browse files Browse the repository at this point in the history
…fix #15633)
  • Loading branch information
alexbruy committed May 4, 2017
1 parent eda1730 commit c2699b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Expand Up @@ -105,7 +105,6 @@ def manageGui(self):
self.mOutputFieldTypeComboBox.blockSignals(False)
self.builder.loadRecent('fieldcalc')

self.initContext()
self.updateLayer(self.cmbInputLayer.currentLayer())

def initContext(self):
Expand All @@ -117,6 +116,8 @@ def initContext(self):

def updateLayer(self, layer):
self.layer = layer

self.initContext()
self.builder.setLayer(self.layer)
self.builder.loadFieldNames()
self.populateFields()
Expand Down
3 changes: 1 addition & 2 deletions src/gui/qgsexpressionbuilderwidget.cpp
Expand Up @@ -516,8 +516,7 @@ void QgsExpressionBuilderWidget::setExpressionText( const QString &expression )
void QgsExpressionBuilderWidget::setExpressionContext( const QgsExpressionContext &context )
{
mExpressionContext = context;

loadExpressionContext();
updateFunctionTree();
}

void QgsExpressionBuilderWidget::on_txtExpressionString_textChanged()
Expand Down

0 comments on commit c2699b4

Please sign in to comment.