author | zecke <zecke> | 2002-10-08 23:13:17 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-08 23:13:17 (UTC) |
commit | 8c353ec8b86ee8f82cc25172fb69dd5fee65e848 (patch) (side-by-side diff) | |
tree | a4549bcba962689edb9c40efcb23114cae5fcda2 /noncore/apps/opie-console/profilemanager.cpp | |
parent | ca0c224318a50c6618691fb30f39aa1d9b0b8a4f (diff) | |
download | opie-8c353ec8b86ee8f82cc25172fb69dd5fee65e848.zip opie-8c353ec8b86ee8f82cc25172fb69dd5fee65e848.tar.gz opie-8c353ec8b86ee8f82cc25172fb69dd5fee65e848.tar.bz2 |
default I dunno
IOLayerBase the return values for speed()/parity()/flow() added
MainWindow debug code :(
opie-console.pro addition of serialconfigwidget.*
ProfileManager fix removing of Profiles quite rude way of doing it
Configure stuff is done and roughly tested
The migration is done!
TO WAZLAF: you might want to adjust Parity stuff for your needs!
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,12 +1,16 @@ +#include <stdio.h> +#include <stdlib.h> + +#include <qfile.h> #include <qpe/config.h> #include "metafactory.h" #include "profileconfig.h" #include "profilemanager.h" ProfileManager::ProfileManager( MetaFactory* fact ) : m_fact( fact ) { } @@ -21,24 +25,25 @@ void ProfileManager::load() { QStringList::Iterator it; /* * for each profile */ for ( it = groups.begin(); it != groups.end(); ++it ) { qWarning("group " + (*it) ); conf.setGroup( (*it) ); Profile prof; prof.setName( conf.readEntry("name") ); prof.setIOLayer( conf.readEntry("iolayer").utf8() ); prof.setTerminalName( conf.readEntry("term").utf8() ); + qWarning(" %s %s", conf.readEntry("iolayer").latin1(), prof.ioLayerName().data() ); 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(); @@ -51,31 +56,31 @@ Session* ProfileManager::fromProfile( const Profile& prof) { session->setName( prof.name() ); session->setIOLayer(m_fact->newIOLayer(prof.ioLayerName(), prof) ); /* * FIXME * load emulation * load widget? * set colors + fonts */ return session; } void ProfileManager::save( ) { + QFile::remove( (QString(getenv("HOME") )+ "/Settings/opie-console-profiles.conf" ) ); ProfileConfig conf("opie-console-profiles"); - conf.clearAll(); 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", QString::fromUtf8( (*it).ioLayerName() ) ); + conf.writeEntry( "iolayer", QString::fromUtf8( (*it).ioLayerName() ) ); conf.writeEntry( "term", QString::fromUtf8( (*it).terminalName() ) ); 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() ); } } } |