author | zecke <zecke> | 2002-09-28 20:07:52 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-09-28 20:07:52 (UTC) |
commit | b6df65ad2ffb50f029b96ebf9d0d78dfa23f3f19 (patch) (side-by-side diff) | |
tree | a9cac491c119fb644ac75750cd715fce16c4c778 | |
parent | cb33923e1db6df3ead352f21c94b80a5785d70ca (diff) | |
download | opie-b6df65ad2ffb50f029b96ebf9d0d78dfa23f3f19.zip opie-b6df65ad2ffb50f029b96ebf9d0d78dfa23f3f19.tar.gz opie-b6df65ad2ffb50f029b96ebf9d0d78dfa23f3f19.tar.bz2 |
Profiles, loading and saving completed
-rw-r--r-- | noncore/apps/opie-console/profile.cpp | 6 | ||||
-rw-r--r-- | noncore/apps/opie-console/profile.h | 3 | ||||
-rw-r--r-- | noncore/apps/opie-console/profilemanager.cpp | 23 |
3 files changed, 26 insertions, 6 deletions
diff --git a/noncore/apps/opie-console/profile.cpp b/noncore/apps/opie-console/profile.cpp index cdf595e..c8f5eb0 100644 --- a/noncore/apps/opie-console/profile.cpp +++ b/noncore/apps/opie-console/profile.cpp @@ -34,4 +34,7 @@ Profile &Profile::operator=( const Profile& prof ) { Profile::~Profile() { } +QMap<QString, QString> Profile::conf()const { + return m_conf; +} QString Profile::name()const { return m_name; @@ -105,2 +108,5 @@ bool Profile::readBoolEntry( const QString& key, bool def )const { return readNumEntry( key, def ); } +void Profile::setConf( const QMap<QString, QString>& conf ) { + m_conf = conf; +}; diff --git a/noncore/apps/opie-console/profile.h b/noncore/apps/opie-console/profile.h index eff2be1..9956bdb 100644 --- a/noncore/apps/opie-console/profile.h +++ b/noncore/apps/opie-console/profile.h @@ -41,5 +41,5 @@ public: * config stuff */ - QMap<QString, QString> conf(); + QMap<QString, QString> conf()const; void clearConf(); void writeEntry( const QString& key, const QString& value ); @@ -56,4 +56,5 @@ public: void setForeground( int fore ); void setTerminal( int term ); + void setConf( const QMap<QString, QString>& ); private: QMap<QString, QString> m_conf; diff --git a/noncore/apps/opie-console/profilemanager.cpp b/noncore/apps/opie-console/profilemanager.cpp index 54b184d..c8a4db5 100644 --- a/noncore/apps/opie-console/profilemanager.cpp +++ b/noncore/apps/opie-console/profilemanager.cpp @@ -23,7 +23,4 @@ void ProfileManager::load() { * for each profile */ - /* - * QAsciiDict Parsing FIXME - */ for ( it = groups.begin(); it != groups.end(); ++it ) { conf.setGroup( (*it) ); @@ -34,5 +31,7 @@ void ProfileManager::load() { prof.setForeground( conf.readNumEntry("fore") ); prof.setTerminal( conf.readNumEntry("terminal") ); + prof.setConf( conf.items( (*it) ) ); + /* now add it */ m_list.append( prof ); } @@ -53,5 +52,5 @@ Session* ProfileManager::fromProfile( const Profile& prof) { * FIXME * load emulation - * load widget + * load widget? * set colors + fonts */ @@ -61,5 +60,19 @@ void ProfileManager::save( ) { ProfileConfig conf("opie-console-profiles"); conf.clearAll(); - Session* se= 0l; + Profile::ValueList::Iterator it; + for (it = m_list.begin(); it != m_list.end(); ++it ) { + conf.setGroup( (*it).name() ); + conf.writeEntry( "name", (*it).name() ); + conf.writeEntry( "ioplayer", (*it).ioLayerName() ); + conf.writeEntry( "back", (*it).background() ); + conf.writeEntry( "fore", (*it).foreground() ); + conf.writeEntry( "terminal", (*it).terminal() ); + /* now the config stuff */ + QMap<QString, QString> map = (*it).conf(); + QMap<QString, QString>::Iterator it; + for ( it = map.begin(); it != map.end(); ++it ) { + conf.writeEntry( it.key(), it.data() ); + } + } // FIXME save } |