schemas/ical src/containers src/xcalconversions.h tests/bindingstest.cpp
Christian Mollekopf
mollekopf at kolabsys.com
Wed Apr 10 11:50:26 CEST 2013
schemas/ical/kolabformat-xcal.xsd | 2 ++
src/containers/incidence_p.h | 1 +
src/containers/kolabevent.cpp | 10 ++++++++++
src/containers/kolabevent.h | 3 +++
src/containers/kolabtodo.cpp | 10 ++++++++++
src/containers/kolabtodo.h | 3 +++
src/xcalconversions.h | 8 ++++++++
tests/bindingstest.cpp | 2 ++
8 files changed, 39 insertions(+)
New commits:
commit 41189cfb47c7e8866b4cb1c83c79f298c47c2b85
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date: Wed Apr 10 11:50:21 2013 +0200
url property for todos and events.
diff --git a/schemas/ical/kolabformat-xcal.xsd b/schemas/ical/kolabformat-xcal.xsd
index 6960df9..e3de445 100644
--- a/schemas/ical/kolabformat-xcal.xsd
+++ b/schemas/ical/kolabformat-xcal.xsd
@@ -111,6 +111,7 @@
<xs:element name="status" type="StatusPropType" minOccurs="0"/>
<xs:element name="location" type="LocationPropType" minOccurs="0"/>
<xs:element name="organizer" type="OrganizerPropType" minOccurs="0"/>
+ <xs:element name="url" type="UrlPropType" minOccurs="0"/>
<xs:element name="attendee" type="AttendeePropType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="attach" type="AttachPropType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="x-custom" type="CustomType" minOccurs="0" maxOccurs="unbounded"/>
@@ -152,6 +153,7 @@
<xs:element name="percent-complete" type="PercentCompletePropType" minOccurs="0"/>
<xs:element name="location" type="LocationPropType" minOccurs="0"/>
<xs:element name="organizer" type="OrganizerPropType" minOccurs="0"/>
+ <xs:element name="url" type="UrlPropType" minOccurs="0"/>
<xs:element name="attendee" type="AttendeePropType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="attach" type="AttachPropType" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="x-custom" type="CustomType" minOccurs="0" maxOccurs="unbounded"/>
diff --git a/src/containers/incidence_p.h b/src/containers/incidence_p.h
index 8602feb..854f849 100644
--- a/src/containers/incidence_p.h
+++ b/src/containers/incidence_p.h
@@ -58,6 +58,7 @@ namespace Kolab {
std::vector<CustomProperty> customProperties;
std::vector<Alarm> alarms;
+ std::string url;
};
}
diff --git a/src/containers/kolabevent.cpp b/src/containers/kolabevent.cpp
index 0fd4d2b..a1a97c5 100644
--- a/src/containers/kolabevent.cpp
+++ b/src/containers/kolabevent.cpp
@@ -290,6 +290,16 @@ std::vector< Attachment > Event::attachments() const
return d->attachments;
}
+void Event::setUrl(const std::string &url)
+{
+ d->url = url;
+}
+
+std::string Event::url() const
+{
+ return d->url;
+}
+
void Event::setCustomProperties(const std::vector< CustomProperty > &prop)
{
d->customProperties = prop;
diff --git a/src/containers/kolabevent.h b/src/containers/kolabevent.h
index 8973d1a..a1df32e 100644
--- a/src/containers/kolabevent.h
+++ b/src/containers/kolabevent.h
@@ -103,6 +103,9 @@ public:
void setAttachments(const std::vector<Attachment> &);
std::vector<Attachment> attachments() const;
+ void setUrl(const std::string &);
+ std::string url() const;
+
void setCustomProperties(const std::vector<CustomProperty> &);
std::vector<CustomProperty> customProperties() const;
diff --git a/src/containers/kolabtodo.cpp b/src/containers/kolabtodo.cpp
index 2286d25..c80f2fe 100644
--- a/src/containers/kolabtodo.cpp
+++ b/src/containers/kolabtodo.cpp
@@ -305,6 +305,16 @@ std::vector< Attachment > Todo::attachments() const
return d->attachments;
}
+void Todo::setUrl(const std::string &url)
+{
+ d->url = url;
+}
+
+std::string Todo::url() const
+{
+ return d->url;
+}
+
void Todo::setCustomProperties(const std::vector< CustomProperty > &prop)
{
d->customProperties = prop;
diff --git a/src/containers/kolabtodo.h b/src/containers/kolabtodo.h
index 1ab8024..bad8cbf 100644
--- a/src/containers/kolabtodo.h
+++ b/src/containers/kolabtodo.h
@@ -105,6 +105,9 @@ public:
void setAttachments(const std::vector<Attachment> &);
std::vector<Attachment> attachments() const;
+ void setUrl(const std::string &);
+ std::string url() const;
+
void setCustomProperties(const std::vector<CustomProperty> &);
std::vector<CustomProperty> customProperties() const;
diff --git a/src/xcalconversions.h b/src/xcalconversions.h
index d11536c..82c7699 100644
--- a/src/xcalconversions.h
+++ b/src/xcalconversions.h
@@ -1006,6 +1006,10 @@ void setTodoEventProperties(I &inc, const T &prop)
inc.setOrganizer(toContactReference(*prop.organizer()));
}
+ if (prop.url()) {
+ inc.setUrl((*prop.url()).uri());
+ }
+
}
@@ -1283,6 +1287,10 @@ void getTodoEventProperties(T &prop, const I &inc)
if (inc.organizer().isValid()) {
prop.organizer(fromContactReference<typename properties::organizer_type>(inc.organizer()));
}
+
+ if (!inc.url().empty()) {
+ prop.url(typename properties::url_type(inc.url()));
+ }
}
//=== Alarms ===
diff --git a/tests/bindingstest.cpp b/tests/bindingstest.cpp
index d979217..ed012d7 100644
--- a/tests/bindingstest.cpp
+++ b/tests/bindingstest.cpp
@@ -187,6 +187,7 @@ void setIncidence(T &ev)
ev.setStatus(Kolab::StatusConfirmed);
ev.setLocation("location");
ev.setOrganizer(Kolab::ContactReference("mail", "name", "uid"));
+ ev.setUrl("http://example.com");
Kolab::Attendee attendee(Kolab::ContactReference("mail", "name", "uid"));
attendee.setPartStat(Kolab::PartDelegated);
@@ -298,6 +299,7 @@ void checkIncidence(const T &ev, const T &re)
QCOMPARE(ev.status(), re.status());
QCOMPARE(ev.location(), re.location());
QCOMPARE(ev.organizer(), re.organizer());
+ QCOMPARE(ev.url(), re.url());
QCOMPARE(ev.attendees(), re.attendees());
QCOMPARE(ev.attachments(), re.attachments());
QCOMPARE(ev.customProperties(), re.customProperties());
More information about the commits
mailing list