summaryrefslogtreecommitdiffabout
path: root/libkdepim/kcmconfigs
authorulf69 <ulf69>2004-08-10 19:40:27 (UTC)
committer ulf69 <ulf69>2004-08-10 19:40:27 (UTC)
commit20a2709f00d4e99eace87338fefc54701fcc47c0 (patch) (unidiff)
treed0914ea349b33322e837e3e67aacd0bfdc024a81 /libkdepim/kcmconfigs
parent2666ac52add8d79e34a04a64e4d5f092dd3d3d7e (diff)
downloadkdepimpi-20a2709f00d4e99eace87338fefc54701fcc47c0.zip
kdepimpi-20a2709f00d4e99eace87338fefc54701fcc47c0.tar.gz
kdepimpi-20a2709f00d4e99eace87338fefc54701fcc47c0.tar.bz2
release cache of externalapphandler after changes have been applied
Diffstat (limited to 'libkdepim/kcmconfigs') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
index 9964eeb..c8b94db 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
@@ -237,96 +237,97 @@ void KDEPIMConfigWidget::saveEditFieldSettings()
237 break; 237 break;
238 case(ExternalAppHandler::SMS): 238 case(ExternalAppHandler::SMS):
239 mSMSClient = mClient->currentItem(); 239 mSMSClient = mClient->currentItem();
240 break; 240 break;
241 case(ExternalAppHandler::FAX): 241 case(ExternalAppHandler::FAX):
242 mFaxClient = mClient->currentItem(); 242 mFaxClient = mClient->currentItem();
243 break; 243 break;
244 case(ExternalAppHandler::PAGER): 244 case(ExternalAppHandler::PAGER):
245 mPagerClient = mClient->currentItem(); 245 mPagerClient = mClient->currentItem();
246 break; 246 break;
247 default: 247 default:
248 return; 248 return;
249 } 249 }
250 250
251 //store the current data back to the apropriate membervariables if we had set it to "other" 251 //store the current data back to the apropriate membervariables if we had set it to "other"
252 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) 252 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC))
253 { 253 {
254 mEmailOtherChannel = mChannel->text(); 254 mEmailOtherChannel = mChannel->text();
255 mEmailOtherMessage = mMessage->text(); 255 mEmailOtherMessage = mMessage->text();
256 mEmailOtherMessageParameters = mParameters->text(); 256 mEmailOtherMessageParameters = mParameters->text();
257 mEmailOtherMessage2 = mMessage2->text(); 257 mEmailOtherMessage2 = mMessage2->text();
258 mEmailOtherMessageParameters2 = mParameters2->text(); 258 mEmailOtherMessageParameters2 = mParameters2->text();
259 } 259 }
260 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) 260 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC))
261 { 261 {
262 mPhoneOtherChannel = mChannel->text(); 262 mPhoneOtherChannel = mChannel->text();
263 mPhoneOtherMessage = mMessage->text(); 263 mPhoneOtherMessage = mMessage->text();
264 mPhoneOtherMessageParameters = mParameters->text(); 264 mPhoneOtherMessageParameters = mParameters->text();
265 } 265 }
266 else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) 266 else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC))
267 { 267 {
268 mSMSOtherChannel = mChannel->text(); 268 mSMSOtherChannel = mChannel->text();
269 mSMSOtherMessage = mMessage->text(); 269 mSMSOtherMessage = mMessage->text();
270 mSMSOtherMessageParameters = mParameters->text(); 270 mSMSOtherMessageParameters = mParameters->text();
271 } 271 }
272 else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) 272 else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC))
273 { 273 {
274 mFaxOtherChannel = mChannel->text(); 274 mFaxOtherChannel = mChannel->text();
275 mFaxOtherMessage = mMessage->text(); 275 mFaxOtherMessage = mMessage->text();
276 mFaxOtherMessageParameters = mParameters->text(); 276 mFaxOtherMessageParameters = mParameters->text();
277 } 277 }
278 else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) 278 else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC))
279 { 279 {
280 mPagerOtherChannel = mChannel->text(); 280 mPagerOtherChannel = mChannel->text();
281 mPagerOtherMessage = mMessage->text(); 281 mPagerOtherMessage = mMessage->text();
282 mPagerOtherMessageParameters = mParameters->text(); 282 mPagerOtherMessageParameters = mParameters->text();
283 } 283 }
284 284
285
285} 286}
286 287
287void KDEPIMConfigWidget::updateClientWidgets() 288void KDEPIMConfigWidget::updateClientWidgets()
288{ 289{
289 bool blocked = signalsBlocked(); 290 bool blocked = signalsBlocked();
290 blockSignals( true ); 291 blockSignals( true );
291 292
292 // at this point we assume, that mCurrentApp and mCurrentClient are set to the values that we want to display 293 // at this point we assume, that mCurrentApp and mCurrentClient are set to the values that we want to display
293 QMap<ExternalAppHandler::Types, QString>::Iterator it = mExternalAppsMap.find ( mCurrentApp ); 294 QMap<ExternalAppHandler::Types, QString>::Iterator it = mExternalAppsMap.find ( mCurrentApp );
294 if (it == mExternalAppsMap.end()) 295 if (it == mExternalAppsMap.end())
295 return; 296 return;
296 297
297 // update group box 298 // update group box
298 mExternalAppGroupBox->setTitle(i18n( "Used %1 Client" ).arg(it.data())); 299 mExternalAppGroupBox->setTitle(i18n( "Used %1 Client" ).arg(it.data()));
299 300
300 //update the entries in the client combobox 301 //update the entries in the client combobox
301 mClient->clear(); 302 mClient->clear();
302 303
303 QList<DefaultAppItem> items = ExternalAppHandler::instance()->getAvailableDefaultItems(mCurrentApp); 304 QList<DefaultAppItem> items = ExternalAppHandler::instance()->getAvailableDefaultItems(mCurrentApp);
304 DefaultAppItem* dai; 305 DefaultAppItem* dai;
305 for ( dai=items.first(); dai != 0; dai=items.next() ) 306 for ( dai=items.first(); dai != 0; dai=items.next() )
306 { 307 {
307 mClient->insertItem( i18n(dai->_label), dai->_id ); 308 mClient->insertItem( i18n(dai->_label), dai->_id );
308 309
309 if (dai->_id == mCurrentClient) 310 if (dai->_id == mCurrentClient)
310 { 311 {
311 //restore the edit fields with the data of the local membervariables if we had set it to "other". 312 //restore the edit fields with the data of the local membervariables if we had set it to "other".
312 //Otherwise take the default data from externalapphandler. 313 //Otherwise take the default data from externalapphandler.
313 mChannel->setText(dai->_channel); 314 mChannel->setText(dai->_channel);
314 mMessage->setText(dai->_message); 315 mMessage->setText(dai->_message);
315 mParameters->setText(dai->_parameters); 316 mParameters->setText(dai->_parameters);
316 mMessage2->setText(dai->_message2); 317 mMessage2->setText(dai->_message2);
317 mParameters2->setText(dai->_parameters2); 318 mParameters2->setText(dai->_parameters2);
318 319
319 320
320 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) 321 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC))
321 { 322 {
322 mChannel->setText(mEmailOtherChannel); 323 mChannel->setText(mEmailOtherChannel);
323 mMessage->setText(mEmailOtherMessage); 324 mMessage->setText(mEmailOtherMessage);
324 mParameters->setText(mEmailOtherMessageParameters); 325 mParameters->setText(mEmailOtherMessageParameters);
325 mMessage2->setText(mEmailOtherMessage2); 326 mMessage2->setText(mEmailOtherMessage2);
326 mParameters2->setText(mEmailOtherMessageParameters2); 327 mParameters2->setText(mEmailOtherMessageParameters2);
327 } 328 }
328 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) 329 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC))
329 { 330 {
330 mChannel->setText(mPhoneOtherChannel); 331 mChannel->setText(mPhoneOtherChannel);
331 mMessage->setText(mPhoneOtherMessage); 332 mMessage->setText(mPhoneOtherMessage);
332 mParameters->setText(mPhoneOtherMessageParameters); 333 mParameters->setText(mPhoneOtherMessageParameters);
@@ -453,96 +454,99 @@ void KDEPIMConfigWidget::restoreSettings(KPimGlobalPrefs* prefs)
453 mPagerOtherChannel = prefs->mPagerOtherChannel; 454 mPagerOtherChannel = prefs->mPagerOtherChannel;
454 mPagerOtherMessage = prefs->mPagerOtherMessage; 455 mPagerOtherMessage = prefs->mPagerOtherMessage;
455 mPagerOtherMessageParameters = prefs->mPagerOtherMessageParameters; 456 mPagerOtherMessageParameters = prefs->mPagerOtherMessageParameters;
456 457
457 mCurrentApp = ExternalAppHandler::EMAIL; 458 mCurrentApp = ExternalAppHandler::EMAIL;
458 mCurrentClient = mEmailClient; 459 mCurrentClient = mEmailClient;
459 460
460 updateClientWidgets(); 461 updateClientWidgets();
461 462
462 blockSignals( blocked ); 463 blockSignals( blocked );
463 464
464 emit changed( false ); 465 emit changed( false );
465 466
466} 467}
467 468
468void KDEPIMConfigWidget::saveSettings(KPimGlobalPrefs* prefs) 469void KDEPIMConfigWidget::saveSettings(KPimGlobalPrefs* prefs)
469{ 470{
470 saveEditFieldSettings(); 471 saveEditFieldSettings();
471 472
472 prefs->mEmailClient = mEmailClient; 473 prefs->mEmailClient = mEmailClient;
473 prefs->mEmailOtherChannel = mEmailOtherChannel; 474 prefs->mEmailOtherChannel = mEmailOtherChannel;
474 prefs->mEmailOtherMessage = mEmailOtherMessage; 475 prefs->mEmailOtherMessage = mEmailOtherMessage;
475 prefs->mEmailOtherMessageParameters = mEmailOtherMessageParameters; 476 prefs->mEmailOtherMessageParameters = mEmailOtherMessageParameters;
476 prefs->mEmailOtherMessage2 = mEmailOtherMessage2; 477 prefs->mEmailOtherMessage2 = mEmailOtherMessage2;
477 prefs->mEmailOtherMessageParameters2 = mEmailOtherMessageParameters2; 478 prefs->mEmailOtherMessageParameters2 = mEmailOtherMessageParameters2;
478 479
479 prefs->mPhoneClient = mPhoneClient; 480 prefs->mPhoneClient = mPhoneClient;
480 prefs->mPhoneOtherChannel = mPhoneOtherChannel; 481 prefs->mPhoneOtherChannel = mPhoneOtherChannel;
481 prefs->mPhoneOtherMessage = mPhoneOtherMessage; 482 prefs->mPhoneOtherMessage = mPhoneOtherMessage;
482 prefs->mPhoneOtherMessageParameters = mPhoneOtherMessageParameters; 483 prefs->mPhoneOtherMessageParameters = mPhoneOtherMessageParameters;
483 484
484 prefs->mFaxClient = mFaxClient; 485 prefs->mFaxClient = mFaxClient;
485 prefs->mFaxOtherChannel = mFaxOtherChannel; 486 prefs->mFaxOtherChannel = mFaxOtherChannel;
486 prefs->mFaxOtherMessage = mFaxOtherMessage; 487 prefs->mFaxOtherMessage = mFaxOtherMessage;
487 prefs->mFaxOtherMessageParameters = mFaxOtherMessageParameters; 488 prefs->mFaxOtherMessageParameters = mFaxOtherMessageParameters;
488 489
489 prefs->mSMSClient = mSMSClient; 490 prefs->mSMSClient = mSMSClient;
490 prefs->mSMSOtherChannel = mSMSOtherChannel; 491 prefs->mSMSOtherChannel = mSMSOtherChannel;
491 prefs->mSMSOtherMessage = mSMSOtherMessage; 492 prefs->mSMSOtherMessage = mSMSOtherMessage;
492 prefs->mSMSOtherMessageParameters = mSMSOtherMessageParameters; 493 prefs->mSMSOtherMessageParameters = mSMSOtherMessageParameters;
493 494
494 prefs->mPagerClient = mPagerClient; 495 prefs->mPagerClient = mPagerClient;
495 prefs->mPagerOtherChannel = mPagerOtherChannel; 496 prefs->mPagerOtherChannel = mPagerOtherChannel;
496 prefs->mPagerOtherMessage = mPagerOtherMessage; 497 prefs->mPagerOtherMessage = mPagerOtherMessage;
497 prefs->mPagerOtherMessageParameters = mPagerOtherMessageParameters; 498 prefs->mPagerOtherMessageParameters = mPagerOtherMessageParameters;
498 499
499 prefs->writeConfig(); 500 prefs->writeConfig();
500 501
502 //release the cache that other views can access the changed values instantanious
503 ExternalAppHandler::instance()->loadConfig();
504
501 emit changed( false ); 505 emit changed( false );
502} 506}
503 507
504void KDEPIMConfigWidget::defaults(KPimGlobalPrefs* prefs) 508void KDEPIMConfigWidget::defaults(KPimGlobalPrefs* prefs)
505{ 509{
506 510
507 DefaultAppItem* dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::NONE_EMC); 511 DefaultAppItem* dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::NONE_EMC);
508 512
509 mEmailClient = dai->_id; 513 mEmailClient = dai->_id;
510 mEmailOtherChannel = dai->_channel; 514 mEmailOtherChannel = dai->_channel;
511 mEmailOtherMessage = dai->_message; 515 mEmailOtherMessage = dai->_message;
512 mEmailOtherMessageParameters = dai->_parameters; 516 mEmailOtherMessageParameters = dai->_parameters;
513 mEmailOtherMessage2 = dai->_message2; 517 mEmailOtherMessage2 = dai->_message2;
514 mEmailOtherMessageParameters2 = dai->_parameters2; 518 mEmailOtherMessageParameters2 = dai->_parameters2;
515 519
516 520
517 dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::NONE_PHC); 521 dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::NONE_PHC);
518 522
519 mPhoneClient = dai->_id; 523 mPhoneClient = dai->_id;
520 mPhoneOtherChannel = dai->_channel; 524 mPhoneOtherChannel = dai->_channel;
521 mPhoneOtherMessage = dai->_message; 525 mPhoneOtherMessage = dai->_message;
522 mPhoneOtherMessageParameters = dai->_parameters; 526 mPhoneOtherMessageParameters = dai->_parameters;
523 527
524 dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::FAX, KPimGlobalPrefs::NONE_FAC); 528 dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::FAX, KPimGlobalPrefs::NONE_FAC);
525 529
526 mFaxClient = dai->_id; 530 mFaxClient = dai->_id;
527 mFaxOtherChannel = dai->_channel; 531 mFaxOtherChannel = dai->_channel;
528 mFaxOtherMessage = dai->_message; 532 mFaxOtherMessage = dai->_message;
529 mFaxOtherMessageParameters = dai->_parameters; 533 mFaxOtherMessageParameters = dai->_parameters;
530 534
531 dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::SMS, KPimGlobalPrefs::NONE_SMC); 535 dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::SMS, KPimGlobalPrefs::NONE_SMC);
532 536
533 mSMSClient = dai->_id; 537 mSMSClient = dai->_id;
534 mSMSOtherChannel = dai->_channel; 538 mSMSOtherChannel = dai->_channel;
535 mSMSOtherMessage = dai->_message; 539 mSMSOtherMessage = dai->_message;
536 mSMSOtherMessageParameters = dai->_parameters; 540 mSMSOtherMessageParameters = dai->_parameters;
537 541
538 dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::PAGER, KPimGlobalPrefs::NONE_PAC); 542 dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::PAGER, KPimGlobalPrefs::NONE_PAC);
539 543
540 mPagerClient = dai->_id; 544 mPagerClient = dai->_id;
541 mPagerOtherChannel = dai->_channel; 545 mPagerOtherChannel = dai->_channel;
542 mPagerOtherMessage = dai->_message; 546 mPagerOtherMessage = dai->_message;
543 mPagerOtherMessageParameters = dai->_parameters; 547 mPagerOtherMessageParameters = dai->_parameters;
544 548
545 549
546 emit changed( true ); 550 emit changed( true );
547} 551}
548 552