Salome HOME
Issue #2288: Update column with icons in object browser on Linux
[modules/shaper.git] / src / XGUI / XGUI_Workshop.cpp
index cc6ea32c57c10494b7dc5871e416069066f7c044..17be4e5309218cd94261291618e6ae54b8dc33ff 100755 (executable)
@@ -55,6 +55,8 @@
 #include <AppElements_Workbench.h>
 #endif
 
+#include <Config_XMLReader.h>
+
 #include <ModelAPI_AttributeDocRef.h>
 #include <ModelAPI_AttributeIntArray.h>
 #include <ModelAPI_AttributeDouble.h>
@@ -295,8 +297,7 @@ void XGUI_Workshop::startApplication()
   Config_PropManager::registerProp("Plugins", "default_path", "Default Path",
                                    Config_Prop::Directory, "");
 
-  std::string aDir = getenv(QString("%1Resources").arg(
-    ModuleBase_Preferences::resourceMgr()->appName()).toLatin1());
+  std::string aDir = Config_XMLReader::resourcesConfigFile();
   Config_PropManager::registerProp("Plugins", "import_initial_path", "Import initial directory",
                                    Config_Prop::Directory, aDir);
 
@@ -2213,6 +2214,15 @@ void XGUI_Workshop::showObjects(const QObjectPtrList& theList, bool isVisible)
     aObj->setDisplayed(isVisible);
   }
   Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
+#ifndef WIN32
+  // Necessary for update icons in ObjectBrowser on Linux
+  QModelIndexList aIndexes = mySelector->selection()->selectedIndexes();
+  foreach (QModelIndex aIdx, aIndexes) {
+    if (aIdx.column() == 0) {
+      myObjectBrowser->treeView()->update(aIdx);
+    }
+  }
+#endif
 }
 
 //**************************************************************
@@ -2238,6 +2248,15 @@ void XGUI_Workshop::showOnlyObjects(const QObjectPtrList& theList)
     aObj->setDisplayed(true);
   }
   Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
+#ifndef WIN32
+  // Necessary for update icons in ObjectBrowser on Linux
+  QModelIndexList aIndexes = mySelector->selection()->selectedIndexes();
+  foreach (QModelIndex aIdx, aIndexes) {
+    if (aIdx.column() == 0) {
+      myObjectBrowser->treeView()->update(aIdx);
+    }
+  }
+#endif
 }