From cb33923e1db6df3ead352f21c94b80a5785d70ca Mon Sep 17 00:00:00 2001 From: zecke Date: Sat, 28 Sep 2002 19:45:01 +0000 Subject: make it possible in profileconfig to iterate over the items in a group --- (limited to 'noncore') diff --git a/noncore/apps/opie-console/profileconfig.cpp b/noncore/apps/opie-console/profileconfig.cpp index 8b16920..bd089c8 100644 --- a/noncore/apps/opie-console/profileconfig.cpp +++ b/noncore/apps/opie-console/profileconfig.cpp @@ -33,3 +33,13 @@ void ProfileConfig::clearGroup( const QString& str ) { Config::clearGroup(); setGroup( cur ); } +QMap ProfileConfig::items( const QString& group )const { + QMap map; + QMap::ConstIterator it; + it = Config::groups.find( group ); + + if (it != Config::groups.end() ) + map = it.data(); + + return map; +} diff --git a/noncore/apps/opie-console/profileconfig.h b/noncore/apps/opie-console/profileconfig.h index e2e149c..f371ead 100644 --- a/noncore/apps/opie-console/profileconfig.h +++ b/noncore/apps/opie-console/profileconfig.h @@ -10,6 +10,10 @@ public: ProfileConfig( const QString& prof ); ~ProfileConfig(); QStringList groups()const; + /** + * return the items in the group + */ + QMap items(const QString& group)const; void clearGroup( const QString& ); void clearAll(); diff --git a/noncore/apps/opie-console/profilemanager.cpp b/noncore/apps/opie-console/profilemanager.cpp index db36686..54b184d 100644 --- a/noncore/apps/opie-console/profilemanager.cpp +++ b/noncore/apps/opie-console/profilemanager.cpp @@ -38,6 +38,9 @@ void ProfileManager::load() { } } +void ProfileManager::clear() { + m_list.clear(); +} Profile::ValueList ProfileManager::all()const { return m_list; } @@ -55,8 +58,8 @@ Session* ProfileManager::fromProfile( const Profile& prof) { return session; } void ProfileManager::save( ) { - m_list.clear(); ProfileConfig conf("opie-console-profiles"); + conf.clearAll(); Session* se= 0l; // FIXME save } -- cgit v0.9.0.2