From: ana Date: Wed, 7 Jul 2010 11:49:06 +0000 (+0000) Subject: Improve resource manager: add function to get all parameters name in specified list... X-Git-Tag: translate_resources_09Jul10~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2c9efc0ed7bc37131860622a444e06c3cf5e693c;p=modules%2Fgui.git Improve resource manager: add function to get all parameters name in specified list of sub-sections names --- diff --git a/src/Qtx/QtxResourceMgr.cxx b/src/Qtx/QtxResourceMgr.cxx index cc2189b11..0afcf7799 100644 --- a/src/Qtx/QtxResourceMgr.cxx +++ b/src/Qtx/QtxResourceMgr.cxx @@ -2140,7 +2140,7 @@ QStringList QtxResourceMgr::subSections(const QString& section, const bool full) QStringList names = sections( QStringList() << section ); QMutableListIterator it( names ); while ( it.hasNext() ) { - QString name = it.next().mid( section.size() ).trimmed(); + QString name = it.next().mid( section.size() + 1 ).trimmed(); if ( name.isEmpty() ) { it.remove(); continue; @@ -2189,6 +2189,21 @@ QStringList QtxResourceMgr::parameters( const QString& sec ) const return pmap.keys(); } +/*! + \brief Get all parameters name in specified + list of sub-sections names. + + Sub-sections are separated inside the section name by the sections + separator token, for example "splash:color:label". + + \param names parent sub-sections names + \return list of settings names +*/ +QStringList QtxResourceMgr::parameters( const QStringList& names ) const +{ + return parameters( names.join( sectionsToken() ) ); +} + /*! \brief Get absolute path to the file which name is defined by the parameter. diff --git a/src/Qtx/QtxResourceMgr.h b/src/Qtx/QtxResourceMgr.h index a15205bc2..9b5356369 100644 --- a/src/Qtx/QtxResourceMgr.h +++ b/src/Qtx/QtxResourceMgr.h @@ -166,6 +166,7 @@ public: QStringList sections(const QStringList&) const; QStringList subSections(const QString&, const bool = true) const; QStringList parameters( const QString& ) const; + QStringList parameters( const QStringList& ) const; void refresh();