-rw-r--r-- | noncore/apps/opie-console/profileconfig.cpp | 10 | ||||
-rw-r--r-- | noncore/apps/opie-console/profileconfig.h | 4 | ||||
-rw-r--r-- | noncore/apps/opie-console/profilemanager.cpp | 5 |
3 files changed, 18 insertions, 1 deletions
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 @@ -30,6 +30,16 @@ void ProfileConfig::clearAll() { void ProfileConfig::clearGroup( const QString& str ) { QString cur =git.key(); setGroup( str ); Config::clearGroup(); setGroup( cur ); } +QMap<QString, QString> ProfileConfig::items( const QString& group )const { + QMap<QString, QString> map; + QMap<QString, ConfigGroup>::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 @@ -7,11 +7,15 @@ class ProfileConfig : public Config { public: ProfileConfig( const QString& prof ); ~ProfileConfig(); QStringList groups()const; + /** + * return the items in the group + */ + QMap<QString, QString> items(const QString& group)const; void clearGroup( const QString& ); void clearAll(); }; #endif 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 @@ -35,12 +35,15 @@ void ProfileManager::load() { prof.setTerminal( conf.readNumEntry("terminal") ); m_list.append( prof ); } } +void ProfileManager::clear() { + m_list.clear(); +} Profile::ValueList ProfileManager::all()const { return m_list; } Session* ProfileManager::fromProfile( const Profile& prof) { Session* session = new Session(); session->setName( prof.name() ); @@ -52,11 +55,11 @@ Session* ProfileManager::fromProfile( const Profile& prof) { * load widget * set colors + fonts */ return session; } void ProfileManager::save( ) { - m_list.clear(); ProfileConfig conf("opie-console-profiles"); + conf.clearAll(); Session* se= 0l; // FIXME save } |