Skip to content

Commit

Permalink
Simpler geometry restore for field calculator dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 15, 2018
1 parent c89a542 commit 5f7f7b6
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/app/qgsfieldcalculator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "qgsexpressioncontext.h"
#include "qgsgeometry.h"
#include "qgssettings.h"
#include "qgsgui.h"

#include <QMessageBox>

Expand All @@ -49,6 +50,8 @@ QgsFieldCalculator::QgsFieldCalculator( QgsVectorLayer *vl, QWidget *parent )
connect( mOutputFieldNameLineEdit, &QLineEdit::textChanged, this, &QgsFieldCalculator::mOutputFieldNameLineEdit_textChanged );
connect( mOutputFieldTypeComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::activated ), this, &QgsFieldCalculator::mOutputFieldTypeComboBox_activated );

QgsGui::enableAutoGeometryRestore( this );

if ( !vl )
return;

Expand Down Expand Up @@ -148,15 +151,6 @@ QgsFieldCalculator::QgsFieldCalculator( QgsVectorLayer *vl, QWidget *parent )
mInfoIcon->setPixmap( style()->standardPixmap( QStyle::SP_MessageBoxInformation ) );

setOkButtonState();

QgsSettings settings;
restoreGeometry( settings.value( QStringLiteral( "Windows/QgsFieldCalculator/geometry" ) ).toByteArray() );
}

QgsFieldCalculator::~QgsFieldCalculator()
{
QgsSettings settings;
settings.setValue( QStringLiteral( "Windows/QgsFieldCalculator/geometry" ), saveGeometry() );
}

void QgsFieldCalculator::accept()
Expand Down

0 comments on commit 5f7f7b6

Please sign in to comment.