Diffstat (limited to 'noncore/apps/opie-console/profilemanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/profilemanager.cpp | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/noncore/apps/opie-console/profilemanager.cpp b/noncore/apps/opie-console/profilemanager.cpp index 95a46f9..e5aedb6 100644 --- a/noncore/apps/opie-console/profilemanager.cpp +++ b/noncore/apps/opie-console/profilemanager.cpp | |||
@@ -15,40 +15,37 @@ | |||
15 | #include "profilemanager.h" | 15 | #include "profilemanager.h" |
16 | 16 | ||
17 | ProfileManager::ProfileManager( MetaFactory* fact ) | 17 | ProfileManager::ProfileManager( MetaFactory* fact ) |
18 | : m_fact( fact ) | 18 | : m_fact( fact ) |
19 | { | 19 | { |
20 | 20 | ||
21 | } | 21 | } |
22 | ProfileManager::~ProfileManager() { | 22 | ProfileManager::~ProfileManager() { |
23 | 23 | ||
24 | } | 24 | } |
25 | void ProfileManager::load() { | 25 | void ProfileManager::load() { |
26 | m_list.clear(); | 26 | m_list.clear(); |
27 | qWarning("load"); | ||
28 | ProfileConfig conf("opie-console-profiles"); | 27 | ProfileConfig conf("opie-console-profiles"); |
29 | QStringList groups = conf.groups(); | 28 | QStringList groups = conf.groups(); |
30 | QStringList::Iterator it; | 29 | QStringList::Iterator it; |
31 | 30 | ||
32 | /* | 31 | /* |
33 | * for each profile | 32 | * for each profile |
34 | */ | 33 | */ |
35 | for ( it = groups.begin(); it != groups.end(); ++it ) { | 34 | for ( it = groups.begin(); it != groups.end(); ++it ) { |
36 | qWarning("group " + (*it) ); | ||
37 | conf.setGroup( (*it) ); | 35 | conf.setGroup( (*it) ); |
38 | Profile prof; | 36 | Profile prof; |
39 | prof.setName( conf.readEntry("name") ); | 37 | prof.setName( conf.readEntry("name") ); |
40 | prof.setIOLayer( conf.readEntry("iolayer").utf8() ); | 38 | prof.setIOLayer( conf.readEntry("iolayer").utf8() ); |
41 | prof.setTerminalName( conf.readEntry("term").utf8() ); | 39 | prof.setTerminalName( conf.readEntry("term").utf8() ); |
42 | qWarning(" %s %s", conf.readEntry("iolayer").latin1(), prof.ioLayerName().data() ); | ||
43 | prof.setBackground( conf.readNumEntry("back") ); | 40 | prof.setBackground( conf.readNumEntry("back") ); |
44 | prof.setForeground( conf.readNumEntry("fore") ); | 41 | prof.setForeground( conf.readNumEntry("fore") ); |
45 | prof.setTerminal( conf.readNumEntry("terminal") ); | 42 | prof.setTerminal( conf.readNumEntry("terminal") ); |
46 | 43 | ||
47 | // THIS is evil because all data get's reset | 44 | // THIS is evil because all data get's reset |
48 | prof.setConf( conf.items( (*it) ) ); | 45 | prof.setConf( conf.items( (*it) ) ); |
49 | 46 | ||
50 | /* now add it */ | 47 | /* now add it */ |
51 | m_list.append( prof ); | 48 | m_list.append( prof ); |
52 | } | 49 | } |
53 | 50 | ||
54 | } | 51 | } |
@@ -112,25 +109,24 @@ void ProfileManager::save( ) { | |||
112 | for (it2 = m_list.begin(); it2 != m_list.end(); ++it2 ) { | 109 | for (it2 = m_list.begin(); it2 != m_list.end(); ++it2 ) { |
113 | conf.setGroup( (*it2).name() ); | 110 | conf.setGroup( (*it2).name() ); |
114 | 111 | ||
115 | /* now the config stuff */ | 112 | /* now the config stuff */ |
116 | QMap<QString, QString> map = (*it2).conf(); | 113 | QMap<QString, QString> map = (*it2).conf(); |
117 | QMap<QString, QString>::Iterator confIt; | 114 | QMap<QString, QString>::Iterator confIt; |
118 | for ( confIt = map.begin(); confIt != map.end(); ++confIt ) { | 115 | for ( confIt = map.begin(); confIt != map.end(); ++confIt ) { |
119 | conf.writeEntry( confIt.key(), confIt.data() ); | 116 | conf.writeEntry( confIt.key(), confIt.data() ); |
120 | } | 117 | } |
121 | 118 | ||
122 | conf.writeEntry( "name", (*it2).name() ); | 119 | conf.writeEntry( "name", (*it2).name() ); |
123 | QString str = QString::fromUtf8( (*it2).ioLayerName() ); | 120 | QString str = QString::fromUtf8( (*it2).ioLayerName() ); |
124 | qWarning("IOLayerName " + str ); | ||
125 | 121 | ||
126 | conf.writeEntry( "iolayer", str ); | 122 | conf.writeEntry( "iolayer", str ); |
127 | conf.writeEntry( "term", QString::fromUtf8( (*it2).terminalName() ) ); | 123 | conf.writeEntry( "term", QString::fromUtf8( (*it2).terminalName() ) ); |
128 | conf.writeEntry( "back", (*it2).background() ); | 124 | conf.writeEntry( "back", (*it2).background() ); |
129 | conf.writeEntry( "fore", (*it2).foreground() ); | 125 | conf.writeEntry( "fore", (*it2).foreground() ); |
130 | conf.writeEntry( "terminal", (*it2).terminal() ); | 126 | conf.writeEntry( "terminal", (*it2).terminal() ); |
131 | } | 127 | } |
132 | } | 128 | } |
133 | void ProfileManager::setProfiles( const Profile::ValueList& list ) { | 129 | void ProfileManager::setProfiles( const Profile::ValueList& list ) { |
134 | m_list = list; | 130 | m_list = list; |
135 | }; | 131 | }; |
136 | Profile ProfileManager::profile( const QString& name )const { | 132 | Profile ProfileManager::profile( const QString& name )const { |