]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Getrid of redundant connections.
authormzn <mzn@opencascade.com>
Mon, 2 Dec 2013 12:50:11 +0000 (12:50 +0000)
committermzn <mzn@opencascade.com>
Mon, 2 Dec 2013 12:50:11 +0000 (12:50 +0000)
src/HYDROGUI/HYDROGUI_GeoreferencementOp.cxx

index 269cd83e7d2f72e0ed9941e7612f72f263b0a584..fe1743ed72f25a85c423f2d6d11da792c55cee91 100644 (file)
@@ -77,20 +77,31 @@ void HYDROGUI_GeoreferencementOp::startOperation()
     dynamic_cast<OCCViewer_ViewManager*>( 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<HYDROGUI_GeoreferencementDlg*>( inputPanel() );
     if ( aPanel ) {
       connect( aViewManager, SIGNAL( mousePress( SUIT_ViewWindow*, QMouseEvent* ) ),
-               aPanel, SLOT( onMousePress( SUIT_ViewWindow*, QMouseEvent* ) ) );
+               aPanel, SLOT( onMousePress( SUIT_ViewWindow*, QMouseEvent* ) ),
+               Qt::UniqueConnection);
     }
   }
 }