Skip to content
Permalink
Browse files

restore original subset string on dialog cancel (fix #13620)

  • Loading branch information
SebDieBln authored and m-kuhn committed Nov 17, 2015
1 parent f7bdd66 commit 5399855566c504953151c4b56b6ae1e0d5097a5a
Showing with 12 additions and 0 deletions.
  1. +10 −0 src/app/qgsvectorlayerproperties.cpp
  2. +2 −0 src/app/qgsvectorlayerproperties.h
@@ -76,6 +76,7 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
: QgsOptionsDialogBase( "VectorLayerProperties", parent, fl )
, layer( lyr )
, mMetadataFilled( false )
, mOriginalSubsetSQL( lyr->subsetString() )
, mSaveAsMenu( 0 )
, mLoadStyleMenu( 0 )
, mRendererDialog( 0 )
@@ -531,6 +532,7 @@ void QgsVectorLayerProperties::apply()
layer->setSubsetString( txtSubsetSQL->toPlainText() );
mMetadataFilled = false;
}
mOriginalSubsetSQL = layer->subsetString();

// set up the scale based layer visibility stuff....
layer->setScaleBasedVisibility( mScaleVisibilityGroupBox->isChecked() );
@@ -644,6 +646,14 @@ void QgsVectorLayerProperties::onCancel()
Q_FOREACH ( const QgsVectorJoinInfo& info, mOldJoins )
layer->addJoin( info );
}

if ( mOriginalSubsetSQL != layer->subsetString() )
{
// need to undo changes in subset string - they are applied directly to the layer (not in apply())
// by QgsQueryBuilder::accept()

layer->setSubsetString( mOriginalSubsetSQL );
}
}

void QgsVectorLayerProperties::on_pbnQueryBuilder_clicked()
@@ -163,6 +163,8 @@ class APP_EXPORT QgsVectorLayerProperties : public QgsOptionsDialogBase, private

bool mMetadataFilled;

QString mOriginalSubsetSQL;

QMenu *mSaveAsMenu;
QMenu *mLoadStyleMenu;

0 comments on commit 5399855

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