Branch 'libkolabxml-1.0' - schemas/ical src/containers src/xcalconversions.h tests/bindingstest.cpp
Christian Mollekopf
mollekopf at kolabsys.com
Wed Jul 30 13:14:06 CEST 2014
schemas/ical/kolabformat-xcal.xsd | 3 +++
src/containers/incidence_p.h | 1 +
src/containers/kolabevent.cpp | 10 ++++++++++
src/containers/kolabevent.h | 3 +++
src/containers/kolabjournal.cpp | 9 +++++++++
src/containers/kolabjournal.h | 3 +++
src/containers/kolabtodo.cpp | 10 ++++++++++
src/containers/kolabtodo.h | 3 +++
src/xcalconversions.h | 8 ++++++++
tests/bindingstest.cpp | 2 ++
10 files changed, 52 insertions(+)
New commits:
commit ca156b7c91a2ab4591777124eb413f76690daf6d
Author: Christian Mollekopf <chrigi_1 at fastmail.fm>
Date: Wed Jul 30 13:08:24 2014 +0200
Support for the comment property.
diff --git a/schemas/ical/kolabformat-xcal.xsd b/schemas/ical/kolabformat-xcal.xsd
index e3de445..0fe7310 100644
--- a/schemas/ical/kolabformat-xcal.xsd
+++ b/schemas/ical/kolabformat-xcal.xsd
@@ -107,6 +107,7 @@
<xs:element name="recurrence-id" type="RecurrenceIdPropType" minOccurs="0"/>
<xs:element name="summary" type="SummaryPropType" minOccurs="0"/>
<xs:element name="description" type="DescriptionPropType" minOccurs="0"/>
+ <xs:element name="comment" type="CommentPropType" minOccurs="0"/>
<xs:element name="priority" type="PriorityPropType" minOccurs="0"/>
<xs:element name="status" type="StatusPropType" minOccurs="0"/>
<xs:element name="location" type="LocationPropType" minOccurs="0"/>
@@ -148,6 +149,7 @@
<xs:element name="recurrence-id" type="RecurrenceIdPropType" minOccurs="0"/>
<xs:element name="summary" type="SummaryPropType" minOccurs="0"/>
<xs:element name="description" type="DescriptionPropType" minOccurs="0"/>
+ <xs:element name="comment" type="CommentPropType" minOccurs="0"/>
<xs:element name="priority" type="PriorityPropType" minOccurs="0"/>
<xs:element name="status" type="StatusPropType" minOccurs="0"/>
<xs:element name="percent-complete" type="PercentCompletePropType" minOccurs="0"/>
@@ -185,6 +187,7 @@
<xs:element name="dtstart" type="DtstartPropType" minOccurs="0"/>
<xs:element name="summary" type="SummaryPropType" minOccurs="0"/>
<xs:element name="description" type="DescriptionPropType" minOccurs="0"/>
+ <xs:element name="comment" type="CommentPropType" minOccurs="0"/>
<xs:element name="status" type="StatusPropType" minOccurs="0"/>
<xs:element name="contact" type="ContactPropType" minOccurs="0"/>
<xs:element name="attendee" type="AttendeePropType" minOccurs="0" maxOccurs="unbounded"/>
diff --git a/src/containers/incidence_p.h b/src/containers/incidence_p.h
index 854f849..9d1eecf 100644
--- a/src/containers/incidence_p.h
+++ b/src/containers/incidence_p.h
@@ -44,6 +44,7 @@ namespace Kolab {
bool thisAndFuture;
std::string summary;
std::string description;
+ std::string comment;
std::string location;
int priority;
Status status;
diff --git a/src/containers/kolabevent.cpp b/src/containers/kolabevent.cpp
index a1a97c5..1d38393 100644
--- a/src/containers/kolabevent.cpp
+++ b/src/containers/kolabevent.cpp
@@ -180,6 +180,16 @@ std::string Event::description() const
return d->description;
}
+void Event::setComment(const std::string &comment)
+{
+ d->comment = comment;
+}
+
+std::string Event::comment() const
+{
+ return d->comment;
+}
+
void Event::setPriority(int priority)
{
d->priority = priority;
diff --git a/src/containers/kolabevent.h b/src/containers/kolabevent.h
index a1df32e..d4179cd 100644
--- a/src/containers/kolabevent.h
+++ b/src/containers/kolabevent.h
@@ -85,6 +85,9 @@ public:
void setDescription(const std::string &);
std::string description() const;
+ void setComment(const std::string &);
+ std::string comment() const;
+
void setPriority(int);
int priority() const;
diff --git a/src/containers/kolabjournal.cpp b/src/containers/kolabjournal.cpp
index ce37fbc..0c07cf0 100644
--- a/src/containers/kolabjournal.cpp
+++ b/src/containers/kolabjournal.cpp
@@ -146,6 +146,15 @@ std::string Journal::description() const
return d->description;
}
+void Journal::setComment(const std::string &comment)
+{
+ d->comment = comment;
+}
+
+std::string Journal::comment() const
+{
+ return d->comment;
+}
void Journal::setStatus(Status status)
{
diff --git a/src/containers/kolabjournal.h b/src/containers/kolabjournal.h
index 9a904d3..b02353d 100644
--- a/src/containers/kolabjournal.h
+++ b/src/containers/kolabjournal.h
@@ -61,6 +61,9 @@ public:
void setDescription(const std::string &);
std::string description() const;
+ void setComment(const std::string &);
+ std::string comment() const;
+
void setStatus(Status);
Status status() const;
diff --git a/src/containers/kolabtodo.cpp b/src/containers/kolabtodo.cpp
index c80f2fe..ca78a20 100644
--- a/src/containers/kolabtodo.cpp
+++ b/src/containers/kolabtodo.cpp
@@ -195,6 +195,16 @@ std::string Todo::description() const
return d->description;
}
+void Todo::setComment(const std::string &comment)
+{
+ d->comment = comment;
+}
+
+std::string Todo::comment() const
+{
+ return d->comment;
+}
+
void Todo::setPriority(int priority)
{
d->priority = priority;
diff --git a/src/containers/kolabtodo.h b/src/containers/kolabtodo.h
index bad8cbf..76d0e18 100644
--- a/src/containers/kolabtodo.h
+++ b/src/containers/kolabtodo.h
@@ -84,6 +84,9 @@ public:
void setDescription(const std::string &);
std::string description() const;
+ void setComment(const std::string &);
+ std::string comment() const;
+
void setPriority(int);
int priority() const;
diff --git a/src/xcalconversions.h b/src/xcalconversions.h
index 3fd982d..18043c0 100644
--- a/src/xcalconversions.h
+++ b/src/xcalconversions.h
@@ -843,6 +843,10 @@ void setIncidenceProperties(I &inc, const T &prop)
inc.setDescription(toString(*prop.description()));
}
+ if (prop.comment()) {
+ inc.setComment(toString(*prop.comment()));
+ }
+
if (prop.status()) {
const std::string &status = toString(*prop.status());
if (status == NEEDSACTION) {
@@ -1119,6 +1123,10 @@ void getIncidenceProperties(T &prop, const I &inc)
prop.description(typename properties::description_type(inc.description()));
}
+ if (!inc.comment().empty()) {
+ prop.comment(typename properties::comment_type(inc.comment()));
+ }
+
if (inc.status() != StatusUndefined) {
switch (inc.status()) {
case StatusNeedsAction:
diff --git a/tests/bindingstest.cpp b/tests/bindingstest.cpp
index b742ac5..2aad2b9 100644
--- a/tests/bindingstest.cpp
+++ b/tests/bindingstest.cpp
@@ -212,6 +212,7 @@ void setIncidence(T &ev)
ev.setRecurrenceID(Kolab::cDateTime("Europe/Zurich", 2006,1,6,12,0,0), true);
ev.setSummary("summary");
ev.setDescription("description");
+ ev.setComment("comment");
ev.setPriority(3);
ev.setStatus(Kolab::StatusConfirmed);
ev.setLocation("location");
@@ -324,6 +325,7 @@ void checkIncidence(const T &ev, const T &re)
QCOMPARE(ev.thisAndFuture(), re.thisAndFuture());
QCOMPARE(ev.summary(), re.summary());
QCOMPARE(ev.description(), re.description());
+ QCOMPARE(ev.comment(), re.comment());
QCOMPARE(ev.priority(), re.priority());
QCOMPARE(ev.status(), re.status());
QCOMPARE(ev.location(), re.location());
More information about the commits
mailing list