summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/profilemanager.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-console/profilemanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/profilemanager.cpp23
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() {
QStringList groups = conf.groups();
QStringList::Iterator it;
/*
* for each profile
*/
- /*
- * QAsciiDict Parsing FIXME
- */
for ( it = groups.begin(); it != groups.end(); ++it ) {
conf.setGroup( (*it) );
Profile prof;
prof.setName( conf.readEntry("name") );
prof.setIOLayer( conf.readEntry("iolayer") );
prof.setBackground( conf.readNumEntry("back") );
prof.setForeground( conf.readNumEntry("fore") );
prof.setTerminal( conf.readNumEntry("terminal") );
+ prof.setConf( conf.items( (*it) ) );
+ /* now add it */
m_list.append( prof );
}
}
void ProfileManager::clear() {
m_list.clear();
@@ -49,17 +48,31 @@ Session* ProfileManager::fromProfile( const Profile& prof) {
session->setName( prof.name() );
session->setIOLayer(m_fact->newIOLayer(prof.ioLayerName(),
prof) );
/*
* FIXME
* load emulation
- * load widget
+ * load widget?
* set colors + fonts
*/
return session;
}
void ProfileManager::save( ) {
ProfileConfig conf("opie-console-profiles");
conf.clearAll();
- Session* se= 0l;
+ Profile::ValueList::Iterator it;
+ for (it = m_list.begin(); it != m_list.end(); ++it ) {
+ conf.setGroup( (*it).name() );
+ conf.writeEntry( "name", (*it).name() );
+ conf.writeEntry( "ioplayer", (*it).ioLayerName() );
+ conf.writeEntry( "back", (*it).background() );
+ conf.writeEntry( "fore", (*it).foreground() );
+ conf.writeEntry( "terminal", (*it).terminal() );
+ /* now the config stuff */
+ QMap<QString, QString> map = (*it).conf();
+ QMap<QString, QString>::Iterator it;
+ for ( it = map.begin(); it != map.end(); ++it ) {
+ conf.writeEntry( it.key(), it.data() );
+ }
+ }
// FIXME save
}