From c1af1bfcf7dd246ce365d0e012e3687c532cd7eb Mon Sep 17 00:00:00 2001 From: mzn Date: Mon, 2 Dec 2013 12:50:11 +0000 Subject: [PATCH] Getrid of redundant connections. --- src/HYDROGUI/HYDROGUI_GeoreferencementOp.cxx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/HYDROGUI/HYDROGUI_GeoreferencementOp.cxx b/src/HYDROGUI/HYDROGUI_GeoreferencementOp.cxx index 269cd83e..fe1743ed 100644 --- a/src/HYDROGUI/HYDROGUI_GeoreferencementOp.cxx +++ b/src/HYDROGUI/HYDROGUI_GeoreferencementOp.cxx @@ -77,20 +77,31 @@ void HYDROGUI_GeoreferencementOp::startOperation() dynamic_cast( anApp->getViewManager( OCCViewer_Viewer::Type(), false ) ); if ( aViewManager ) { connect( aViewManager, SIGNAL( mousePress( SUIT_ViewWindow*, QMouseEvent* ) ), - aPanel, SLOT( onMousePress( SUIT_ViewWindow*, QMouseEvent* ) ) ); + aPanel, SLOT( onMousePress( SUIT_ViewWindow*, QMouseEvent* ) ), + Qt::UniqueConnection ); } connect( anApp->desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ), - this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ) ); + this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ), Qt::UniqueConnection ); } void HYDROGUI_GeoreferencementOp::abortOperation() { + LightApp_Application* anApp = module()->getApp(); + if ( anApp && anApp->desktop() ) { + anApp->desktop()->disconnect( this ); + } + HYDROGUI_Operation::abortOperation(); } void HYDROGUI_GeoreferencementOp::commitOperation() { + LightApp_Application* anApp = module()->getApp(); + if ( anApp && anApp->desktop() ) { + anApp->desktop()->disconnect( this ); + } + HYDROGUI_Operation::commitOperation(); } @@ -182,7 +193,8 @@ void HYDROGUI_GeoreferencementOp::onWindowActivated( SUIT_ViewWindow* theViewWin ::qobject_cast( inputPanel() ); if ( aPanel ) { connect( aViewManager, SIGNAL( mousePress( SUIT_ViewWindow*, QMouseEvent* ) ), - aPanel, SLOT( onMousePress( SUIT_ViewWindow*, QMouseEvent* ) ) ); + aPanel, SLOT( onMousePress( SUIT_ViewWindow*, QMouseEvent* ) ), + Qt::UniqueConnection); } } } -- 2.39.2