4 commits - CMakeLists.txt conversion/kcalconversion.cpp shared.i tests/CMakeLists.txt tests/kcalconversiontest.cpp utils/CMakeLists.txt

Christian Mollekopf mollekopf at kolabsys.com
Wed Apr 10 14:47:58 CEST 2013


 CMakeLists.txt                |    2 +-
 conversion/kcalconversion.cpp |   10 +++++++++-
 shared.i                      |    5 +++--
 tests/CMakeLists.txt          |    2 +-
 tests/kcalconversiontest.cpp  |   12 ++++++++++--
 utils/CMakeLists.txt          |    2 +-
 6 files changed, 25 insertions(+), 8 deletions(-)

New commits:
commit eb144145b7e626387db532cf20ddb55412c33a5d
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Wed Apr 10 14:47:42 2013 +0200

    Use the static library for testutils.

diff --git a/utils/CMakeLists.txt b/utils/CMakeLists.txt
index 19d34d1..d508956 100644
--- a/utils/CMakeLists.txt
+++ b/utils/CMakeLists.txt
@@ -2,4 +2,4 @@
 find_package(Boost REQUIRED COMPONENTS program_options)
 
 add_executable(kolabformatchecker kolabformatchecker.cpp)
-target_link_libraries(kolabformatchecker kolab ${Boost_LIBRARIES})
+target_link_libraries(kolabformatchecker kolab_static ${Boost_LIBRARIES})


commit f56cd7d99e2473fdf393fbc8cff4fb68d144846f
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Wed Apr 10 14:47:26 2013 +0200

    Find kolabformat.php

diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 023e1f9..186942e 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -25,7 +25,7 @@ addTest(mimeobjecttest)
 addTest(xmlobjecttest)
 
 if(PHP_BINDINGS)
-    find_path(PHP_KOLABFORMAT_PATH NAMES kolabformat.php PATHS /usr/local/lib/php/modules /usr/lib/php/modules)
+    find_path(PHP_KOLABFORMAT_PATH NAMES kolabformat.php PATHS /usr/local/lib/php/modules /usr/lib/php/modules PATH_SUFFIXES lib/php/modules lib64/php/modules)
     message("php kolabformat include path for testing ${PHP_KOLABFORMAT_PATH}")
     add_test(phptest php -d enable_dl=On -d include_path='.:/usr/share/pear:${CMAKE_BINARY_DIR}:${CMAKE_BINARY_DIR}/calendaring/php:${PHP_KOLABFORMAT_PATH}' -d extension=${CMAKE_BINARY_DIR}/lib/kolabcalendaring.so -d extension=${CMAKE_BINARY_DIR}/lib/kolabshared.so -d extension=${PHP_KOLABFORMAT_PATH}/kolabformat.so ${CMAKE_SOURCE_DIR}/calendaring/php/test.php --verbose)
 endif()


commit ada371f473d713c5668a1f3b570ccf4813405400
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Wed Apr 10 14:46:56 2013 +0200

    vector definitions moved to libkolabxml

diff --git a/shared.i b/shared.i
index f75820f..1941daa 100644
--- a/shared.i
+++ b/shared.i
@@ -7,6 +7,7 @@
 %include "std_vector.i"
 %import(module="kolabformat") <kolabevent.h>
 namespace std {
-    %template(vectorevent) vector<Kolab::Event>;
-    %template(vectorevent2) vector< vector<Kolab::Event> >;
+/* vectorevent moved to libkolabxml, vectorevent2 breaks the pythonbindings without vectorevent in here (compile error) */
+/*    %template(vectorevent) vector<Kolab::Event>; */
+/*    %template(vectorevent2) vector< vector<Kolab::Event> >; */
 };


commit 851e8c74e1aedb87bfd4810aa60078e616f2add9
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Wed Apr 10 14:46:37 2013 +0200

    Preserve the url. Requires libkolabxml 0.9

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 37f4046..9f66bcc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -47,7 +47,7 @@ set(CMAKECONFIG_INSTALL_DIR ${LIB_INSTALL_DIR}/cmake/Libkolab )
 include(MacroLogFeature)
 
 # Do the building
-find_package(Libkolabxml 0.8.3 REQUIRED)
+find_package(Libkolabxml 0.9 REQUIRED)
 macro_log_feature(Libkolabxml_FOUND "Libkolabxml" "Kolab XML Format 3 serializing library" "http://git.kolab.org/libkolabxml/" TRUE "0.8.3" "Required for reading/writing Kolab XML Objects")
 
 find_package(Qt4 4.6.0 REQUIRED)
