summaryrefslogtreecommitdiffabout
path: root/libkcal/incidence.cpp
Side-by-side diff
Diffstat (limited to 'libkcal/incidence.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/incidence.cpp32
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
@@ -40,6 +40,10 @@ Incidence::Incidence() :
mAlarms.setAutoDelete(true);
mAttachments.setAutoDelete(true);
mHasRecurrenceID = false;
+ mHoliday = false;
+ mBirthday = false;
+ mAnniversary = false;
+
}
Incidence::Incidence( const Incidence &i ) : IncidenceBase( i )
@@ -75,6 +79,9 @@ Incidence::Incidence( const Incidence &i ) : IncidenceBase( i )
mHasRecurrenceID = i.mHasRecurrenceID;
mRecurrenceID = i.mRecurrenceID;
mRecurrence = new Recurrence( *(i.mRecurrence), this );
+ mHoliday = i.mHoliday ;
+ mBirthday = i.mBirthday;
+ mAnniversary = i.mAnniversary;
}
Incidence::~Incidence()
@@ -89,6 +96,22 @@ Incidence::~Incidence()
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;
@@ -302,11 +325,18 @@ 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();
}
@@ -324,7 +354,7 @@ void Incidence::setCategories(const QString &catStr)
for(it = mCategories.begin();it != mCategories.end(); ++it) {
*it = (*it).stripWhiteSpace();
}
-
+ checkCategories();
updated();
}