Salome HOME
Issue #2260: Correction for processing of empty/non-empty folders
[modules/shaper.git] / src / XGUI / XGUI_DataModel.h
index 39cbd3dc44589e748707fc5eb197bfb9e2d9e784..9052260aa6554d85ea48355e660f655caf69f715 100644 (file)
@@ -176,8 +176,33 @@ private:
   /// \param fromRoot - root document flag
   QStringList listOfShowNotEmptyFolders(bool fromRoot = true) const;
 
+  void addShownFolder(DocumentPtr theDoc, QString theFolder)
+  {
+    if (!myShownFolders.contains(theDoc)) {
+      myShownFolders[theDoc] = QStringList();
+    }
+    myShownFolders[theDoc].append(theFolder);
+  }
+
+  void removeShownFolder(DocumentPtr theDoc, QString theFolder)
+  {
+    if (myShownFolders.contains(theDoc)) {
+      myShownFolders[theDoc].removeAll(theFolder);
+      if (myShownFolders[theDoc].isEmpty())
+        myShownFolders.remove(theDoc);
+    }
+  }
+
+  bool hasShownFolder(DocumentPtr theDoc, QString theFolder) const
+  {
+    if (myShownFolders.contains(theDoc))
+      return myShownFolders[theDoc].contains(theFolder);
+    return false;
+  }
+
   Config_DataModelReader* myXMLReader;
 
+  QMap<DocumentPtr, QStringList> myShownFolders;
   //bool myIsEventsProcessingBlocked;
 };