diff --git a/conversion/kcalconversion.cpp b/conversion/kcalconversion.cpp
index 1ba81f3..a82b6a2 100644
--- a/conversion/kcalconversion.cpp
+++ b/conversion/kcalconversion.cpp
@@ -33,6 +33,7 @@ namespace Kolab {
 //The uid of a contact which refers to the uuid of a contact in the addressbook
 #define CUSTOM_KOLAB_CONTACT_UUID "X_KOLAB_CONTACT_UUID"
 #define CUSTOM_KOLAB_CONTACT_CUTYPE "X_KOLAB_CONTACT_CUTYPE"
+#define CUSTOM_KOLAB_URL "X-KOLAB-URL"
 
 KCalCore::Duration toDuration(const Kolab::Duration &d)
 {
@@ -391,7 +392,10 @@ void getIncidence(T &i, const I &e)
     std::vector<Kolab::CustomProperty> customProperties;
     const QMap<QByteArray, QString> &props = e.customProperties();
     for (QMap<QByteArray, QString>::const_iterator it = props.begin(); it != props.end(); it++) {
-        QString key = QString(it.key());
+        QString key(it.key());
+        if (key == QLatin1String(CUSTOM_KOLAB_URL)) {
+            continue;
+        }
         customProperties.push_back(Kolab::CustomProperty(toStdString(key.remove("X-KOLAB-")), toStdString(it.value())));
     }
     i.setCustomProperties(customProperties);
@@ -653,6 +657,9 @@ void setTodoEvent(KCalCore::Incidence &i, const T &e)
     if (e.organizer().isValid()) {
         i.setOrganizer(KCalCore::Person::Ptr(new KCalCore::Person(fromStdString(e.organizer().name()), fromStdString(e.organizer().email())))); //TODO handle uid too
     }
+    if (!e.url().empty()) {
+        i.setNonKDECustomProperty(CUSTOM_KOLAB_URL, fromStdString(e.url()));
+    }
     if (e.recurrenceID().isValid()) {
         i.setRecurrenceId(toDate(e.recurrenceID())); //TODO THISANDFUTURE
     }
@@ -704,6 +711,7 @@ void getTodoEvent(T &i, const I &e)
     if (e.organizer() && !e.organizer()->email().isEmpty()) {
         i.setOrganizer(Kolab::ContactReference(Kolab::ContactReference::EmailReference, toStdString(e.organizer()->email()), toStdString(e.organizer()->name()))); //TODO handle uid too
     }
+    i.setUrl(toStdString(e.nonKDECustomProperty(CUSTOM_KOLAB_URL)));
     i.setRecurrenceID(fromDate(e.recurrenceId()), false); //TODO THISANDFUTURE
     getRecurrence(i, e);
     std::vector <Kolab::Alarm> alarms;
diff --git a/tests/kcalconversiontest.cpp b/tests/kcalconversiontest.cpp
index 67c7806..635b8ae 100644
--- a/tests/kcalconversiontest.cpp
+++ b/tests/kcalconversiontest.cpp
@@ -187,6 +187,8 @@ void KCalConversionTest::testConversion_data()
         kcal.setStatus(KCalCore::Incidence::StatusConfirmed);
         kcal.setLocation("location");
         kcal.setOrganizer(KCalCore::Person::Ptr(new KCalCore::Person("organizer", "organizer at email")));
+        //Url
+        kcal.setNonKDECustomProperty("X-KOLAB-URL", "http://test.org");
         KCalCore::Attendee::Ptr att(new KCalCore::Attendee("attendee", "attendee at email", false, KCalCore::Attendee::NeedsAction, KCalCore::Attendee::ReqParticipant));
         att->setDelegate("mailto:delegatee<delegatee at email>");
         att->setDelegator("mailto:delegator<delegator at email>");
@@ -239,6 +241,7 @@ void KCalConversionTest::testConversion_data()
         kolab.setStatus(Kolab::StatusConfirmed);
         kolab.setLocation("location");
         kolab.setOrganizer(Kolab::ContactReference(Kolab::ContactReference::EmailReference,"organizer at email", "organizer")); //TODO uid
+        kolab.setUrl("http://test.org");
         
         Kolab::Attendee a(Kolab::ContactReference(Kolab::ContactReference::EmailReference,"attendee at email", "attendee"));//TODO uid
         a.setDelegatedTo(std::vector<Kolab::ContactReference>() << Kolab::ContactReference(Kolab::ContactReference::EmailReference,"delegatee at email", "delegatee"));
@@ -343,7 +346,8 @@ void KCalConversionTest::testConversion()
     QFETCH(KCalCore::Event, kcal);
     QFETCH(Kolab::Event, kolab);
     
-    const KCalCore::Event::Ptr e = toKCalCore(kolab);
+    KCalCore::Event::Ptr e = toKCalCore(kolab);
+    const Kolab::Event &b = fromKCalCore(kcal);
     
     QCOMPARE(e->uid(), kcal.uid());
     QCOMPARE(e->created(), kcal.created());
@@ -365,6 +369,10 @@ void KCalConversionTest::testConversion()
     QCOMPARE(e->location(), kcal.location());
     QCOMPARE(e->organizer()->name(), kcal.organizer()->name());
     QCOMPARE(e->organizer()->email(), kcal.organizer()->email());
+    QCOMPARE(e->nonKDECustomProperty("X-KOLAB-URL"), kcal.nonKDECustomProperty("X-KOLAB-URL"));
+    //otherwise we'd break the customProperties comparison
+    e->removeNonKDECustomProperty("X-KOLAB-URL");
+    kcal.removeNonKDECustomProperty("X-KOLAB-URL");
     compareAttendeesVectors(e->attendees(), kcal.attendees());
     comparePointerVectors(e->attachments(), kcal.attachments());
     
@@ -375,7 +383,6 @@ void KCalConversionTest::testConversion()
 //         toKCalCore(kolab);
 //     }
     
-    const Kolab::Event &b = fromKCalCore(kcal);
     QCOMPARE(b.uid(), kolab.uid());
     QCOMPARE(b.created(), kolab.created());
     QCOMPARE(b.lastModified(), kolab.lastModified());
@@ -397,6 +404,7 @@ void KCalConversionTest::testConversion()
     QCOMPARE(b.status(), kolab.status());
     QCOMPARE(b.location(), kolab.location());
     QCOMPARE(b.organizer(), kolab.organizer());
+    QCOMPARE(b.url(), kolab.url());
     QCOMPARE(b.attendees(), kolab.attendees());
     QCOMPARE(b.attachments(), kolab.attachments());
     QCOMPARE(b.customProperties(), kolab.customProperties());





More information about the commits mailing list