X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSUIT%2FSUIT_PreferenceMgr.cxx;fp=src%2FSUIT%2FSUIT_PreferenceMgr.cxx;h=91d0175c790856bcfc6f03c8ed6b8093e65499be;hb=18c1ccc660e6897da9c28e91ed65377b1907b431;hp=d1bf51b9d874c6be36494179b71ab036e9333b08;hpb=514654146e35a84d0a6a914d54cad4d0bb4a3489;p=modules%2Fgui.git diff --git a/src/SUIT/SUIT_PreferenceMgr.cxx b/src/SUIT/SUIT_PreferenceMgr.cxx index d1bf51b9d..91d0175c7 100644 --- a/src/SUIT/SUIT_PreferenceMgr.cxx +++ b/src/SUIT/SUIT_PreferenceMgr.cxx @@ -70,23 +70,26 @@ int SUIT_PreferenceMgr::addItem( const QString& title, const int pId, const SUIT_PreferenceMgr::PrefItemType type, const QString& sect, const QString& param ) { - QtxPreferenceItem* parent = pId == -1 ? this : findItem( pId, true ); + QtxPreferenceItem* parent = 0; + if ( pId == -1 ) + { + if ( !myRoot ) + myRoot = new QtxPagePrefListItem( QString( "root" ), this ); + parent = myRoot; + } + else + { + parent = findItem( pId, true ); + } if ( !parent ) return -1; - QtxPreferenceItem* item = parent->findItem( title, true ); + QtxPreferenceItem* item = parent->findItem( title, false ); if ( item && item->depth() < 5 ) return item->id(); - if ( pId == -1 ) - { - if ( !myRoot ) - myRoot = new QtxPagePrefListItem( QString( "root" ), this ); - parent = myRoot; - } - switch( type ) { case Auto: @@ -185,3 +188,8 @@ void SUIT_PreferenceMgr::setOptionValue( const QString& name, const QVariant& va if ( myRoot ) myRoot->setOption( name, val ); } + +QtxPreferenceItem* SUIT_PreferenceMgr::root() const +{ + return myRoot; +}