Diffstat (limited to 'noncore/apps/opie-console/profilemanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/profilemanager.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/profilemanager.cpp b/noncore/apps/opie-console/profilemanager.cpp index 6ad08b5..e66ebcc 100644 --- a/noncore/apps/opie-console/profilemanager.cpp +++ b/noncore/apps/opie-console/profilemanager.cpp | |||
@@ -1,6 +1,10 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <stdlib.h> | ||
3 | |||
4 | #include <qfile.h> | ||
1 | 5 | ||
2 | #include <qpe/config.h> | 6 | #include <qpe/config.h> |
3 | 7 | ||
4 | #include "metafactory.h" | 8 | #include "metafactory.h" |
5 | #include "profileconfig.h" | 9 | #include "profileconfig.h" |
6 | #include "profilemanager.h" | 10 | #include "profilemanager.h" |
@@ -27,12 +31,13 @@ void ProfileManager::load() { | |||
27 | qWarning("group " + (*it) ); | 31 | qWarning("group " + (*it) ); |
28 | conf.setGroup( (*it) ); | 32 | conf.setGroup( (*it) ); |
29 | Profile prof; | 33 | Profile prof; |
30 | prof.setName( conf.readEntry("name") ); | 34 | prof.setName( conf.readEntry("name") ); |
31 | prof.setIOLayer( conf.readEntry("iolayer").utf8() ); | 35 | prof.setIOLayer( conf.readEntry("iolayer").utf8() ); |
32 | prof.setTerminalName( conf.readEntry("term").utf8() ); | 36 | prof.setTerminalName( conf.readEntry("term").utf8() ); |
37 | qWarning(" %s %s", conf.readEntry("iolayer").latin1(), prof.ioLayerName().data() ); | ||
33 | prof.setBackground( conf.readNumEntry("back") ); | 38 | prof.setBackground( conf.readNumEntry("back") ); |
34 | prof.setForeground( conf.readNumEntry("fore") ); | 39 | prof.setForeground( conf.readNumEntry("fore") ); |
35 | prof.setTerminal( conf.readNumEntry("terminal") ); | 40 | prof.setTerminal( conf.readNumEntry("terminal") ); |
36 | prof.setConf( conf.items( (*it) ) ); | 41 | prof.setConf( conf.items( (*it) ) ); |
37 | 42 | ||
38 | /* now add it */ | 43 | /* now add it */ |
@@ -57,19 +62,19 @@ Session* ProfileManager::fromProfile( const Profile& prof) { | |||
57 | * load widget? | 62 | * load widget? |
58 | * set colors + fonts | 63 | * set colors + fonts |
59 | */ | 64 | */ |
60 | return session; | 65 | return session; |
61 | } | 66 | } |
62 | void ProfileManager::save( ) { | 67 | void ProfileManager::save( ) { |
68 | QFile::remove( (QString(getenv("HOME") )+ "/Settings/opie-console-profiles.conf" ) ); | ||
63 | ProfileConfig conf("opie-console-profiles"); | 69 | ProfileConfig conf("opie-console-profiles"); |
64 | conf.clearAll(); | ||
65 | Profile::ValueList::Iterator it; | 70 | Profile::ValueList::Iterator it; |
66 | for (it = m_list.begin(); it != m_list.end(); ++it ) { | 71 | for (it = m_list.begin(); it != m_list.end(); ++it ) { |
67 | conf.setGroup( (*it).name() ); | 72 | conf.setGroup( (*it).name() ); |
68 | conf.writeEntry( "name", (*it).name() ); | 73 | conf.writeEntry( "name", (*it).name() ); |
69 | conf.writeEntry( "ioplayer", QString::fromUtf8( (*it).ioLayerName() ) ); | 74 | conf.writeEntry( "iolayer", QString::fromUtf8( (*it).ioLayerName() ) ); |
70 | conf.writeEntry( "term", QString::fromUtf8( (*it).terminalName() ) ); | 75 | conf.writeEntry( "term", QString::fromUtf8( (*it).terminalName() ) ); |
71 | conf.writeEntry( "back", (*it).background() ); | 76 | conf.writeEntry( "back", (*it).background() ); |
72 | conf.writeEntry( "fore", (*it).foreground() ); | 77 | conf.writeEntry( "fore", (*it).foreground() ); |
73 | conf.writeEntry( "terminal", (*it).terminal() ); | 78 | conf.writeEntry( "terminal", (*it).terminal() ); |
74 | /* now the config stuff */ | 79 | /* now the config stuff */ |
75 | QMap<QString, QString> map = (*it).conf(); | 80 | QMap<QString, QString> map = (*it).conf(); |