-rw-r--r-- | korganizer/koprefs.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index e679bd3..65f0342 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp | |||
@@ -308,287 +308,288 @@ KOPrefs::KOPrefs() : | |||
308 | 308 | ||
309 | addItemStringList( "EventTemplates", &mEventTemplates ); | 309 | addItemStringList( "EventTemplates", &mEventTemplates ); |
310 | addItemStringList( "TodoTemplates", &mTodoTemplates ); | 310 | addItemStringList( "TodoTemplates", &mTodoTemplates ); |
311 | 311 | ||
312 | addItemInt("DestinationPolicy",&mDestination,standardDestination); | 312 | addItemInt("DestinationPolicy",&mDestination,standardDestination); |
313 | 313 | ||
314 | KPrefs::setCurrentGroup( "ViewOptions" ); | 314 | KPrefs::setCurrentGroup( "ViewOptions" ); |
315 | addItemBool("EVshowDetails",&mEVshowDetails,true); | 315 | addItemBool("EVshowDetails",&mEVshowDetails,true); |
316 | addItemBool("EVshowCreated",&mEVshowCreated,true); | 316 | addItemBool("EVshowCreated",&mEVshowCreated,true); |
317 | addItemBool("EVshowChanged",&mEVshowChanged,true); | 317 | addItemBool("EVshowChanged",&mEVshowChanged,true); |
318 | addItemBool("WTshowDetails",&mWTshowDetails,false); | 318 | addItemBool("WTshowDetails",&mWTshowDetails,false); |
319 | addItemBool("WTshowCreated",&mWTshowCreated,false); | 319 | addItemBool("WTshowCreated",&mWTshowCreated,false); |
320 | addItemBool("WTshowChanged",&mWTshowChanged,false); | 320 | addItemBool("WTshowChanged",&mWTshowChanged,false); |
321 | mCalendars.setAutoDelete( true ); | 321 | mCalendars.setAutoDelete( true ); |
322 | } | 322 | } |
323 | 323 | ||
324 | 324 | ||
325 | KOPrefs::~KOPrefs() | 325 | KOPrefs::~KOPrefs() |
326 | { | 326 | { |
327 | if (mInstance == this) | 327 | if (mInstance == this) |
328 | mInstance = insd.setObject(0); | 328 | mInstance = insd.setObject(0); |
329 | mCalendars.setAutoDelete( true ); | 329 | mCalendars.setAutoDelete( true ); |
330 | mCalendars.clear(); | 330 | mCalendars.clear(); |
331 | //qDebug("KOPrefs::~KOPrefs() "); | 331 | //qDebug("KOPrefs::~KOPrefs() "); |
332 | } | 332 | } |
333 | 333 | ||
334 | 334 | ||
335 | KOPrefs *KOPrefs::instance() | 335 | KOPrefs *KOPrefs::instance() |
336 | { | 336 | { |
337 | if (!mInstance) { | 337 | if (!mInstance) { |
338 | mInstance = insd.setObject(new KOPrefs()); | 338 | mInstance = insd.setObject(new KOPrefs()); |
339 | mInstance->readConfig(); | 339 | mInstance->readConfig(); |
340 | } | 340 | } |
341 | 341 | ||
342 | return mInstance; | 342 | return mInstance; |
343 | } | 343 | } |
344 | 344 | ||
345 | void KOPrefs::usrSetDefaults() | 345 | void KOPrefs::usrSetDefaults() |
346 | { | 346 | { |
347 | 347 | ||
348 | } | 348 | } |
349 | 349 | ||
350 | void KOPrefs::fillMailDefaults() | 350 | void KOPrefs::fillMailDefaults() |
351 | { | 351 | { |
352 | if (mName.isEmpty()) mName = i18n("Anonymous"); | 352 | if (mName.isEmpty()) mName = i18n("Anonymous"); |
353 | if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); | 353 | if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); |
354 | } | 354 | } |
355 | 355 | ||
356 | void KOPrefs::setTimeZoneIdDefault() | 356 | void KOPrefs::setTimeZoneIdDefault() |
357 | { | 357 | { |
358 | ; | 358 | ; |
359 | } | 359 | } |
360 | 360 | ||
361 | void KOPrefs::setAllDefaults() | 361 | void KOPrefs::setAllDefaults() |
362 | { | 362 | { |
363 | setCategoryDefaults(); | 363 | setCategoryDefaults(); |
364 | mEventSummaryUser = getDefaultList() ; | 364 | mEventSummaryUser = getDefaultList() ; |
365 | mTodoSummaryUser = getDefaultList() ; | 365 | mTodoSummaryUser = getDefaultList() ; |
366 | mLocationDefaults = getLocationDefaultList(); | 366 | mLocationDefaults = getLocationDefaultList(); |
367 | } | 367 | } |
368 | 368 | ||
369 | void KOPrefs::setCategoryDefaults() | 369 | void KOPrefs::setCategoryDefaults() |
370 | { | 370 | { |
371 | mCustomCategories.clear(); | 371 | mCustomCategories.clear(); |
372 | mCustomCategories = getDefaultList(); | 372 | mCustomCategories = getDefaultList(); |
373 | 373 | ||
374 | QStringList::Iterator it; | 374 | QStringList::Iterator it; |
375 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { | 375 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { |
376 | setCategoryColor(*it,mDefaultCategoryColor); | 376 | setCategoryColor(*it,mDefaultCategoryColor); |
377 | } | 377 | } |
378 | } | 378 | } |
379 | QStringList KOPrefs::getLocationDefaultList() | 379 | QStringList KOPrefs::getLocationDefaultList() |
380 | { | 380 | { |
381 | QStringList retval ; | 381 | QStringList retval ; |
382 | retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") | 382 | retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") |
383 | << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") | 383 | << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") |
384 | << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") | 384 | << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") |
385 | << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; | 385 | << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; |
386 | // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") | 386 | // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") |
387 | 387 | ||
388 | retval.sort(); | 388 | retval.sort(); |
389 | return retval; | 389 | return retval; |
390 | } | 390 | } |
391 | QStringList KOPrefs::getDefaultList() | 391 | QStringList KOPrefs::getDefaultList() |
392 | { | 392 | { |
393 | QStringList retval ; | 393 | QStringList retval ; |
394 | retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer") | 394 | retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer") |
395 | << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner") | 395 | << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner") |
396 | << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts") | 396 | << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts") |
397 | << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids") | 397 | << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids") |
398 | << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel") | 398 | << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel") |
399 | << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping") | 399 | << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping") |
400 | << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University") | 400 | << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University") |
401 | << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ; | 401 | << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ; |
402 | retval.sort(); | 402 | retval.sort(); |
403 | //qDebug("cat %s ", retval.join("-").latin1()); | 403 | //qDebug("cat %s ", retval.join("-").latin1()); |
404 | return retval; | 404 | return retval; |
405 | } | 405 | } |
406 | 406 | ||
407 | void KOPrefs::usrReadConfig() | 407 | void KOPrefs::usrReadConfig() |
408 | { | 408 | { |
409 | config()->setGroup("General"); | 409 | config()->setGroup("General"); |
410 | 410 | ||
411 | //qDebug("KOPrefs::usrReadConfig() "); | 411 | //qDebug("KOPrefs::usrReadConfig() "); |
412 | mCustomCategories = config()->readListEntry("Custom Categories"); | 412 | mCustomCategories = config()->readListEntry("Custom Categories"); |
413 | mOldLoadedLanguage = mOldLanguage ; | 413 | mOldLoadedLanguage = mOldLanguage ; |
414 | mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; | 414 | mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; |
415 | if (mLocationDefaults.isEmpty()) { | 415 | if (mLocationDefaults.isEmpty()) { |
416 | mLocationDefaults = getLocationDefaultList(); | 416 | mLocationDefaults = getLocationDefaultList(); |
417 | } | 417 | } |
418 | 418 | ||
419 | if (mEventSummaryUser.isEmpty()) { | 419 | if (mEventSummaryUser.isEmpty()) { |
420 | mEventSummaryUser = getDefaultList() ; | 420 | mEventSummaryUser = getDefaultList() ; |
421 | } | 421 | } |
422 | if (mTodoSummaryUser.isEmpty()) { | 422 | if (mTodoSummaryUser.isEmpty()) { |
423 | mTodoSummaryUser = getDefaultList() ; | 423 | mTodoSummaryUser = getDefaultList() ; |
424 | } | 424 | } |
425 | 425 | ||
426 | if (mCustomCategories.isEmpty()) setCategoryDefaults(); | 426 | if (mCustomCategories.isEmpty()) setCategoryDefaults(); |
427 | 427 | ||
428 | config()->setGroup("Personal Settings"); | 428 | config()->setGroup("Personal Settings"); |
429 | mName = config()->readEntry("user_name",""); | 429 | mName = config()->readEntry("user_name",""); |
430 | mEmail = config()->readEntry("user_email",""); | 430 | mEmail = config()->readEntry("user_email",""); |
431 | fillMailDefaults(); | 431 | fillMailDefaults(); |
432 | 432 | ||
433 | config()->setGroup("Category Colors"); | 433 | config()->setGroup("Category Colors"); |
434 | QStringList::Iterator it; | 434 | QStringList::Iterator it; |
435 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { | 435 | for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { |
436 | setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); | 436 | setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); |
437 | 437 | ||
438 | } | 438 | } |
439 | KConfig fc (locateLocal("config","kopicalendarrc")); | 439 | KConfig fc (locateLocal("config","kopicalendarrc")); |
440 | fc.setGroup("CC"); | 440 | fc.setGroup("CC"); |
441 | int numCals = fc.readNumEntry("NumberCalendars",0 ); | 441 | int numCals = fc.readNumEntry("NumberCalendars",0 ); |
442 | mNextAvailableCalendar = 1; | 442 | mNextAvailableCalendar = 1; |
443 | if ( numCals == 0 ) { | 443 | if ( numCals == 0 ) { |
444 | KopiCalendarFile *kkf = getNewCalendar(); | 444 | KopiCalendarFile *kkf = getNewCalendar(); |
445 | kkf->isStandard = true; | 445 | kkf->isStandard = true; |
446 | kkf->mName = i18n("Standard"); | 446 | kkf->mName = i18n("Standard"); |
447 | kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); | 447 | kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); |
448 | } | 448 | } |
449 | while ( mNextAvailableCalendar <= numCals ) { | 449 | while ( mNextAvailableCalendar <= numCals ) { |
450 | //qDebug("Read cal #%d ", mNextAvailableCalendar ); | 450 | //qDebug("Read cal #%d ", mNextAvailableCalendar ); |
451 | QString prefix = "Cal_" +QString::number( mNextAvailableCalendar ); | 451 | QString prefix = "Cal_" +QString::number( mNextAvailableCalendar ); |
452 | KopiCalendarFile *kkf = getNewCalendar(); | 452 | KopiCalendarFile *kkf = getNewCalendar(); |
453 | kkf->isStandard = fc.readBoolEntry( prefix+"_isStandard", false ); | 453 | kkf->isStandard = fc.readBoolEntry( prefix+"_isStandard", false ); |
454 | kkf->isEnabled = fc.readBoolEntry( prefix+"_isEnabled", true); | 454 | kkf->isEnabled = fc.readBoolEntry( prefix+"_isEnabled", true); |
455 | kkf->isAlarmEnabled = fc.readBoolEntry( prefix+"_isAlarmEnabled", true); | 455 | kkf->isAlarmEnabled = fc.readBoolEntry( prefix+"_isAlarmEnabled", true); |
456 | kkf->isReadOnly = fc.readBoolEntry( prefix+"_isReadOnly", false); | 456 | kkf->isReadOnly = fc.readBoolEntry( prefix+"_isReadOnly", false); |
457 | kkf->mName = fc.readEntry( prefix+"_Name", "Calendar"); | 457 | kkf->mName = fc.readEntry( prefix+"_Name", "Calendar"); |
458 | kkf->mFileName = fc.readEntry( prefix+"_FileName", kkf->mFileName); | 458 | kkf->mFileName = fc.readEntry( prefix+"_FileName", kkf->mFileName); |
459 | kkf->mDefaultColor = fc.readColorEntry( prefix+"_Color",&mEventColor); | 459 | kkf->mDefaultColor = fc.readColorEntry( prefix+"_Color",&mEventColor); |
460 | if ( kkf->mCalNumber == 1 ) { | 460 | if ( kkf->mCalNumber == 1 ) { |
461 | kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); | 461 | kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); |
462 | } | 462 | } |
463 | } | 463 | } |
464 | 464 | ||
465 | KPimPrefs::usrReadConfig(); | 465 | KPimPrefs::usrReadConfig(); |
466 | } | 466 | } |
467 | 467 | ||
468 | KopiCalendarFile * KOPrefs::getCalendar( int num ) | 468 | KopiCalendarFile * KOPrefs::getCalendar( int num ) |
469 | { | 469 | { |
470 | return mDefCalColors[num-1]; | 470 | return mDefCalColors[num-1]; |
471 | } | 471 | } |
472 | 472 | ||
473 | KopiCalendarFile * KOPrefs::getNewCalendar() | 473 | KopiCalendarFile * KOPrefs::getNewCalendar() |
474 | { | 474 | { |
475 | KopiCalendarFile * kkf = new KopiCalendarFile(); | 475 | KopiCalendarFile * kkf = new KopiCalendarFile(); |
476 | kkf->mCalNumber = mNextAvailableCalendar; | 476 | kkf->mCalNumber = mNextAvailableCalendar; |
477 | mDefCalColors.resize( mNextAvailableCalendar ); | 477 | mDefCalColors.resize( mNextAvailableCalendar ); |
478 | mDefCalColors[mNextAvailableCalendar-1] = kkf; | 478 | mDefCalColors[mNextAvailableCalendar-1] = kkf; |
479 | ++mNextAvailableCalendar; | 479 | ++mNextAvailableCalendar; |
480 | kkf->mDefaultColor = mEventColor; | 480 | kkf->mDefaultColor = mEventColor; |
481 | kkf->mName = i18n("New Calendar"); | 481 | kkf->mName = i18n("New Calendar"); |
482 | mCalendars.append( kkf ); | 482 | mCalendars.append( kkf ); |
483 | return kkf; | 483 | return kkf; |
484 | } | 484 | } |
485 | void KOPrefs::deleteCalendar( int num ) | 485 | void KOPrefs::deleteCalendar( int num ) |
486 | { | 486 | { |
487 | KopiCalendarFile * kkf = mCalendars.first(); | 487 | KopiCalendarFile * kkf = mCalendars.first(); |
488 | while ( kkf ) { | 488 | while ( kkf ) { |
489 | if ( kkf->mCalNumber == num ) { | 489 | if ( kkf->mCalNumber == num ) { |
490 | qDebug("KOPrefs::deleteCalendar %d ", num ); | 490 | qDebug("KOPrefs::deleteCalendar %d ", num ); |
491 | mCalendars.remove( kkf ); | 491 | mCalendars.remove( kkf ); |
492 | delete kkf; | 492 | delete kkf; |
493 | return; | 493 | return; |
494 | } | 494 | } |
495 | kkf = mCalendars.next(); | 495 | kkf = mCalendars.next(); |
496 | } | 496 | } |
497 | } | 497 | } |
498 | QColor KOPrefs::defaultColor( int calNum ) const | 498 | QColor KOPrefs::defaultColor( int calNum ) const |
499 | { | 499 | { |
500 | if ( calNum == 1 ) return mEventColor; | ||
500 | return (mDefCalColors[calNum-1])->mDefaultColor; | 501 | return (mDefCalColors[calNum-1])->mDefaultColor; |
501 | } | 502 | } |
502 | void KOPrefs::usrWriteConfig() | 503 | void KOPrefs::usrWriteConfig() |
503 | { | 504 | { |
504 | config()->setGroup("General"); | 505 | config()->setGroup("General"); |
505 | config()->writeEntry("Custom Categories",mCustomCategories); | 506 | config()->writeEntry("Custom Categories",mCustomCategories); |
506 | 507 | ||
507 | config()->setGroup("Personal Settings"); | 508 | config()->setGroup("Personal Settings"); |
508 | config()->writeEntry("user_name",mName); | 509 | config()->writeEntry("user_name",mName); |
509 | config()->writeEntry("user_email",mEmail); | 510 | config()->writeEntry("user_email",mEmail); |
510 | 511 | ||
511 | config()->setGroup("Category Colors"); | 512 | config()->setGroup("Category Colors"); |
512 | QDictIterator<QColor> it(mCategoryColors); | 513 | QDictIterator<QColor> it(mCategoryColors); |
513 | while (it.current()) { | 514 | while (it.current()) { |
514 | config()->writeEntry(it.currentKey(),*(it.current())); | 515 | config()->writeEntry(it.currentKey(),*(it.current())); |
515 | ++it; | 516 | ++it; |
516 | } | 517 | } |
517 | KConfig fc (locateLocal("config","kopicalendarrc")); | 518 | KConfig fc (locateLocal("config","kopicalendarrc")); |
518 | fc.setGroup("CC"); | 519 | fc.setGroup("CC"); |
519 | fc.writeEntry("NumberCalendars",mCalendars.count()); | 520 | fc.writeEntry("NumberCalendars",mCalendars.count()); |
520 | int numCal = 1; | 521 | int numCal = 1; |
521 | int writeCal = 0; | 522 | int writeCal = 0; |
522 | while ( numCal < mNextAvailableCalendar ) { | 523 | while ( numCal < mNextAvailableCalendar ) { |
523 | KopiCalendarFile * kkf = mCalendars.first(); | 524 | KopiCalendarFile * kkf = mCalendars.first(); |
524 | while ( kkf ) { | 525 | while ( kkf ) { |
525 | //qDebug("cal num %d %d ", kkf->mCalNumber, numCal); | 526 | //qDebug("cal num %d %d ", kkf->mCalNumber, numCal); |
526 | if ( kkf->mCalNumber == numCal ) { | 527 | if ( kkf->mCalNumber == numCal ) { |
527 | ++writeCal; | 528 | ++writeCal; |
528 | //qDebug("Write calendar %d %d ", numCal , writeCal); | 529 | //qDebug("Write calendar %d %d ", numCal , writeCal); |
529 | QString prefix = "Cal_" + QString::number( writeCal ); | 530 | QString prefix = "Cal_" + QString::number( writeCal ); |
530 | fc.writeEntry( prefix+"_isStandard", kkf->isStandard ); | 531 | fc.writeEntry( prefix+"_isStandard", kkf->isStandard ); |
531 | fc.writeEntry( prefix+"_isEnabled", kkf->isEnabled ); | 532 | fc.writeEntry( prefix+"_isEnabled", kkf->isEnabled ); |
532 | fc.writeEntry( prefix+"_isAlarmEnabled", kkf->isAlarmEnabled ); | 533 | fc.writeEntry( prefix+"_isAlarmEnabled", kkf->isAlarmEnabled ); |
533 | fc.writeEntry( prefix+"_isReadOnly", kkf->isReadOnly ); | 534 | fc.writeEntry( prefix+"_isReadOnly", kkf->isReadOnly ); |
534 | fc.writeEntry( prefix+"_Name", kkf->mName); | 535 | fc.writeEntry( prefix+"_Name", kkf->mName); |
535 | fc.writeEntry( prefix+"_FileName", kkf->mFileName); | 536 | fc.writeEntry( prefix+"_FileName", kkf->mFileName); |
536 | fc.writeEntry( prefix+"_Color",kkf->mDefaultColor); | 537 | fc.writeEntry( prefix+"_Color",kkf->mDefaultColor); |
537 | } | 538 | } |
538 | kkf = mCalendars.next(); | 539 | kkf = mCalendars.next(); |
539 | } | 540 | } |
540 | ++numCal; | 541 | ++numCal; |
541 | } | 542 | } |
542 | fc.sync(); | 543 | fc.sync(); |
543 | KPimPrefs::usrWriteConfig(); | 544 | KPimPrefs::usrWriteConfig(); |
544 | } | 545 | } |
545 | 546 | ||
546 | void KOPrefs::setCategoryColor(QString cat,const QColor & color) | 547 | void KOPrefs::setCategoryColor(QString cat,const QColor & color) |
547 | { | 548 | { |
548 | mCategoryColors.replace(cat,new QColor(color)); | 549 | mCategoryColors.replace(cat,new QColor(color)); |
549 | } | 550 | } |
550 | 551 | ||
551 | QColor *KOPrefs::categoryColor(QString cat) | 552 | QColor *KOPrefs::categoryColor(QString cat) |
552 | { | 553 | { |
553 | QColor *color = 0; | 554 | QColor *color = 0; |
554 | 555 | ||
555 | if (!cat.isEmpty()) color = mCategoryColors[cat]; | 556 | if (!cat.isEmpty()) color = mCategoryColors[cat]; |
556 | 557 | ||
557 | if (color) return color; | 558 | if (color) return color; |
558 | else return &mDefaultCategoryColor; | 559 | else return &mDefaultCategoryColor; |
559 | } | 560 | } |
560 | 561 | ||
561 | void KOPrefs::setFullName(const QString &name) | 562 | void KOPrefs::setFullName(const QString &name) |
562 | { | 563 | { |
563 | mName = name; | 564 | mName = name; |
564 | } | 565 | } |
565 | 566 | ||
566 | void KOPrefs::setEmail(const QString &email) | 567 | void KOPrefs::setEmail(const QString &email) |
567 | { | 568 | { |
568 | //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() ); | 569 | //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() ); |
569 | mEmail = email; | 570 | mEmail = email; |
570 | } | 571 | } |
571 | 572 | ||
572 | QString KOPrefs::fullName() | 573 | QString KOPrefs::fullName() |
573 | { | 574 | { |
574 | if (mEmailControlCenter) { | 575 | if (mEmailControlCenter) { |
575 | KEMailSettings settings; | 576 | KEMailSettings settings; |
576 | return settings.getSetting(KEMailSettings::RealName); | 577 | return settings.getSetting(KEMailSettings::RealName); |
577 | } else { | 578 | } else { |
578 | return mName; | 579 | return mName; |
579 | } | 580 | } |
580 | } | 581 | } |
581 | 582 | ||
582 | QString KOPrefs::email() | 583 | QString KOPrefs::email() |
583 | { | 584 | { |
584 | if (mEmailControlCenter) { | 585 | if (mEmailControlCenter) { |
585 | KEMailSettings settings; | 586 | KEMailSettings settings; |
586 | return settings.getSetting(KEMailSettings::EmailAddress); | 587 | return settings.getSetting(KEMailSettings::EmailAddress); |
587 | } else { | 588 | } else { |
588 | return mEmail; | 589 | return mEmail; |
589 | } | 590 | } |
590 | } | 591 | } |
591 | KConfig* KOPrefs::getConfig() | 592 | KConfig* KOPrefs::getConfig() |
592 | { | 593 | { |
593 | return config(); | 594 | return config(); |
594 | } | 595 | } |