summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koprefs.cpp39
1 files changed, 21 insertions, 18 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 9fe285c..e679bd3 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -436,8 +436,9 @@ void KOPrefs::usrReadConfig()
setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor));
}
- config()->setGroup("CCal");
- int numCals = config()->readNumEntry("NumberCalendars",0 );
+ KConfig fc (locateLocal("config","kopicalendarrc"));
+ fc.setGroup("CC");
+ int numCals = fc.readNumEntry("NumberCalendars",0 );
mNextAvailableCalendar = 1;
if ( numCals == 0 ) {
KopiCalendarFile *kkf = getNewCalendar();
@@ -449,13 +450,13 @@ void KOPrefs::usrReadConfig()
//qDebug("Read cal #%d ", mNextAvailableCalendar );
QString prefix = "Cal_" +QString::number( mNextAvailableCalendar );
KopiCalendarFile *kkf = getNewCalendar();
- kkf->isStandard = config()->readBoolEntry( prefix+"_isStandard", false );
- kkf->isEnabled = config()->readBoolEntry( prefix+"_isEnabled", true);
- kkf->isAlarmEnabled = config()->readBoolEntry( prefix+"_isAlarmEnabled", true);
- kkf->isReadOnly = config()->readBoolEntry( prefix+"_isReadOnly", false);
- kkf->mName = config()->readEntry( prefix+"_Name", "Calendar");
- kkf->mFileName = config()->readEntry( prefix+"_FileName", kkf->mFileName);
- kkf->mDefaultColor = config()->readColorEntry( prefix+"_Color",&mEventColor);
+ kkf->isStandard = fc.readBoolEntry( prefix+"_isStandard", false );
+ kkf->isEnabled = fc.readBoolEntry( prefix+"_isEnabled", true);
+ kkf->isAlarmEnabled = fc.readBoolEntry( prefix+"_isAlarmEnabled", true);
+ kkf->isReadOnly = fc.readBoolEntry( prefix+"_isReadOnly", false);
+ kkf->mName = fc.readEntry( prefix+"_Name", "Calendar");
+ kkf->mFileName = fc.readEntry( prefix+"_FileName", kkf->mFileName);
+ kkf->mDefaultColor = fc.readColorEntry( prefix+"_Color",&mEventColor);
if ( kkf->mCalNumber == 1 ) {
kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" );
}
@@ -513,8 +514,9 @@ void KOPrefs::usrWriteConfig()
config()->writeEntry(it.currentKey(),*(it.current()));
++it;
}
- config()->setGroup("CCal");
- config()->writeEntry("NumberCalendars",mCalendars.count());
+ KConfig fc (locateLocal("config","kopicalendarrc"));
+ fc.setGroup("CC");
+ fc.writeEntry("NumberCalendars",mCalendars.count());
int numCal = 1;
int writeCal = 0;
while ( numCal < mNextAvailableCalendar ) {
@@ -525,18 +527,19 @@ void KOPrefs::usrWriteConfig()
++writeCal;
//qDebug("Write calendar %d %d ", numCal , writeCal);
QString prefix = "Cal_" + QString::number( writeCal );
- config()->writeEntry( prefix+"_isStandard", kkf->isStandard );
- config()->writeEntry( prefix+"_isEnabled", kkf->isEnabled );
- config()->writeEntry( prefix+"_isAlarmEnabled", kkf->isAlarmEnabled );
- config()->writeEntry( prefix+"_isReadOnly", kkf->isReadOnly );
- config()->writeEntry( prefix+"_Name", kkf->mName);
- config()->writeEntry( prefix+"_FileName", kkf->mFileName);
- config()->writeEntry( prefix+"_Color",kkf->mDefaultColor);
+ fc.writeEntry( prefix+"_isStandard", kkf->isStandard );
+ fc.writeEntry( prefix+"_isEnabled", kkf->isEnabled );
+ fc.writeEntry( prefix+"_isAlarmEnabled", kkf->isAlarmEnabled );
+ fc.writeEntry( prefix+"_isReadOnly", kkf->isReadOnly );
+ fc.writeEntry( prefix+"_Name", kkf->mName);
+ fc.writeEntry( prefix+"_FileName", kkf->mFileName);
+ fc.writeEntry( prefix+"_Color",kkf->mDefaultColor);
}
kkf = mCalendars.next();
}
++numCal;
}
+ fc.sync();
KPimPrefs::usrWriteConfig();
}