0029674: Improvements in Inspector tool
[occt.git] / tools / TreeModel / TreeModel_ItemBase.cxx
index 42acea0..464a788 100644 (file)
@@ -14,6 +14,7 @@
 // commercial license or contractual agreement. 
 
 #include <inspector/TreeModel_ItemBase.hxx>
+
 #include <inspector/TreeModel_ItemRole.hxx>
 
 #include <Standard_WarningsDisable.hxx>
@@ -45,8 +46,19 @@ void TreeModel_ItemBase::Reset()
       anItem->Reset();
   }
   m_bInitialized = false;
-  mycachedValues.clear();
+  myCachedValues.clear();
+}
+
+// =======================================================================
+// function :  Reset
+// purpose :
+// =======================================================================
+void TreeModel_ItemBase::Reset (int theRole)
+{
+  if (!myCachedValues.contains (theRole))  
+    return;
 
+  myCachedValues.remove (theRole);
 }
 
 // =======================================================================
@@ -84,11 +96,11 @@ const TreeModel_ItemBasePtr TreeModel_ItemBase::currentItem()
 // =======================================================================
 QVariant TreeModel_ItemBase::cachedValue (const int theItemRole) const
 {
-  if (mycachedValues.contains (theItemRole))
-    return mycachedValues[theItemRole];
+  if (myCachedValues.contains (theItemRole))
+    return myCachedValues[theItemRole];
 
-  const_cast<TreeModel_ItemBase*>(this)->mycachedValues.insert (theItemRole,
+  const_cast<TreeModel_ItemBase*>(this)->myCachedValues.insert (theItemRole,
     theItemRole == TreeModel_ItemRole_RowCountRole ? QVariant (initRowCount()) : initValue (theItemRole));
 
-  return mycachedValues.contains (theItemRole) ? mycachedValues[theItemRole] : QVariant();
+  return myCachedValues.contains (theItemRole) ? myCachedValues[theItemRole] : QVariant();
 }