summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-06-13 22:52:33 (UTC)
committer zautrix <zautrix>2005-06-13 22:52:33 (UTC)
commit35d40d945aed8c9e7c3389182014a2d99edb5254 (patch) (side-by-side diff)
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
@@ -423,52 +423,53 @@ void KOPrefs::usrReadConfig()
mTodoSummaryUser = getDefaultList() ;
}
if (mCustomCategories.isEmpty()) setCategoryDefaults();
config()->setGroup("Personal Settings");
mName = config()->readEntry("user_name","");
mEmail = config()->readEntry("user_email","");
fillMailDefaults();
config()->setGroup("Category Colors");
QStringList::Iterator it;
for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
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();
kkf->isStandard = true;
kkf->mName = i18n("Standard");
kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" );
}
while ( mNextAvailableCalendar <= numCals ) {
//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" );
}
}
KPimPrefs::usrReadConfig();
}
KopiCalendarFile * KOPrefs::getCalendar( int num )
{
return mDefCalColors[num-1];
}
KopiCalendarFile * KOPrefs::getNewCalendar()
{
KopiCalendarFile * kkf = new KopiCalendarFile();
@@ -499,57 +500,59 @@ QColor KOPrefs::defaultColor( int calNum ) const
return (mDefCalColors[calNum-1])->mDefaultColor;
}
void KOPrefs::usrWriteConfig()
{
config()->setGroup("General");
config()->writeEntry("Custom Categories",mCustomCategories);
config()->setGroup("Personal Settings");
config()->writeEntry("user_name",mName);
config()->writeEntry("user_email",mEmail);
config()->setGroup("Category Colors");
QDictIterator<QColor> it(mCategoryColors);
while (it.current()) {
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 ) {
KopiCalendarFile * kkf = mCalendars.first();
while ( kkf ) {
//qDebug("cal num %d %d ", kkf->mCalNumber, numCal);
if ( kkf->mCalNumber == numCal ) {
++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();
}
void KOPrefs::setCategoryColor(QString cat,const QColor & color)
{
mCategoryColors.replace(cat,new QColor(color));
}
QColor *KOPrefs::categoryColor(QString cat)
{
QColor *color = 0;
if (!cat.isEmpty()) color = mCategoryColors[cat];
if (color) return color;
else return &mDefaultCategoryColor;