author | zecke <zecke> | 2002-10-14 15:57:59 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-14 15:57:59 (UTC) |
commit | da3868438e739310862bf65b0d0c8ffa864392e8 (patch) (unidiff) | |
tree | 16cdd38a4fc088d4483eeab8363e9a3b503d3f25 | |
parent | 16caa7343f4190a31bd80a9caa76118d7177ad3f (diff) | |
download | opie-da3868438e739310862bf65b0d0c8ffa864392e8.zip opie-da3868438e739310862bf65b0d0c8ffa864392e8.tar.gz opie-da3868438e739310862bf65b0d0c8ffa864392e8.tar.bz2 |
What does happen if you store the whole config
inside the conf map?
yes on save custom data overwrites fixed data...
As a workaround we now do save custom data first
and then the fixed stuff
-rw-r--r-- | noncore/apps/opie-console/profilemanager.cpp | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/noncore/apps/opie-console/profilemanager.cpp b/noncore/apps/opie-console/profilemanager.cpp index c965700..4b88dec 100644 --- a/noncore/apps/opie-console/profilemanager.cpp +++ b/noncore/apps/opie-console/profilemanager.cpp | |||
@@ -44,2 +44,4 @@ void ProfileManager::load() { | |||
44 | prof.setTerminal( conf.readNumEntry("terminal") ); | 44 | prof.setTerminal( conf.readNumEntry("terminal") ); |
45 | |||
46 | // THIS is evil because all data get's reset | ||
45 | prof.setConf( conf.items( (*it) ) ); | 47 | prof.setConf( conf.items( (*it) ) ); |
@@ -96,17 +98,22 @@ void ProfileManager::save( ) { | |||
96 | ProfileConfig conf("opie-console-profiles"); | 98 | ProfileConfig conf("opie-console-profiles"); |
97 | Profile::ValueList::Iterator it; | 99 | Profile::ValueList::Iterator it2; |
98 | for (it = m_list.begin(); it != m_list.end(); ++it ) { | 100 | for (it2 = m_list.begin(); it2 != m_list.end(); ++it2 ) { |
99 | conf.setGroup( (*it).name() ); | 101 | conf.setGroup( (*it2).name() ); |
100 | conf.writeEntry( "name", (*it).name() ); | 102 | |
101 | conf.writeEntry( "iolayer", QString::fromUtf8( (*it).ioLayerName() ) ); | ||
102 | conf.writeEntry( "term", QString::fromUtf8( (*it).terminalName() ) ); | ||
103 | conf.writeEntry( "back", (*it).background() ); | ||
104 | conf.writeEntry( "fore", (*it).foreground() ); | ||
105 | conf.writeEntry( "terminal", (*it).terminal() ); | ||
106 | /* now the config stuff */ | 103 | /* now the config stuff */ |
107 | QMap<QString, QString> map = (*it).conf(); | 104 | QMap<QString, QString> map = (*it2).conf(); |
108 | QMap<QString, QString>::Iterator it; | 105 | QMap<QString, QString>::Iterator confIt; |
109 | for ( it = map.begin(); it != map.end(); ++it ) { | 106 | for ( confIt = map.begin(); confIt != map.end(); ++confIt ) { |
110 | conf.writeEntry( it.key(), it.data() ); | 107 | conf.writeEntry( confIt.key(), confIt.data() ); |
111 | } | 108 | } |
109 | |||
110 | conf.writeEntry( "name", (*it2).name() ); | ||
111 | QString str = QString::fromUtf8( (*it2).ioLayerName() ); | ||
112 | qWarning("IOLayerName " + str ); | ||
113 | |||
114 | conf.writeEntry( "iolayer", str ); | ||
115 | conf.writeEntry( "term", QString::fromUtf8( (*it2).terminalName() ) ); | ||
116 | conf.writeEntry( "back", (*it2).background() ); | ||
117 | conf.writeEntry( "fore", (*it2).foreground() ); | ||
118 | conf.writeEntry( "terminal", (*it2).terminal() ); | ||
112 | } | 119 | } |