summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2012-06-06 08:07:56 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2012-06-06 08:07:56 (GMT)
commit4a1b01da6d45e7fec5c4a6101ff73a24770e31d7 (patch)
treed28c9b57bbc5bfb5f2b07fac9f288735bc6b33d0
parentf530d6dd9bb6058e0f443de8db2e8d8e5cd020f7 (diff)
parente0ac86cdbeb03a82f4e98b81dfc8c2eab08c02f5 (diff)
downloadlibkolabxml-4a1b01da6d45e7fec5c4a6101ff73a24770e31d7.tar.gz
Merge branch 'master' of ssh://git.kolab.org/git/libkolabxml
-rw-r--r--schemas/ical/kolabformat-xcal.xsd3
-rw-r--r--src/incidence_p.h1
-rw-r--r--src/kolabevent.cpp10
-rw-r--r--src/kolabevent.h3
-rw-r--r--src/kolabformat.h2
-rw-r--r--src/kolabjournal.cpp10
-rw-r--r--src/kolabjournal.h3
-rw-r--r--src/kolabtodo.cpp10
-rw-r--r--src/kolabtodo.h3
-rw-r--r--src/xcalconversions.h17
-rw-r--r--tests/bindingstest.cpp14
11 files changed, 10 insertions, 66 deletions
diff --git a/schemas/ical/kolabformat-xcal.xsd b/schemas/ical/kolabformat-xcal.xsd
index 04336f1..0a0e9fd 100644
--- a/schemas/ical/kolabformat-xcal.xsd
+++ b/schemas/ical/kolabformat-xcal.xsd
@@ -80,7 +80,6 @@
<xs:sequence>
<xs:element name="uid" type="UidPropType"/>
<xs:element name="created" type="CreatedPropType"/>
- <xs:element name="last-modified" type="LastModifiedPropType" minOccurs="0"/>
<xs:element name="dtstamp" type="DtstampPropType"/>
<xs:element name="sequence" type="SequencePropType" minOccurs="0"/>
<xs:element name="class" type="ClassPropType" minOccurs="0"/>
@@ -122,7 +121,6 @@
<xs:sequence>
<xs:element name="uid" type="UidPropType"/>
<xs:element name="created" type="CreatedPropType"/>
- <xs:element name="last-modified" type="LastModifiedPropType" minOccurs="0"/>
<xs:element name="dtstamp" type="DtstampPropType"/>
<xs:element name="sequence" type="SequencePropType" minOccurs="0"/>
<xs:element name="class" type="ClassPropType" minOccurs="0"/>
@@ -164,7 +162,6 @@
<xs:sequence>
<xs:element name="uid" type="UidPropType"/>
<xs:element name="created" type="CreatedPropType"/>
- <xs:element name="last-modified" type="LastModifiedPropType" minOccurs="0"/>
<xs:element name="dtstamp" type="DtstampPropType"/>
<xs:element name="sequence" type="SequencePropType" minOccurs="0"/>
<xs:element name="class" type="ClassPropType" minOccurs="0"/>
diff --git a/src/incidence_p.h b/src/incidence_p.h
index 42568d4..8602feb 100644
--- a/src/incidence_p.h
+++ b/src/incidence_p.h
@@ -34,7 +34,6 @@ namespace Kolab {
std::string uid;
cDateTime created;
cDateTime lastModified;
- cDateTime timestamp;
int sequence;
Classification classification;
std::vector< std::string > categories;
diff --git a/src/kolabevent.cpp b/src/kolabevent.cpp
index 56295e6..f70346a 100644
--- a/src/kolabevent.cpp
+++ b/src/kolabevent.cpp
@@ -78,16 +78,6 @@ cDateTime Event::lastModified() const
return d->lastModified;
}
-void Event::setTimestamp(const cDateTime &dt)
-{
- d->timestamp = dt;
-}
-
-cDateTime Event::timestamp() const
-{
- return d->timestamp;
-}
-
void Event::setSequence(int sequence)
{
d->sequence = sequence;
diff --git a/src/kolabevent.h b/src/kolabevent.h
index 424fafd..abec9a9 100644
--- a/src/kolabevent.h
+++ b/src/kolabevent.h
@@ -41,9 +41,6 @@ public:
void setLastModified(const cDateTime &);
cDateTime lastModified() const;
-
- void setTimestamp(const cDateTime &);
- cDateTime timestamp() const;
void setSequence(int);
int sequence() const;
diff --git a/src/kolabformat.h b/src/kolabformat.h
index 5267025..404b1a6 100644
--- a/src/kolabformat.h
+++ b/src/kolabformat.h
@@ -80,7 +80,7 @@ std::string generateUID();
* Use this function to override the timestamp which is normally generated upon serialization from the system time.
* To override the timestamp call this function once. You will need to clear the timestamp manually by setting a default constructed cDateTime().
*
- * The timestamp is used as timestamp property on every write, and as creation-date on the first write (when there is no creation-date yet).
+ * The timestamp is used as lastModifiedDate on every write, and as creation-date on the first write (when there is no creation-date yet).
*
* The supplied timestamp must be in UTC format.
*
diff --git a/src/kolabjournal.cpp b/src/kolabjournal.cpp
index 2f3e3ee..ce37fbc 100644
--- a/src/kolabjournal.cpp
+++ b/src/kolabjournal.cpp
@@ -81,16 +81,6 @@ cDateTime Journal::lastModified() const
return d->lastModified;
}
-void Journal::setTimestamp(const cDateTime &dt)
-{
- d->timestamp = dt;
-}
-
-cDateTime Journal::timestamp() const
-{
- return d->timestamp;
-}
-
void Journal::setSequence(int sequence)
{
d->sequence = sequence;
diff --git a/src/kolabjournal.h b/src/kolabjournal.h
index c10bb55..9a904d3 100644
--- a/src/kolabjournal.h
+++ b/src/kolabjournal.h
@@ -41,9 +41,6 @@ public:
void setLastModified(const cDateTime &);
cDateTime lastModified() const;
-
- void setTimestamp(const cDateTime &);
- cDateTime timestamp() const;
void setSequence(int);
int sequence() const;
diff --git a/src/kolabtodo.cpp b/src/kolabtodo.cpp
index 9100e91..ceefcf9 100644
--- a/src/kolabtodo.cpp
+++ b/src/kolabtodo.cpp
@@ -88,16 +88,6 @@ cDateTime Todo::lastModified() const
return d->lastModified;
}
-void Todo::setTimestamp(const cDateTime &dt)
-{
- d->timestamp = dt;
-}
-
-cDateTime Todo::timestamp() const
-{
- return d->timestamp;
-}
-
void Todo::setSequence(int sequence)
{
d->sequence = sequence;
diff --git a/src/kolabtodo.h b/src/kolabtodo.h
index 29b4a3b..ce547e3 100644
--- a/src/kolabtodo.h
+++ b/src/kolabtodo.h
@@ -42,9 +42,6 @@ public:
void setLastModified(const cDateTime &);
cDateTime lastModified() const;
-
- void setTimestamp(const cDateTime &);
- cDateTime timestamp() const;
void setSequence(int);
int sequence() const;
diff --git a/src/xcalconversions.h b/src/xcalconversions.h
index 98f6d9c..af01753 100644
--- a/src/xcalconversions.h
+++ b/src/xcalconversions.h
@@ -810,10 +810,7 @@ void setIncidenceProperties(I &inc, const T &prop)
{
inc.setUid(toString(prop.uid()));
inc.setCreated(*toDate(prop.created()));
- if (prop.last_modified()) {
- inc.setLastModified(*toDate(*prop.last_modified()));
- }
- inc.setTimestamp(*toDate(prop.dtstamp()));
+ inc.setLastModified(*toDate(prop.dtstamp()));
if (prop.sequence()) {
inc.setSequence(toInt(*prop.sequence()));
@@ -1086,15 +1083,9 @@ template <typename T, typename I>
void getIncidenceProperties(T &prop, const I &inc)
{
using namespace icalendar_2_0;
-
- typedef T properties;
-
- if (inc.lastModified().isValid()) {
- icalendar_2_0::LastModifiedPropType p;
- p.date_time(fromDateTime(inc.lastModified()));
- prop.last_modified(p);
- }
-
+
+ typedef T properties;
+
prop.sequence(fromInt<xml_schema::integer>(inc.sequence()));
switch (inc.classification()) {
diff --git a/tests/bindingstest.cpp b/tests/bindingstest.cpp
index 9d6437c..276b572 100644
--- a/tests/bindingstest.cpp
+++ b/tests/bindingstest.cpp
@@ -111,7 +111,6 @@ void setIncidence(T &ev)
{
ev.setUid("UID");
ev.setCreated(Kolab::cDateTime(2006,1,6,12,0,0,true)); //UTC
- ev.setLastModified(Kolab::cDateTime(2006,1,6,12,0,0,true)); //UTC
ev.setSequence(1);
ev.setClassification(Kolab::ClassConfidential);
ev.addCategory("Category");
@@ -222,8 +221,7 @@ void checkIncidence(const T &ev, const T &re)
QCOMPARE(ev.uid(), re.uid());
QCOMPARE(ev.created(), re.created());
- QCOMPARE(ev.lastModified(), re.lastModified());
- QVERIFY(re.timestamp().isValid()); //TODO can we check this better?
+ QVERIFY(re.lastModified().isValid()); //TODO can we check this better?
QCOMPARE(ev.sequence(), re.sequence());
QCOMPARE(ev.classification(), re.classification());
QCOMPARE(ev.categories(), re.categories());
@@ -274,7 +272,7 @@ void BindingsTest::eventCompletness()
ev.setTransparency(true);
std::string result = Kolab::writeEvent(ev);
- QCOMPARE(Kolab::error(), Kolab::NoError);
+ QVERIFY(Kolab::error() == Kolab::NoError);
// std::cout << result << endl;
Kolab::Event e = Kolab::readEvent(result, false);
QVERIFY(Kolab::error() == Kolab::NoError);
@@ -326,7 +324,6 @@ void BindingsTest::journalCompletness()
ev.setUid("UID");
ev.setCreated(Kolab::cDateTime(2006,1,6,12,0,0,true)); //UTC
- ev.setLastModified(Kolab::cDateTime(2006,1,6,12,0,0,true)); //UTC
ev.setSequence(1);
ev.setClassification(Kolab::ClassConfidential);
ev.addCategory("Category");
@@ -392,8 +389,7 @@ void BindingsTest::journalCompletness()
QCOMPARE(ev.uid(), re.uid());
QCOMPARE(ev.created(), re.created());
- QCOMPARE(ev.lastModified(), re.lastModified());
- QVERIFY(re.timestamp().isValid()); //TODO can we check this better?
+ QVERIFY(re.lastModified().isValid()); //TODO can we check this better?
QCOMPARE(ev.sequence(), re.sequence());
QCOMPARE(ev.classification(), re.classification());
QCOMPARE(ev.categories(), re.categories());
@@ -520,10 +516,10 @@ void BindingsTest::contactCompletness()
c.setCustomProperties(properties);
const std::string result = Kolab::writeContact(c);
- QCOMPARE(Kolab::error(), Kolab::NoError);
+ QVERIFY(Kolab::error() == Kolab::NoError);
// std::cout << result << endl;
Kolab::Contact e = Kolab::readContact(result, false);
- QCOMPARE(Kolab::error(), Kolab::NoError);
+ QVERIFY(Kolab::error() == Kolab::NoError);
QCOMPARE(e.uid(), c.uid());
QCOMPARE(e.categories(), c.categories());
QCOMPARE(e.name(), c.name());