summaryrefslogtreecommitdiff
authorzecke <zecke>2004-12-20 22:02:47 (UTC)
committer zecke <zecke>2004-12-20 22:02:47 (UTC)
commit4a9d317adb576fed2164638a1d4d15c75eebfd6b (patch) (unidiff)
treec4634ae780964cb96edae64a3fd07a641c46e427
parent086e832c16265a086e455ead0e5a64f61e2078e7 (diff)
downloadopie-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)
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/security/multiauthconfig.cpp52
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
@@ -156,9 +156,9 @@ static void test_and_start() {
156 */ 156 */
157 QString path = QPEApplication::qpeDir() + "plugins/security"; 157 QString path = QPEApplication::qpeDir() + "plugins/security";
158 QDir dir( path, "lib*.so" ); 158 QDir dir( path, "lib*.so" );
159 QStringList list = dir.entryList(); 159 QStringList list = dir.entryList();
160 160
161 m_pluginsInstalled = ! list.isEmpty(); 161 m_pluginsInstalled = ! list.isEmpty();
162 if (m_pluginsInstalled == false) 162 if (m_pluginsInstalled == false)
163 owarn << "no authentication plugins installed! Talking about it in the last tab..." << oendl; 163 owarn << "no authentication plugins installed! Talking about it in the last tab..." << oendl;
164 164
@@ -274,14 +274,14 @@ MultiauthConfig::~MultiauthConfig()
274} 274}
275 275
276/// saves the general and plugin(s) configurations 276/// saves the general and plugin(s) configurations
277void MultiauthConfig::writeConfigs() { 277void MultiauthConfig::writeConfigs() {
278 writeConfig();
279
280 MultiauthConfigWidget* confWidget = 0; 278 MultiauthConfigWidget* confWidget = 0;
281 for ( confWidget = configWidgetList.first(); confWidget != 0; 279 for ( confWidget = configWidgetList.first(); confWidget != 0;
282 confWidget = configWidgetList.next() ) 280 confWidget = configWidgetList.next() )
283 confWidget->writeConfig(); 281 confWidget->writeConfig();
282
283 writeConfig();
284} 284}
285 285
286/// on QDialog::accept, we save all the configurations and exit the QDialog normally 286/// on QDialog::accept, we save all the configurations and exit the QDialog normally
287void MultiauthConfig::accept() { 287void MultiauthConfig::accept() {
@@ -398,13 +398,13 @@ void MultiauthConfig::readConfig()
398} 398}
399 399
400void MultiauthConfig::writeConfig() 400void MultiauthConfig::writeConfig()
401{ 401{
402 Config* pcfg = new Config("Security"); 402 Config pcfg("Security");
403 403
404 if (m_pluginsInstalled) 404 if (m_pluginsInstalled)
405 { 405 {
406 pcfg->setGroup( "Plugins" ); 406 pcfg.setGroup( "Plugins" );
407 QStringList exclude; 407 QStringList exclude;
408 QStringList include; 408 QStringList include;
409 QStringList allPlugins; 409 QStringList allPlugins;
410 410
@@ -423,40 +423,40 @@ void MultiauthConfig::writeConfig()
423 allPlugins << it.key(); 423 allPlugins << it.key();
424 } 424 }
425 } 425 }
426 } 426 }
427 pcfg->writeEntry( "ExcludePlugins", exclude, ',' ); 427 pcfg.writeEntry( "ExcludePlugins", exclude, ',' );
428 pcfg->writeEntry( "IncludePlugins", include, ',' ); 428 pcfg.writeEntry( "IncludePlugins", include, ',' );
429 pcfg->writeEntry( "AllPlugins", allPlugins, ',' ); 429 pcfg.writeEntry( "AllPlugins", allPlugins, ',' );
430 430
431 pcfg->setGroup( "Misc" ); 431 pcfg.setGroup( "Misc" );
432 pcfg->writeEntry( "onStart", m_generalConfig->m_onStart->isChecked() ); 432 pcfg.writeEntry( "onStart", m_generalConfig->m_onStart->isChecked() );
433 pcfg->writeEntry( "onResume", m_generalConfig->m_onResume->isChecked() ); 433 pcfg.writeEntry( "onResume", m_generalConfig->m_onResume->isChecked() );
434 pcfg->writeEntry( "nbSuccessMin", m_generalConfig->m_nbSuccessMin->text() ); 434 pcfg.writeEntry( "nbSuccessMin", m_generalConfig->m_nbSuccessMin->text() );
435 pcfg->writeEntry( "noProtectConfig", m_generalConfig->m_noProtectConfig->isChecked() ); 435 pcfg.writeEntry( "noProtectConfig", m_generalConfig->m_noProtectConfig->isChecked() );
436 pcfg->writeEntry( "explanScreens", m_generalConfig->m_explanScreens->isChecked() ); 436 pcfg.writeEntry( "explanScreens", m_generalConfig->m_explanScreens->isChecked() );
437 } 437 }
438 438
439 /* Login and Sync stuff */ 439 /* Login and Sync stuff */
440 440
441 pcfg->setGroup("Sync"); 441 pcfg.setGroup("Sync");
442 int auth_peer=0; 442 int auth_peer=0;
443 int auth_peer_bits; 443 int auth_peer_bits;
444 QString sn = m_syncWidget->syncnet->currentText(); 444 QString sn = m_syncWidget->syncnet->currentText();
445 parseNet(sn,auth_peer,auth_peer_bits); 445 parseNet(sn,auth_peer,auth_peer_bits);
446 446
447 //this is the *selected* (active) net range 447 //this is the *selected* (active) net range
448 pcfg->writeEntry("auth_peer",auth_peer); 448 pcfg.writeEntry("auth_peer",auth_peer);
449 pcfg->writeEntry("auth_peer_bits",auth_peer_bits); 449 pcfg.writeEntry("auth_peer_bits",auth_peer_bits);
450 450
451 //write back all other net ranges in *cleartext* 451 //write back all other net ranges in *cleartext*
452 for (int i=0; i<10; i++) { 452 for (int i=0; i<10; i++) {
453 QString target; 453 QString target;
454 target.sprintf("net%d", i); 454 target.sprintf("net%d", i);
455 if ( i < m_syncWidget->syncnet->count() ) 455 if ( i < m_syncWidget->syncnet->count() )
456 pcfg->writeEntry(target, m_syncWidget->syncnet->text(i)); 456 pcfg.writeEntry(target, m_syncWidget->syncnet->text(i));
457 else // no more entry in the syncnet list -> we clear the line 457 else // no more entry in the syncnet list -> we clear the line
458 pcfg->writeEntry(target, ""); 458 pcfg.writeEntry(target, "");
459 } 459 }
460 460
461#ifdef ODP 461#ifdef ODP
462#error "Use 0,1,2 and use Launcher" 462#error "Use 0,1,2 and use Launcher"
@@ -473,22 +473,22 @@ void MultiauthConfig::writeConfig()
473 case 2: 473 case 2:
474 value = 0x04; 474 value = 0x04;
475 break; 475 break;
476 } 476 }
477 pcfg->setGroup("SyncMode"); 477 pcfg.setGroup("SyncMode");
478 pcfg->writeEntry( "Mode", value ); 478 pcfg.writeEntry( "Mode", value );
479 479
480 /* 480 /*
481 pcfg->setGroup("Remote"); 481 pcfg.setGroup("Remote");
482 if ( telnetAvailable() ) 482 if ( telnetAvailable() )
483 pcfg->writeEntry("allow_telnet",telnet->isChecked()); 483 pcfg.writeEntry("allow_telnet",telnet->isChecked());
484 if ( sshAvailable() ) 484 if ( sshAvailable() )
485 pcfg->writeEntry("allow_ssh",ssh->isChecked()); 485 pcfg.writeEntry("allow_ssh",ssh->isChecked());
486 // ### write ssh/telnet sys config files 486 // ### write ssh/telnet sys config files
487 */ 487 */
488 488
489 //release the Config handler 489 //release the Config handler
490 delete pcfg; 490 pcfg.write();
491 491
492 QString configFile = QPEApplication::qpeDir() + "etc/opie-login.conf"; 492 QString configFile = QPEApplication::qpeDir() + "etc/opie-login.conf";
493 Config loginCfg(configFile,Config::File); 493 Config loginCfg(configFile,Config::File);
494 loginCfg.setGroup("General"); 494 loginCfg.setGroup("General");