author | zecke <zecke> | 2004-12-20 22:02:47 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-12-20 22:02:47 (UTC) |
commit | 4a9d317adb576fed2164638a1d4d15c75eebfd6b (patch) (side-by-side diff) | |
tree | c4634ae780964cb96edae64a3fd07a641c46e427 | |
parent | 086e832c16265a086e455ead0e5a64f61e2078e7 (diff) | |
download | opie-4a9d317adb576fed2164638a1d4d15c75eebfd6b.zip opie-4a9d317adb576fed2164638a1d4d15c75eebfd6b.tar.gz opie-4a9d317adb576fed2164638a1d4d15c75eebfd6b.tar.bz2 |
Keep only 'local' Config instances to avoid some older
instance reverting changes! (weakness of Config class)
-rw-r--r-- | core/settings/security/multiauthconfig.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/core/settings/security/multiauthconfig.cpp b/core/settings/security/multiauthconfig.cpp index 45d691b..7a5f7b9 100644 --- a/core/settings/security/multiauthconfig.cpp +++ b/core/settings/security/multiauthconfig.cpp @@ -154,13 +154,13 @@ static void test_and_start() { /* Checks (and memorizes) if any authentication plugins are * installed on the system */ QString path = QPEApplication::qpeDir() + "plugins/security"; QDir dir( path, "lib*.so" ); QStringList list = dir.entryList(); - + m_pluginsInstalled = ! list.isEmpty(); if (m_pluginsInstalled == false) owarn << "no authentication plugins installed! Talking about it in the last tab..." << oendl; setCaption( tr( "Security configuration" ) ); QVBoxLayout *layout = new QVBoxLayout( this ); @@ -272,18 +272,18 @@ static void test_and_start() { MultiauthConfig::~MultiauthConfig() { } /// saves the general and plugin(s) configurations void MultiauthConfig::writeConfigs() { - writeConfig(); - MultiauthConfigWidget* confWidget = 0; for ( confWidget = configWidgetList.first(); confWidget != 0; confWidget = configWidgetList.next() ) confWidget->writeConfig(); + + writeConfig(); } /// on QDialog::accept, we save all the configurations and exit the QDialog normally void MultiauthConfig::accept() { writeConfigs(); QDialog::accept(); @@ -396,17 +396,17 @@ void MultiauthConfig::readConfig() updateGUI(); } void MultiauthConfig::writeConfig() { - Config* pcfg = new Config("Security"); + Config pcfg("Security"); if (m_pluginsInstalled) { - pcfg->setGroup( "Plugins" ); + pcfg.setGroup( "Plugins" ); QStringList exclude; QStringList include; QStringList allPlugins; QListViewItemIterator list_it( m_pluginListView ); @@ -421,44 +421,44 @@ void MultiauthConfig::writeConfig() } if ( list_it.current() == (*it) ) { allPlugins << it.key(); } } } - pcfg->writeEntry( "ExcludePlugins", exclude, ',' ); - pcfg->writeEntry( "IncludePlugins", include, ',' ); - pcfg->writeEntry( "AllPlugins", allPlugins, ',' ); - - pcfg->setGroup( "Misc" ); - pcfg->writeEntry( "onStart", m_generalConfig->m_onStart->isChecked() ); - pcfg->writeEntry( "onResume", m_generalConfig->m_onResume->isChecked() ); - pcfg->writeEntry( "nbSuccessMin", m_generalConfig->m_nbSuccessMin->text() ); - pcfg->writeEntry( "noProtectConfig", m_generalConfig->m_noProtectConfig->isChecked() ); - pcfg->writeEntry( "explanScreens", m_generalConfig->m_explanScreens->isChecked() ); + pcfg.writeEntry( "ExcludePlugins", exclude, ',' ); + pcfg.writeEntry( "IncludePlugins", include, ',' ); + pcfg.writeEntry( "AllPlugins", allPlugins, ',' ); + + pcfg.setGroup( "Misc" ); + pcfg.writeEntry( "onStart", m_generalConfig->m_onStart->isChecked() ); + pcfg.writeEntry( "onResume", m_generalConfig->m_onResume->isChecked() ); + pcfg.writeEntry( "nbSuccessMin", m_generalConfig->m_nbSuccessMin->text() ); + pcfg.writeEntry( "noProtectConfig", m_generalConfig->m_noProtectConfig->isChecked() ); + pcfg.writeEntry( "explanScreens", m_generalConfig->m_explanScreens->isChecked() ); } /* Login and Sync stuff */ - pcfg->setGroup("Sync"); + pcfg.setGroup("Sync"); int auth_peer=0; int auth_peer_bits; QString sn = m_syncWidget->syncnet->currentText(); parseNet(sn,auth_peer,auth_peer_bits); //this is the *selected* (active) net range - pcfg->writeEntry("auth_peer",auth_peer); - pcfg->writeEntry("auth_peer_bits",auth_peer_bits); + pcfg.writeEntry("auth_peer",auth_peer); + pcfg.writeEntry("auth_peer_bits",auth_peer_bits); //write back all other net ranges in *cleartext* for (int i=0; i<10; i++) { QString target; target.sprintf("net%d", i); if ( i < m_syncWidget->syncnet->count() ) - pcfg->writeEntry(target, m_syncWidget->syncnet->text(i)); + pcfg.writeEntry(target, m_syncWidget->syncnet->text(i)); else // no more entry in the syncnet list -> we clear the line - pcfg->writeEntry(target, ""); + pcfg.writeEntry(target, ""); } #ifdef ODP #error "Use 0,1,2 and use Launcher" #endif /* keep the old code so we don't use currentItem directly */ @@ -471,26 +471,26 @@ void MultiauthConfig::writeConfig() value = 0x02; break; case 2: value = 0x04; break; } - pcfg->setGroup("SyncMode"); - pcfg->writeEntry( "Mode", value ); + pcfg.setGroup("SyncMode"); + pcfg.writeEntry( "Mode", value ); /* - pcfg->setGroup("Remote"); + pcfg.setGroup("Remote"); if ( telnetAvailable() ) - pcfg->writeEntry("allow_telnet",telnet->isChecked()); + pcfg.writeEntry("allow_telnet",telnet->isChecked()); if ( sshAvailable() ) - pcfg->writeEntry("allow_ssh",ssh->isChecked()); + pcfg.writeEntry("allow_ssh",ssh->isChecked()); // ### write ssh/telnet sys config files */ //release the Config handler - delete pcfg; + pcfg.write(); QString configFile = QPEApplication::qpeDir() + "etc/opie-login.conf"; Config loginCfg(configFile,Config::File); loginCfg.setGroup("General"); if (autoLogin) { |