From: rnv Date: Thu, 16 May 2019 09:42:53 +0000 (+0300) Subject: Fix for "16850 [CEA 16749] Macros toolbars: ShowSalomeObject" issue. X-Git-Tag: V9_4_0a1~10 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Frnv%2F16850;p=modules%2Fparavis.git Fix for "16850 [CEA 16749] Macros toolbars: ShowSalomeObject" issue. --- diff --git a/src/PVGUI/PVGUI_Module.cxx b/src/PVGUI/PVGUI_Module.cxx index 566f29b3..be201adf 100644 --- a/src/PVGUI/PVGUI_Module.cxx +++ b/src/PVGUI/PVGUI_Module.cxx @@ -124,6 +124,7 @@ #include #include #include +#include #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.