Salome HOME
DCQ : Merge with Ecole Ete a6.
[modules/visu.git] / src / VISU_I / VISUConfig.cc
index e2229e199f405e8d644881d3278618b75b87c0da..1e760bbd18909079dc25732a25c9f77fdfaa704e 100644 (file)
@@ -58,32 +58,16 @@ namespace VISU{
 
   //===========================================================================
   static int mySCnt = 0;
-  static int myQCnt = 0;
-  static int myIsBatchMode = 0;
 
-  Mutex::Mutex(QMutex* theMutex, QApplication* theQApp, int theDelay) :
-    myQApp(theQApp), isQAppLocked(theQApp->locked()), myDelay(theDelay),
-    myMutex(theMutex), isSessionLocked(theMutex->locked())
-  {
-    if(MYDEBUG) MESSAGE("Mutex::Mutex : "<<(!isQAppLocked && !myQCnt)<<" "<<(!isSessionLocked && !mySCnt));
-    if(!myIsBatchMode && isQAppLocked) myIsBatchMode++;
-    if(!isSessionLocked && !mySCnt) { myMutex->lock();}; mySCnt++;
-    if(!isQAppLocked && !myQCnt) { 
-      myQApp->lock(); 
-      myQApp->syncX();
-    };
-    myQCnt++;
+  Mutex::Mutex(QMutex* theMutex): myMutex(theMutex){
+    if(MYDEBUG) MESSAGE("Mutex::Mutex : "<<!mySCnt);
+    if(!mySCnt++) 
+      myMutex->lock();
   }
   Mutex::~Mutex(){
-    myQCnt--; 
-    if(!isQAppLocked && !myQCnt) { 
-      myQApp->flushX(); 
-      //if(myDelay > 0)
-       myQApp->processEvents(myDelay+3);
-      myQApp->unlock();
-    }
-    mySCnt--; if(!isSessionLocked && !mySCnt) { myMutex->unlock();}
-    if(MYDEBUG) MESSAGE("Mutex::~Mutex : "<<(!isQAppLocked && !myQCnt)<<" "<<(!isSessionLocked && !mySCnt));
+    if(!(--mySCnt))
+      myMutex->unlock();
+    if(MYDEBUG) MESSAGE("Mutex::~Mutex : "<<!mySCnt);
   }
 
 
@@ -99,7 +83,6 @@ namespace VISU{
   }
 
   void Storable::Registry(const char* theComment, TStorableEngine theEngine)
-    throw(std::logic_error&)
   {
     if(!VisuStoreMap.insert(TCallbackMap::value_type(theComment,theEngine)).second){
       if(MYDEBUG) MESSAGE("Storable::Registry >> dupliacte registring !!!");
@@ -151,7 +134,6 @@ namespace VISU{
   }
   Storable* Storable::Create(SALOMEDS::SObject_ptr theSObject,
                             const string& thePrefix, const string& theLocalPersistentID) 
-    throw (std::runtime_error&)
   {
     try{
       QString strIn( theLocalPersistentID.c_str() );
@@ -174,7 +156,6 @@ namespace VISU{
   }
   
   const QString& Storable::FindValue(const TRestoringMap& theMap, const string& theArg, bool* isFind)
-    throw(std::logic_error&)
   {
     TRestoringMap::const_iterator i = theMap.find(theArg);
     if(i == theMap.end()) {
@@ -278,7 +259,7 @@ namespace VISU{
       anAttr = aStudyBuilder->FindOrCreateAttribute(newObj, "AttributeComment");
       SALOMEDS::AttributeComment_var aCmnt = SALOMEDS::AttributeComment::_narrow(anAttr);
       aCmnt->SetValue(theComment);
-      INFOS("CreateAttributes - Comment = "<<theComment);
+      if(MYDEBUG) INFOS("CreateAttributes - Comment = "<<theComment);
     }
     if(strcmp(theRefFatherEntry,"") != 0){
       SALOMEDS::SObject_var aRefFather = theStudyDocument->FindObjectID(theRefFatherEntry);