author | zecke <zecke> | 2002-09-28 20:07:52 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-09-28 20:07:52 (UTC) |
commit | b6df65ad2ffb50f029b96ebf9d0d78dfa23f3f19 (patch) (unidiff) | |
tree | a9cac491c119fb644ac75750cd715fce16c4c778 /noncore/apps | |
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 | |||
@@ -35,2 +35,5 @@ Profile::~Profile() { | |||
35 | } | 35 | } |
36 | QMap<QString, QString> Profile::conf()const { | ||
37 | return m_conf; | ||
38 | } | ||
36 | QString Profile::name()const { | 39 | QString Profile::name()const { |
@@ -106 +109,4 @@ bool Profile::readBoolEntry( const QString& key, bool def )const { | |||
106 | } | 109 | } |
110 | void Profile::setConf( const QMap<QString, QString>& conf ) { | ||
111 | m_conf = conf; | ||
112 | }; | ||
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 | |||
@@ -42,3 +42,3 @@ public: | |||
42 | */ | 42 | */ |
43 | QMap<QString, QString> conf(); | 43 | QMap<QString, QString> conf()const; |
44 | void clearConf(); | 44 | void clearConf(); |
@@ -57,2 +57,3 @@ public: | |||
57 | void setTerminal( int term ); | 57 | void setTerminal( int term ); |
58 | void setConf( const QMap<QString, QString>& ); | ||
58 | private: | 59 | private: |
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 | |||
@@ -24,5 +24,2 @@ void ProfileManager::load() { | |||
24 | */ | 24 | */ |
25 | /* | ||
26 | * QAsciiDict Parsing FIXME | ||
27 | */ | ||
28 | for ( it = groups.begin(); it != groups.end(); ++it ) { | 25 | for ( it = groups.begin(); it != groups.end(); ++it ) { |
@@ -35,3 +32,5 @@ void ProfileManager::load() { | |||
35 | prof.setTerminal( conf.readNumEntry("terminal") ); | 32 | prof.setTerminal( conf.readNumEntry("terminal") ); |
33 | prof.setConf( conf.items( (*it) ) ); | ||
36 | 34 | ||
35 | /* now add it */ | ||
37 | m_list.append( prof ); | 36 | m_list.append( prof ); |
@@ -54,3 +53,3 @@ Session* ProfileManager::fromProfile( const Profile& prof) { | |||
54 | * load emulation | 53 | * load emulation |
55 | * load widget | 54 | * load widget? |
56 | * set colors + fonts | 55 | * set colors + fonts |
@@ -62,3 +61,17 @@ void ProfileManager::save( ) { | |||
62 | conf.clearAll(); | 61 | conf.clearAll(); |
63 | Session* se= 0l; | 62 | Profile::ValueList::Iterator it; |
63 | for (it = m_list.begin(); it != m_list.end(); ++it ) { | ||
64 | conf.setGroup( (*it).name() ); | ||
65 | conf.writeEntry( "name", (*it).name() ); | ||
66 | conf.writeEntry( "ioplayer", (*it).ioLayerName() ); | ||
67 | conf.writeEntry( "back", (*it).background() ); | ||
68 | conf.writeEntry( "fore", (*it).foreground() ); | ||
69 | conf.writeEntry( "terminal", (*it).terminal() ); | ||
70 | /* now the config stuff */ | ||
71 | QMap<QString, QString> map = (*it).conf(); | ||
72 | QMap<QString, QString>::Iterator it; | ||
73 | for ( it = map.begin(); it != map.end(); ++it ) { | ||
74 | conf.writeEntry( it.key(), it.data() ); | ||
75 | } | ||
76 | } | ||
64 | // FIXME save | 77 | // FIXME save |