summaryrefslogtreecommitdiffabout
path: root/libkcal
Side-by-side diff
Diffstat (limited to 'libkcal') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/icalformatimpl.cpp10
-rw-r--r--libkcal/incidence.cpp35
-rw-r--r--libkcal/incidence.h9
3 files changed, 52 insertions, 2 deletions
diff --git a/libkcal/icalformatimpl.cpp b/libkcal/icalformatimpl.cpp
index bd13132..bb9cb29 100644
--- a/libkcal/icalformatimpl.cpp
+++ b/libkcal/icalformatimpl.cpp
@@ -402,3 +402,6 @@ void ICalFormatImpl::writeIncidence(icalcomponent *parent,Incidence *incidence)
}
-
+ if( incidence->hasRecurrenceID() ) {
+ icalcomponent_add_property(parent,
+ icalproperty_new_recurrenceid( writeICalDateTime( incidence->recurrenceID())));
+ }
// duration
@@ -1206,2 +1209,7 @@ void ICalFormatImpl::readIncidence(icalcomponent *parent,Incidence *incidence)
+ case ICAL_RECURRENCEID_PROPERTY:
+ icaltime = icalproperty_get_recurrenceid(p);
+ incidence->setRecurrenceID( readICalDateTime(icaltime) );
+ qDebug(" RecurrenceID %s",incidence->recurrenceID().toString().latin1() );
+ break;
#if 0
diff --git a/libkcal/incidence.cpp b/libkcal/incidence.cpp
index f9e1e9e..dbc159c 100644
--- a/libkcal/incidence.cpp
+++ b/libkcal/incidence.cpp
@@ -41,2 +41,3 @@ Incidence::Incidence() :
mAttachments.setAutoDelete(true);
+ mHasRecurrenceID = false;
}
@@ -73,3 +74,4 @@ Incidence::Incidence( const Incidence &i ) : IncidenceBase( i )
mAlarms.setAutoDelete(true);
-
+ mHasRecurrenceID = i.mHasRecurrenceID;
+ mRecurrenceID = i.mRecurrenceID;
mRecurrence = new Recurrence( *(i.mRecurrence), this );
@@ -89,2 +91,22 @@ Incidence::~Incidence()
}
+bool Incidence::hasRecurrenceID() const
+{
+ return mHasRecurrenceID;
+}
+
+void Incidence::setHasRecurrenceID( bool b )
+{
+ mHasRecurrenceID = b;
+}
+
+void Incidence::setRecurrenceID(QDateTime d)
+{
+ mRecurrenceID = d;
+ mHasRecurrenceID = true;
+ updated();
+}
+QDateTime Incidence::recurrenceID () const
+{
+ return mRecurrenceID;
+}
@@ -145,2 +167,12 @@ bool KCal::operator==( const Incidence& i1, const Incidence& i2 )
+ if ( i1.hasRecurrenceID() == i2.hasRecurrenceID() ) {
+ if ( i1.hasRecurrenceID() ) {
+ if ( i1.recurrenceID() != i2.recurrenceID() )
+ return false;
+ }
+
+ } else {
+ return false;
+ }
+
if ( ! operator==( (const IncidenceBase&)i1, (const IncidenceBase&)i2 ) )
@@ -172,2 +204,3 @@ bool KCal::operator==( const Incidence& i1, const Incidence& i2 )
i1.priority() == i2.priority() &&
+ i1.cancelled() == i2.cancelled() &&
stringCompare( i1.location(), i2.location() );
diff --git a/libkcal/incidence.h b/libkcal/incidence.h
index de2a381..38d2aaa 100644
--- a/libkcal/incidence.h
+++ b/libkcal/incidence.h
@@ -265,2 +265,9 @@ class Incidence : public IncidenceBase
void setCancelled( bool b );
+
+ bool hasRecurrenceID() const;
+ void setHasRecurrenceID( bool b );
+
+ void setRecurrenceID(QDateTime);
+ QDateTime recurrenceID () const;
+
@@ -274,2 +281,4 @@ protected:
// base components of jounal, event and todo
+ QDateTime mRecurrenceID;
+ bool mHasRecurrenceID;
QDateTime mCreated;