]> SALOME platform Git repositories - modules/paravis.git/blobdiff - src/PVGUI/PVGUI_Module.cxx
Salome HOME
PV version is now bfaf7b82ed22ee (master of 17th of january 2019)
[modules/paravis.git] / src / PVGUI / PVGUI_Module.cxx
index 6210acd08bab24929237d9c78e44fa152a5d3a56..02cc591668d560bb81929f488c044615f8ac326e 100644 (file)
 #include <pqServerManagerModel.h>
 #include <pqAnimationTimeToolbar.h>
 #include <pqPipelineBrowserWidget.h>
+#include <pqCoreUtilities.h>
 
 #if PY_VERSION_HEX < 0x03050000
 static char*
@@ -191,20 +192,6 @@ PVGUI_Module::PVGUI_Module()
   Q_INIT_RESOURCE( PVGUI );
 #endif
   ParavisModule = this;
-
-  // Clear old copies of embedded macros files
-  QString aDestPath = QString( "%1/.config/%2/Macros" ).arg( QDir::homePath() ).arg( QApplication::applicationName() );
-  QStringList aFilter;
-  aFilter << "*.py";
-
-  QDir aDestDir(aDestPath);
-  QStringList aDestFiles = aDestDir.entryList(aFilter, QDir::Files);
-  foreach (QString aMacrosPath, getEmbeddedMacrosList()) {
-    QString aMacrosName = QFileInfo(aMacrosPath).fileName();
-    if (aDestFiles.contains(aMacrosName)) {
-      aDestDir.remove(aMacrosName);
-    }
-  }
 }
 
 /*!
@@ -270,8 +257,25 @@ void PVGUI_Module::initialize( CAM_Application* app )
   // Initialize ParaView client and associated behaviors
   // and connect to externally launched pvserver
   PVViewer_Core::ParaviewInitApp(aDesktop);
+
+  // Clear old copies of embedded macros files
+  //QString aDestPath = QString( "%1/.config/%2/Macros" ).arg( QDir::homePath() ).arg( QApplication::applicationName() );
+  QString aDestPath = pqCoreUtilities::getParaViewUserDirectory() + "/Macros";
+  QStringList aFilter;
+  aFilter << "*.py";
+
+  QDir aDestDir(aDestPath);
+  QStringList aDestFiles = aDestDir.entryList(aFilter, QDir::Files);
+  foreach(QString aMacrosPath, getEmbeddedMacrosList()) {
+         QString aMacrosName = QFileInfo(aMacrosPath).fileName();
+         if (aDestFiles.contains(aMacrosName)) {
+                 aDestDir.remove(aMacrosName);
+         }
+  }
+
   myGuiElements = PVViewer_GUIElements::GetInstance(aDesktop);
 
+
   // [ABN]: careful with the order of the GUI element creation, the loading of the configuration
   // and the connection to the server. This order is very sensitive if one wants to make
   // sure all menus, etc ... are correctly populated.
@@ -641,11 +645,8 @@ bool PVGUI_Module::deactivateModule( SUIT_Study* study )
   SUIT_ExceptionHandler::removeCleanUpRoutine( paravisCleanUp );
 
   if (myOldMsgHandler)
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
-    qInstallMsgHandler(myOldMsgHandler);
-#else
     qInstallMessageHandler(myOldMsgHandler);
-#endif
+
   restoreCommonWindowsState();
   
   return LightApp_Module::deactivateModule( study );