summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Mollekopf <mollekopf@kolabsys.com>2013-04-10 09:50:21 (GMT)
committerChristian Mollekopf <mollekopf@kolabsys.com>2013-04-10 09:50:21 (GMT)
commit41189cfb47c7e8866b4cb1c83c79f298c47c2b85 (patch)
tree0eeb831c8223d55a6cc27caa9d4769fdcb04df74
parentba0ab5d3be8c13fb8ddd42c1a399edebbe7acc9c (diff)
downloadlibkolabxml-41189cfb47c7e8866b4cb1c83c79f298c47c2b85.tar.gz
url property for todos and events.
-rw-r--r--schemas/ical/kolabformat-xcal.xsd2
-rw-r--r--src/containers/incidence_p.h1
-rw-r--r--src/containers/kolabevent.cpp10
-rw-r--r--src/containers/kolabevent.h3
-rw-r--r--src/containers/kolabtodo.cpp10
-rw-r--r--src/containers/kolabtodo.h3
-rw-r--r--src/xcalconversions.h8
-rw-r--r--tests/bindingstest.cpp2
8 files changed, 39 insertions, 0 deletions
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());