From: mzn Date: Mon, 2 Dec 2013 12:50:11 +0000 (+0000) Subject: Getrid of redundant connections. X-Git-Tag: BR_hydro_v_0_4~100 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c1af1bfcf7dd246ce365d0e012e3687c532cd7eb;p=modules%2Fhydro.git Getrid of redundant connections. --- 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); } } }