Salome HOME
Updated copyright comment
[modules/gui.git] / src / SALOME_PYQT / SALOME_PYQT_GUILight / SALOME_PYQT_PyModule.cxx
index 787d8d5fd7ddac32cc8ade196663c42ece540f68..e54a2d04a224e7eb9460e9fdf3da6ca0642c6c85 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -66,7 +66,7 @@ const int DEFAULT_GROUP = 40;
 QMutex myInitMutex;
 
 /*! DEBUG mode */
-const bool DEBUG = false;
+const bool theDEBUG = false;
 
 /*!
   \var IsCallOldMethods
@@ -168,17 +168,18 @@ public:
   FuncMsg( const QString& funcName )
   {
     myName = funcName;
-    if ( DEBUG )
+    if ( theDEBUG )
       MESSAGE( qPrintable( myName ) << " [ begin ]" );
   }
   ~FuncMsg()
   {
-    if ( DEBUG )
+    if ( theDEBUG )
       MESSAGE( qPrintable( myName ) << " [ end ]" );
   }
   void message( const QString& msg )
   {
-    if ( DEBUG )
+    (void)msg; // unused in debug mode
+    if ( theDEBUG )
       MESSAGE( qPrintable( myName ) << " : " << qPrintable( msg ) );
   }
 private:
@@ -388,7 +389,7 @@ QIcon PyModuleHelper::XmlHandler::loadIcon( const QString& fileName )
 */
 void PyModuleHelper::XmlHandler::createMenu( QDomNode& parentNode, 
                                              const int parentMenuId,
-                                             QMenu*    parentPopup )
+                                             QMenu*    /*parentPopup*/ )
 {
   if ( !module() || parentNode.isNull() )
     return;
@@ -1715,15 +1716,11 @@ QString PyModuleHelper::engineIOR() const
     QString&        myIOR;
   };
 
-  static QString anIOR;
-
-  if ( anIOR.isEmpty() ) {
-    // post request
-    PyInterp_Dispatcher::Get()->Exec( new EngineIORReq( myInterp, 
-                                      const_cast<PyModuleHelper*>( this ),
-                                      anIOR ) );
-  }
-
+  QString anIOR;
+  // post request
+  PyInterp_Dispatcher::Get()->Exec( new EngineIORReq( myInterp, 
+                                                     const_cast<PyModuleHelper*>( this ),
+                                                     anIOR ) );
   return anIOR;
 }
 
@@ -1755,7 +1752,7 @@ void PyModuleHelper::initInterp()
     }
     // ... then call a method
     int embedded = 1;
-    PyObjWrapper aRes( PyObject_CallMethod( aMod, (char*)"salome_init", (char*)"i", embedded ) );
+    PyObjWrapper aRes( PyObject_CallMethod( aMod, (char*)"salome_init", (char*)"si", NULL, embedded ) );
     if ( !aRes ) {
       // Error!
       PyErr_Print();
@@ -2086,7 +2083,7 @@ void PyModuleHelper::internalCustomize( SUIT_Study* study )
 
   \param study parent study
 */
-void PyModuleHelper::internalDeactivate( SUIT_Study* study )
+void PyModuleHelper::internalDeactivate( SUIT_Study* /*study*/ )
 {
   FuncMsg fmsg( "--- PyModuleHelper::internalDeactivate()" );
 
@@ -2129,7 +2126,7 @@ void PyModuleHelper::internalClosedStudy( SUIT_Study* theStudy )
   }
   // then call Python module's deactivate() method
   if ( PyObject_HasAttrString( myPyModule , (char*)"closeStudy" ) ) {
-    PyObjWrapper res( PyObject_CallMethod( myPyModule, (char*)"closeStudy", (char*)"i" ) );
+    PyObjWrapper res( PyObject_CallMethod( myPyModule, (char*)"closeStudy", (char*)"" ) );
     if( !res ) {
       PyErr_Print();
     }
@@ -2209,7 +2206,7 @@ void PyModuleHelper::internalStudyChanged( SUIT_Study* study )
 
   // call Python module's activeStudyChanged() method
   if ( PyObject_HasAttrString( myPyModule, (char*)"activeStudyChanged" ) ) {
-    PyObjWrapper res( PyObject_CallMethod( myPyModule, (char*)"activeStudyChanged", (char*)"i" ) );
+    PyObjWrapper res( PyObject_CallMethod( myPyModule, (char*)"activeStudyChanged", (char*)"" ) );
     if( !res ) {
       PyErr_Print();
     }
@@ -2857,8 +2854,8 @@ void PyModuleHelper::onObjectBrowserClicked(SUIT_DataObject* theObj, int theColu
     }
   private:
     PyModuleHelper* myHelper;
-    int    myColumn;
     QString myEntry;
+    int myColumn;
   };
   
   // Posting the request only if dispatcher is not busy!