Skip to content

Commit

Permalink
emit QgsProject.snapSettingsChanged() (fixes #9465)
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jun 21, 2014
1 parent 01412bf commit c25e358
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src/app/qgssnappingdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ class QgsSnappingDock : public QDockWidget

};

QgsSnappingDialog::QgsSnappingDialog( QWidget* parent, QgsMapCanvas* canvas ): QDialog( parent ), mMapCanvas( canvas ), mDock( 0 )
QgsSnappingDialog::QgsSnappingDialog( QWidget* parent, QgsMapCanvas* canvas )
: QDialog( parent )
, mMapCanvas( canvas )
, mDock( 0 )
{
setupUi( this );

Expand Down Expand Up @@ -190,6 +193,14 @@ void QgsSnappingDialog::apply()
QgsProject::instance()->writeEntry( "Digitizing", "/LayerSnappingToleranceUnitList", toleranceUnitList );
QgsProject::instance()->writeEntry( "Digitizing", "/LayerSnappingEnabledList", enabledList );
QgsProject::instance()->writeEntry( "Digitizing", "/AvoidIntersectionsList", avoidIntersectionList );

disconnect( QgsProject::instance(), SIGNAL( snapSettingsChanged() ), this, SLOT( reload() ) );
connect( this, SIGNAL( snapSettingsChanged() ), QgsProject::instance(), SIGNAL( snapSettingsChanged() ) );

emit snapSettingsChanged();

disconnect( this, SIGNAL( snapSettingsChanged() ), QgsProject::instance(), SIGNAL( snapSettingsChanged() ) );
connect( QgsProject::instance(), SIGNAL( snapSettingsChanged() ), this, SLOT( reload() ) );
}

void QgsSnappingDialog::show()
Expand Down
4 changes: 3 additions & 1 deletion src/app/qgssnappingdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,12 @@ class APP_EXPORT QgsSnappingDialog: public QDialog, private Ui::QgsSnappingDialo
*/
void closeEvent( QCloseEvent* event );

signals:
void snapSettingsChanged();

private slots:
void reload();


private:
/**Default constructor forbidden*/
QgsSnappingDialog();
Expand Down

0 comments on commit c25e358

Please sign in to comment.