author | zautrix <zautrix> | 2005-03-21 17:39:46 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-21 17:39:46 (UTC) |
commit | 3c5d7b484e6ab263ab4091f22815770ea8da6c9c (patch) (side-by-side diff) | |
tree | 97f86965d7ae565fc054918978756c3953476e82 /libkcal/incidence.cpp | |
parent | 070055b60f76ffd6907e44a4ffc2d752578f3211 (diff) | |
download | kdepimpi-3c5d7b484e6ab263ab4091f22815770ea8da6c9c.zip kdepimpi-3c5d7b484e6ab263ab4091f22815770ea8da6c9c.tar.gz kdepimpi-3c5d7b484e6ab263ab4091f22815770ea8da6c9c.tar.bz2 |
fix
-rw-r--r-- | libkcal/incidence.cpp | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp index 708ee6b..9a36939 100644 --- a/libkcal/incidence.cpp +++ b/libkcal/incidence.cpp @@ -35,16 +35,20 @@ Incidence::Incidence() : { mRecurrence = new Recurrence(this); mCancelled = false; recreate(); mHasStartDate = true; mAlarms.setAutoDelete(true); mAttachments.setAutoDelete(true); mHasRecurrenceID = false; + mHoliday = false; + mBirthday = false; + mAnniversary = false; + } Incidence::Incidence( const Incidence &i ) : IncidenceBase( i ) { // TODO: reenable attributes currently commented out. mRevision = i.mRevision; mCreated = i.mCreated; mDescription = i.mDescription; @@ -70,30 +74,49 @@ Incidence::Incidence( const Incidence &i ) : IncidenceBase( i ) mAlarms.append( b ); ++it; } mAlarms.setAutoDelete(true); mHasRecurrenceID = i.mHasRecurrenceID; mRecurrenceID = i.mRecurrenceID; mRecurrence = new Recurrence( *(i.mRecurrence), this ); + mHoliday = i.mHoliday ; + mBirthday = i.mBirthday; + mAnniversary = i.mAnniversary; } Incidence::~Incidence() { Incidence *ev; QPtrList<Incidence> Relations = relations(); for (ev=Relations.first();ev;ev=Relations.next()) { if (ev->relatedTo() == this) ev->setRelatedTo(0); } if (relatedTo()) relatedTo()->removeRelation(this); delete mRecurrence; } + +bool Incidence::isHoliday() const +{ + return mHoliday; +} +bool Incidence::isBirthday() const +{ + + return mBirthday ; +} +bool Incidence::isAnniversary() const +{ + return mAnniversary ; + +} + bool Incidence::hasRecurrenceID() const { return mHasRecurrenceID; } void Incidence::setHasRecurrenceID( bool b ) { mHasRecurrenceID = b; @@ -297,21 +320,28 @@ void Incidence::setSummary(const QString &summary) mSummary = summary; updated(); } QString Incidence::summary() const { return mSummary; } +void Incidence::checkCategories() +{ + mHoliday = mCategories.contains("Holiday") || mCategories.contains(i18n("Holiday")); + mBirthday = mCategories.contains("Birthday") || mCategories.contains(i18n("Birthday")); + mAnniversary = mCategories.contains("Anniversary") || mCategories.contains(i18n("Anniversary")); +} void Incidence::setCategories(const QStringList &categories) { if (mReadOnly) return; mCategories = categories; + checkCategories(); updated(); } // TODO: remove setCategories(QString) function void Incidence::setCategories(const QString &catStr) { if (mReadOnly) return; mCategories.clear(); @@ -319,17 +349,17 @@ void Incidence::setCategories(const QString &catStr) if (catStr.isEmpty()) return; mCategories = QStringList::split(",",catStr); QStringList::Iterator it; for(it = mCategories.begin();it != mCategories.end(); ++it) { *it = (*it).stripWhiteSpace(); } - + checkCategories(); updated(); } QStringList Incidence::categories() const { return mCategories; } |