]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Issue 21379: [CEA 504] Implement mechanism of references in Object Browser in light...
authorsan <san@opencascade.com>
Wed, 16 Nov 2011 16:36:21 +0000 (16:36 +0000)
committersan <san@opencascade.com>
Wed, 16 Nov 2011 16:36:21 +0000 (16:36 +0000)
SalomeApp_DataObject::LastId introduced for column Id iteration purposes, so as not to depend on particular enumaration values for column Ids

src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_DataObject.h

index d5df66f5033b5b1281fae1f3bbbe752d47fa2961..0f175de44ac0fdea49cf3dcf9fe5d2b2204ab91f 100644 (file)
@@ -990,7 +990,7 @@ void SalomeApp_Application::createPreferences( LightApp_Preferences* pref )
   int salomeCat = pref->addPreference( tr( "PREF_CATEGORY_SALOME" ) );
   int obTab = pref->addPreference( tr( "PREF_TAB_OBJBROWSER" ), salomeCat );
   int defCols = pref->addPreference( tr( "PREF_GROUP_DEF_COLUMNS" ), obTab );
-  for ( int i = SalomeApp_DataObject::EntryId; i <= SalomeApp_DataObject::RefEntryId; i++ )
+  for ( int i = SalomeApp_DataObject::EntryId; i < SalomeApp_DataObject::LastId; i++ )
   {
     pref->addPreference( tr( QString().sprintf( "OBJ_BROWSER_COLUMN_%d", i-SalomeApp_DataObject::EntryId ).toLatin1() ), defCols,
                          LightApp_Preferences::Bool, "ObjectBrowser", QString().sprintf( "visibility_column_id_%d", i-1 ) );
@@ -1620,7 +1620,7 @@ bool SalomeApp_Application::useStudy( const QString& theName )
 void SalomeApp_Application::objectBrowserColumnsVisibility()
 {
   if ( objectBrowser() )
-    for ( int i = SalomeApp_DataObject::EntryId; i <= SalomeApp_DataObject::RefEntryId; i++ )
+    for ( int i = SalomeApp_DataObject::EntryId; i < SalomeApp_DataObject::LastId; i++ )
     {
       bool shown = resourceMgr()->booleanValue( "ObjectBrowser", QString( "visibility_column_id_%1" ).arg( i-1 ), true );
       objectBrowser()->treeView()->setColumnHidden( i, !shown );
index 3d41c46f57f3e90bbef4780cd51f583287f98fbd..9e54b1734bed7c9885061fbf62c16f843b484726 100644 (file)
@@ -39,7 +39,8 @@ public:
   //! Column id
   enum {
     ValueId = RefEntryId + 1,    //!< value column
-    IORId                        //!< IOR column
+    IORId,                       //!< IOR column
+    LastId                       //!< indicates last Id value
   };
 
 public: