-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 @@ -42,2 +42,6 @@ Incidence::Incidence() : mHasRecurrenceID = false; + mHoliday = false; + mBirthday = false; + mAnniversary = false; + } @@ -77,2 +81,5 @@ Incidence::Incidence( const Incidence &i ) : IncidenceBase( i ) mRecurrence = new Recurrence( *(i.mRecurrence), this ); + mHoliday = i.mHoliday ; + mBirthday = i.mBirthday; + mAnniversary = i.mAnniversary; } @@ -91,2 +98,18 @@ Incidence::~Incidence() } + +bool Incidence::isHoliday() const +{ + return mHoliday; +} +bool Incidence::isBirthday() const +{ + + return mBirthday ; +} +bool Incidence::isAnniversary() const +{ + return mAnniversary ; + +} + bool Incidence::hasRecurrenceID() const @@ -304,2 +327,8 @@ QString Incidence::summary() const } +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")); +} @@ -309,2 +338,3 @@ void Incidence::setCategories(const QStringList &categories) mCategories = categories; + checkCategories(); updated(); @@ -326,3 +356,3 @@ void Incidence::setCategories(const QString &catStr) } - + checkCategories(); updated(); |