author | zautrix <zautrix> | 2006-02-27 22:49:08 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2006-02-27 22:49:08 (UTC) |
commit | a388f4f019ccf2b7c138a6814b44b9e8f2a5f570 (patch) (side-by-side diff) | |
tree | 5fe3d6341dee12d97200cf3ce1abe2feedb56782 /korganizer | |
parent | 4e2553b95b2787ed7917073f6b628819b1f017c3 (diff) | |
download | kdepimpi-a388f4f019ccf2b7c138a6814b44b9e8f2a5f570.zip kdepimpi-a388f4f019ccf2b7c138a6814b44b9e8f2a5f570.tar.gz kdepimpi-a388f4f019ccf2b7c138a6814b44b9e8f2a5f570.tar.bz2 |
trying to readonly problem
-rw-r--r-- | korganizer/koprefs.cpp | 1 | ||||
-rw-r--r-- | korganizer/koprefs.h | 12 |
2 files changed, 7 insertions, 6 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 9147af3..5078c57 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp @@ -431,64 +431,65 @@ void KOPrefs::usrReadConfig() mLocationDefaults = getLocationDefaultList(); } if (mEventSummaryUser.isEmpty()) { mEventSummaryUser = getDefaultList() ; } if (mTodoSummaryUser.isEmpty()) { 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)); } 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 = QDir::convertSeparators( locateLocal( "data", "korganizer/mycalendar.ics" ) ); + kkf->isReadOnly = false; } while ( mNextAvailableCalendar <= numCals ) { //qDebug("Read cal #%d ", mNextAvailableCalendar ); QString prefix = "Cal_" +QString::number( mNextAvailableCalendar ); KopiCalendarFile *kkf = getNewCalendar(); kkf->isStandard = fc.readBoolEntry( prefix+"_isStandard", false ); kkf->isEnabled = fc.readBoolEntry( prefix+"_isEnabled", true); kkf->isRelative = fc.readBoolEntry( prefix+"_isRelative", false ); kkf->isAlarmEnabled = fc.readBoolEntry( prefix+"_isAlarmEnabled", true); kkf->isReadOnly = fc.readBoolEntry( prefix+"_isReadOnly", false); kkf->mName = fc.readEntry( prefix+"_Name", "Calendar"); kkf->mFileName = QDir::convertSeparators( fc.readEntry( prefix+"_FileName", kkf->mFileName) ); kkf->mSavedFileName = QDir::convertSeparators( fc.readEntry( prefix+"_SavedFileName", kkf->mFileName) ); kkf->mDefaultColor = fc.readColorEntry( prefix+"_Color",&mEventColor); if ( kkf->mCalNumber == 1 ) { kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); } //qDebug("NAME %s %s", kkf->mName.latin1(), i18n("Birthdays").latin1() ); if ( kkf->mName == i18n("Birthdays") ) { kkf->mFileName = locateLocal( "data", "korganizer/birthdays.ics" ); } if ( kkf->isRelative ) kkf->mFileName = QDir::convertSeparators( KGlobalSettings::calendarDir() + kkf->mSavedFileName ); } KPimPrefs::usrReadConfig(); } KopiCalendarFile * KOPrefs::getCalendar( int num ) { return mDefCalColors[num-1]; } diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h index 70da096..94bdd33 100644 --- a/korganizer/koprefs.h +++ b/korganizer/koprefs.h @@ -23,82 +23,82 @@ #ifndef KOPREFS_H #define KOPREFS_H #include <libkdepim/kpimprefs.h> #include <qdict.h> #include <qdir.h> #include <qobject.h> class KConfig; class QFont; class QColor; class QStringList; #define VIEW_WN_VIEW 1 #define VIEW_NX_VIEW 2 #define VIEW_J_VIEW 3 #define VIEW_A_VIEW 4 #define VIEW_ML_VIEW 5 #define VIEW_M_VIEW 6 #define VIEW_L_VIEW 7 #define VIEW_T_VIEW 8 class KopiCalendarFile : public QObject { public: KopiCalendarFile( ) : QObject( ) { isStandard = false; isEnabled = true; isAlarmEnabled = true; isReadOnly = false; + mErrorOnLoad = false; + isRelative = false; + mCalNumber = 0; + mDefaultColor = Qt::red; mName = "Calendar"; mFileName = QDir::homeDirPath() + "/icalfile.ics"; mSavedFileName = "icalfile.ics"; - mCalNumber = 0; - mDefaultColor = Qt::red; - mErrorOnLoad = false; - isRelative = false; } bool isStandard; bool isEnabled; bool isAlarmEnabled; bool isReadOnly; bool mErrorOnLoad; + bool isRelative; + int mCalNumber; QString mName; QString mFileName; QString mSavedFileName; - bool isRelative; - int mCalNumber; QColor mDefaultColor; QDateTime mLoadDt; }; class KOPrefs : public KPimPrefs { public: enum { FormatVCalendar, FormatICalendar }; enum { MailClientKMail, MailClientSendmail }; enum { IMIPDummy, IMIPKMail }; enum { IMIPOutbox, IMIPdirectsend }; enum { neverAuto, addressbookAuto, selectedAuto }; enum { standardDestination, askDestination }; virtual ~KOPrefs(); /** Get instance of KOPrefs. It is made sure that there is only one instance. */ static KOPrefs *instance(); /** Set preferences to default values */ void usrSetDefaults(); /** Read preferences from config file */ void usrReadConfig(); /** Write preferences to config file */ void usrWriteConfig(); void setCategoryDefaults(); void setAllDefaults(); KopiCalendarFile * getNewCalendar(); KopiCalendarFile * getCalendar( int ); void deleteCalendar( int ); |