summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-06-13 22:52:33 (UTC)
committer zautrix <zautrix>2005-06-13 22:52:33 (UTC)
commit35d40d945aed8c9e7c3389182014a2d99edb5254 (patch) (unidiff)
tree752ccb2080d518fb45866f8171aff8adba183319
parentfe1114cea0321405b362d642912f1f72257c7cbd (diff)
downloadkdepimpi-35d40d945aed8c9e7c3389182014a2d99edb5254.zip
kdepimpi-35d40d945aed8c9e7c3389182014a2d99edb5254.tar.gz
kdepimpi-35d40d945aed8c9e7c3389182014a2d99edb5254.tar.bz2
fixxx
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koprefs.cpp41
1 files changed, 22 insertions, 19 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 9fe285c..e679bd3 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -435,10 +435,11 @@ void KOPrefs::usrReadConfig()
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 config()->setGroup("CCal"); 439 KConfig fc (locateLocal("config","kopicalendarrc"));
440 int numCals = config()->readNumEntry("NumberCalendars",0 ); 440 fc.setGroup("CC");
441 int numCals = fc.readNumEntry("NumberCalendars",0 );
441 mNextAvailableCalendar = 1; 442 mNextAvailableCalendar = 1;
442 if ( numCals == 0 ) { 443 if ( numCals == 0 ) {
443 KopiCalendarFile *kkf = getNewCalendar(); 444 KopiCalendarFile *kkf = getNewCalendar();
444 kkf->isStandard = true; 445 kkf->isStandard = true;
@@ -448,15 +449,15 @@ void KOPrefs::usrReadConfig()
448 while ( mNextAvailableCalendar <= numCals ) { 449 while ( mNextAvailableCalendar <= numCals ) {
449 //qDebug("Read cal #%d ", mNextAvailableCalendar ); 450 //qDebug("Read cal #%d ", mNextAvailableCalendar );
450 QString prefix = "Cal_" +QString::number( mNextAvailableCalendar ); 451 QString prefix = "Cal_" +QString::number( mNextAvailableCalendar );
451 KopiCalendarFile *kkf = getNewCalendar(); 452 KopiCalendarFile *kkf = getNewCalendar();
452 kkf->isStandard = config()->readBoolEntry( prefix+"_isStandard", false ); 453 kkf->isStandard = fc.readBoolEntry( prefix+"_isStandard", false );
453 kkf->isEnabled = config()->readBoolEntry( prefix+"_isEnabled", true); 454 kkf->isEnabled = fc.readBoolEntry( prefix+"_isEnabled", true);
454 kkf->isAlarmEnabled = config()->readBoolEntry( prefix+"_isAlarmEnabled", true); 455 kkf->isAlarmEnabled = fc.readBoolEntry( prefix+"_isAlarmEnabled", true);
455 kkf->isReadOnly = config()->readBoolEntry( prefix+"_isReadOnly", false); 456 kkf->isReadOnly = fc.readBoolEntry( prefix+"_isReadOnly", false);
456 kkf->mName = config()->readEntry( prefix+"_Name", "Calendar"); 457 kkf->mName = fc.readEntry( prefix+"_Name", "Calendar");
457 kkf->mFileName = config()->readEntry( prefix+"_FileName", kkf->mFileName); 458 kkf->mFileName = fc.readEntry( prefix+"_FileName", kkf->mFileName);
458 kkf->mDefaultColor = config()->readColorEntry( prefix+"_Color",&mEventColor); 459 kkf->mDefaultColor = fc.readColorEntry( prefix+"_Color",&mEventColor);
459 if ( kkf->mCalNumber == 1 ) { 460 if ( kkf->mCalNumber == 1 ) {
460 kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); 461 kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" );
461 } 462 }
462 } 463 }
@@ -511,11 +512,12 @@ void KOPrefs::usrWriteConfig()
511 QDictIterator<QColor> it(mCategoryColors); 512 QDictIterator<QColor> it(mCategoryColors);
512 while (it.current()) { 513 while (it.current()) {
513 config()->writeEntry(it.currentKey(),*(it.current())); 514 config()->writeEntry(it.currentKey(),*(it.current()));
514 ++it; 515 ++it;
515 } 516 }
516 config()->setGroup("CCal"); 517 KConfig fc (locateLocal("config","kopicalendarrc"));
517 config()->writeEntry("NumberCalendars",mCalendars.count()); 518 fc.setGroup("CC");
519 fc.writeEntry("NumberCalendars",mCalendars.count());
518 int numCal = 1; 520 int numCal = 1;
519 int writeCal = 0; 521 int writeCal = 0;
520 while ( numCal < mNextAvailableCalendar ) { 522 while ( numCal < mNextAvailableCalendar ) {
521 KopiCalendarFile * kkf = mCalendars.first(); 523 KopiCalendarFile * kkf = mCalendars.first();
@@ -524,20 +526,21 @@ void KOPrefs::usrWriteConfig()
524 if ( kkf->mCalNumber == numCal ) { 526 if ( kkf->mCalNumber == numCal ) {
525 ++writeCal; 527 ++writeCal;
526 //qDebug("Write calendar %d %d ", numCal , writeCal); 528 //qDebug("Write calendar %d %d ", numCal , writeCal);
527 QString prefix = "Cal_" + QString::number( writeCal ); 529 QString prefix = "Cal_" + QString::number( writeCal );
528 config()->writeEntry( prefix+"_isStandard", kkf->isStandard ); 530 fc.writeEntry( prefix+"_isStandard", kkf->isStandard );
529 config()->writeEntry( prefix+"_isEnabled", kkf->isEnabled ); 531 fc.writeEntry( prefix+"_isEnabled", kkf->isEnabled );
530 config()->writeEntry( prefix+"_isAlarmEnabled", kkf->isAlarmEnabled ); 532 fc.writeEntry( prefix+"_isAlarmEnabled", kkf->isAlarmEnabled );
531 config()->writeEntry( prefix+"_isReadOnly", kkf->isReadOnly ); 533 fc.writeEntry( prefix+"_isReadOnly", kkf->isReadOnly );
532 config()->writeEntry( prefix+"_Name", kkf->mName); 534 fc.writeEntry( prefix+"_Name", kkf->mName);
533 config()->writeEntry( prefix+"_FileName", kkf->mFileName); 535 fc.writeEntry( prefix+"_FileName", kkf->mFileName);
534 config()->writeEntry( prefix+"_Color",kkf->mDefaultColor); 536 fc.writeEntry( prefix+"_Color",kkf->mDefaultColor);
535 } 537 }
536 kkf = mCalendars.next(); 538 kkf = mCalendars.next();
537 } 539 }
538 ++numCal; 540 ++numCal;
539 } 541 }
542 fc.sync();
540 KPimPrefs::usrWriteConfig(); 543 KPimPrefs::usrWriteConfig();
541} 544}
542 545
543void KOPrefs::setCategoryColor(QString cat,const QColor & color) 546void KOPrefs::setCategoryColor(QString cat,const QColor & color)