Diffstat (limited to 'noncore/apps/opie-console/profilemanager.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/profilemanager.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
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 | |||
@@ -19,24 +19,23 @@ void ProfileManager::load() { | |||
19 | QStringList groups = conf.groups(); | 19 | QStringList groups = conf.groups(); |
20 | QStringList::Iterator it; | 20 | QStringList::Iterator it; |
21 | 21 | ||
22 | /* | 22 | /* |
23 | * for each profile | 23 | * for each profile |
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 ) { |
29 | conf.setGroup( (*it) ); | 26 | conf.setGroup( (*it) ); |
30 | Profile prof; | 27 | Profile prof; |
31 | prof.setName( conf.readEntry("name") ); | 28 | prof.setName( conf.readEntry("name") ); |
32 | prof.setIOLayer( conf.readEntry("iolayer") ); | 29 | prof.setIOLayer( conf.readEntry("iolayer") ); |
33 | prof.setBackground( conf.readNumEntry("back") ); | 30 | prof.setBackground( conf.readNumEntry("back") ); |
34 | prof.setForeground( conf.readNumEntry("fore") ); | 31 | prof.setForeground( conf.readNumEntry("fore") ); |
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 ); |
38 | } | 37 | } |
39 | 38 | ||
40 | } | 39 | } |
41 | void ProfileManager::clear() { | 40 | void ProfileManager::clear() { |
42 | m_list.clear(); | 41 | m_list.clear(); |
@@ -49,17 +48,31 @@ Session* ProfileManager::fromProfile( const Profile& prof) { | |||
49 | session->setName( prof.name() ); | 48 | session->setName( prof.name() ); |
50 | session->setIOLayer(m_fact->newIOLayer(prof.ioLayerName(), | 49 | session->setIOLayer(m_fact->newIOLayer(prof.ioLayerName(), |
51 | prof) ); | 50 | prof) ); |
52 | /* | 51 | /* |
53 | * FIXME | 52 | * FIXME |
54 | * load emulation | 53 | * load emulation |
55 | * load widget | 54 | * load widget? |
56 | * set colors + fonts | 55 | * set colors + fonts |
57 | */ | 56 | */ |
58 | return session; | 57 | return session; |
59 | } | 58 | } |
60 | void ProfileManager::save( ) { | 59 | void ProfileManager::save( ) { |
61 | ProfileConfig conf("opie-console-profiles"); | 60 | ProfileConfig conf("opie-console-profiles"); |
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 |
65 | } | 78 | } |