14 commits - akonadi-version.h.cmake CMakeLists.txt conversion/kabcconversion.cpp kolabformat/errorhandler.cpp kolabformat/errorhandler.h kolabformat/kolabobject.cpp kolabformat/kolabobject.h kolabformat/v2helpers.h kolabformatV2/incidence.cpp kolabformatV2/journal.cpp kolabformatV2/note.cpp libkolab-version.h.cmake mime/mimeutils.cpp mime/mimeutils.h tests/benchmark.cpp tests/formattest.cpp tests/formattest.h tests/kcalconversiontest.cpp tests/testfiles tests/testutils.h tests/upgradetest.cpp

Christian Mollekopf mollekopf at kolabsys.com
Wed Apr 25 16:59:21 CEST 2012


 CMakeLists.txt                               |    6 -
 akonadi-version.h.cmake                      |   25 -----
 conversion/kabcconversion.cpp                |    1 
 kolabformat/errorhandler.cpp                 |   27 +++--
 kolabformat/errorhandler.h                   |   34 ++++---
 kolabformat/kolabobject.cpp                  |   90 ++++++++++---------
 kolabformat/kolabobject.h                    |   37 +++++--
 kolabformat/v2helpers.h                      |   12 +-
 kolabformatV2/incidence.cpp                  |    4 
 kolabformatV2/journal.cpp                    |    4 
 kolabformatV2/note.cpp                       |    4 
 libkolab-version.h.cmake                     |   25 +++++
 mime/mimeutils.cpp                           |   17 +--
 mime/mimeutils.h                             |    8 -
 tests/benchmark.cpp                          |    3 
 tests/formattest.cpp                         |  123 +++++++++++++-------------
 tests/formattest.h                           |   12 ++
 tests/kcalconversiontest.cpp                 |   10 --
 tests/testfiles/v2/contacts/complex.vcf.mime |    2 
 tests/testfiles/v2/contacts/simple.vcf.mime  |    2 
 tests/testfiles/v2/event/allday.ics.mime     |    6 -
 tests/testfiles/v2/event/attachment.ics.mime |    6 -
 tests/testfiles/v2/event/complex.ics.mime    |    6 -
 tests/testfiles/v2/event/horde.ics.mime      |    2 
 tests/testfiles/v2/event/simple.ics.mime     |    9 -
 tests/testfiles/v3/contacts/simple.vcf.mime  |   16 +--
 tests/testfiles/v3/event/complex.ics.mime    |   22 ++--
 tests/testfiles/v3/event/simple.ics.mime     |  126 +++++++++++++--------------
 tests/testutils.h                            |   20 +++-
 tests/upgradetest.cpp                        |   16 ---
 30 files changed, 361 insertions(+), 314 deletions(-)

New commits:
commit 40b36a8f26f88d5eb903c7a9d100768370d269a3
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Wed Apr 25 16:51:40 2012 +0200

    normalize mime messages so tests pass.

diff --git a/tests/formattest.cpp b/tests/formattest.cpp
index 013f232..dbf1a1c 100644
--- a/tests/formattest.cpp
+++ b/tests/formattest.cpp
@@ -35,7 +35,12 @@
 #include "kolabformat/kolabobject.h"
 
 
-
+void normalizeMimemessage(QString &content)
+{
+    content.replace(QRegExp("\\bLibkolab-\\d.\\d.\\d\\b", Qt::CaseSensitive), "Libkolab-x.x.x");
+    content.replace(QRegExp("\\bLibkolabxml-\\d.\\d.\\d\\b", Qt::CaseSensitive), "Libkolabxml-x.x.x");
+    content.replace(QRegExp("<uri>cid:*@kolab.resource.akonadi</uri>", Qt::CaseSensitive, QRegExp::Wildcard), "<uri>cid:id at kolab.resource.akonadi</uri>");
+}
 
 static bool compareMimeMessage( const KMime::Message::Ptr &msg, const KMime::Message::Ptr &expectedMsg )
 {
@@ -62,8 +67,14 @@ static bool compareMimeMessage( const KMime::Message::Ptr &msg, const KMime::Mes
         KCOMPARE( part->contentDisposition()->filename(), expectedPart->contentDisposition()->filename() );
         
         KCOMPARE( part->decodedContent().isEmpty(), false );
+        
+        QString content(part->decodedContent());
+        normalizeMimemessage(content);
+        QString expected(expectedPart->decodedContent());
+        normalizeMimemessage(expected);
+
         // part content
-        KCOMPARE( QString(part->decodedContent()).simplified(), QString(expectedPart->decodedContent()).simplified() );
+        KCOMPARE( content.simplified(), expected.simplified() );
     }
     return true;
 }


commit c950caedcf904735e5ebe0a67f67dfcfed019a39
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Wed Apr 25 16:51:19 2012 +0200

    Don't log Debug level messages, renamed NoError to Debug.

diff --git a/kolabformat/errorhandler.cpp b/kolabformat/errorhandler.cpp
index dc84889..19817ad 100644
--- a/kolabformat/errorhandler.cpp
+++ b/kolabformat/errorhandler.cpp
@@ -32,8 +32,9 @@ void logMessage(const QString &message, const QString &file, int line, ErrorHand
 
 void ErrorHandler::addError(ErrorHandler::Severity s, const QString& message, const QString &location)
 {
-    if (s == NoError) {
+    if (s == Debug) {
         qDebug() << location << ": " << message;
+        return;
     } else {
         qWarning() << location << ": " << message;
     }
@@ -56,7 +57,7 @@ const QList< ErrorHandler::Err >& ErrorHandler::getErrors() const
 void ErrorHandler::clear()
 {
     m_errorQueue.clear();
-    m_worstError = NoError;
+    m_worstError = Debug;
 }
 
 void ErrorHandler::handleLibkolabxmlErrors()
diff --git a/kolabformat/errorhandler.h b/kolabformat/errorhandler.h
index 02e1c91..73047cc 100644
--- a/kolabformat/errorhandler.h
+++ b/kolabformat/errorhandler.h
@@ -44,7 +44,7 @@ class KOLAB_EXPORT ErrorHandler
 {
 public:
     enum Severity {
-        NoError,
+        Debug,
         Warning, //Warning, error could be corrected, object can be used without dataloss. This warning is also used if dataloss is acceptable because a feature is explicitly not supported.
         Error, //Potentially corrupt object, writing the object back could result in dataloss. (Object could still be used to display the data readonly).
         Critical //Critical error, produced object cannot be used and should be thrown away (writing back will result in dataloss).
@@ -79,7 +79,7 @@ public:
     }
     
 private:
-    ErrorHandler():m_worstError(NoError) {};
+    ErrorHandler():m_worstError(Debug) {};
     ErrorHandler(const ErrorHandler &);
     ErrorHandler & operator= (const ErrorHandler &);
     
@@ -89,7 +89,7 @@ private:
 
 void logMessage(const QString &,const QString &, int, ErrorHandler::Severity s);
 
-#define LOG(message) logMessage(message,__FILE__, __LINE__, ErrorHandler::NoError);
+#define LOG(message) logMessage(message,__FILE__, __LINE__, ErrorHandler::Debug);
 #define WARNING(message) logMessage(message,__FILE__, __LINE__, ErrorHandler::Warning);
 #define ERROR(message) logMessage(message,__FILE__, __LINE__, ErrorHandler::Error);
 #define CRITICAL(message) logMessage(message,__FILE__, __LINE__, ErrorHandler::Critical);
@@ -128,7 +128,7 @@ struct KolabLogger {
         return KolabLogger(m_severity, m_message+maybeSpace()+QString::fromAscii(t), m_location);
     }
 };
-#define Debug() Kolab::KolabLogger(Kolab::ErrorHandler::NoError, __LINE__, __FILE__)
+#define Debug() Kolab::KolabLogger(Kolab::ErrorHandler::Debug, __LINE__, __FILE__)
 #define Warning() Kolab::KolabLogger(Kolab::ErrorHandler::Warning, __LINE__, __FILE__)
 #define Error() Kolab::KolabLogger(Kolab::ErrorHandler::Error, __LINE__, __FILE__)
 #define Critical() Kolab::KolabLogger(Kolab::ErrorHandler::Critical, __LINE__, __FILE__)


commit 99d5cdb3a853e70a45c86852dbf8c7a56e41b9e2
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Wed Apr 25 15:55:35 2012 +0200

    NoError means that there is no message.

diff --git a/kolabformat/errorhandler.cpp b/kolabformat/errorhandler.cpp
index 9352679..dc84889 100644
--- a/kolabformat/errorhandler.cpp
+++ b/kolabformat/errorhandler.cpp
@@ -62,9 +62,6 @@ void ErrorHandler::clear()
 void ErrorHandler::handleLibkolabxmlErrors()
 {
     switch (Kolab::error()) {
-        case Kolab::NoError:
-            instance().addError(ErrorHandler::NoError, QString::fromStdString(Kolab::errorMessage()), "libkolabxml");
-            break;
         case Kolab::Warning:
             instance().addError(ErrorHandler::Warning, QString::fromStdString(Kolab::errorMessage()), "libkolabxml");
             break;
@@ -74,6 +71,9 @@ void ErrorHandler::handleLibkolabxmlErrors()
         case Kolab::Critical:
             instance().addError(ErrorHandler::Critical, QString::fromStdString(Kolab::errorMessage()), "libkolabxml");
             break;
+        default:
+            //Do nothing, there is no message available in this case
+            break;
     }
 }
 


commit aae6616b23e77f0748925a716ef120511b280c8d
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Wed Apr 25 15:01:52 2012 +0200

    Fixed benchmark test.

diff --git a/tests/benchmark.cpp b/tests/benchmark.cpp
index 09d2bbf..af11c85 100644
--- a/tests/benchmark.cpp
+++ b/tests/benchmark.cpp
@@ -21,6 +21,7 @@
 #include <kmime/kmime_message.h>
 #include <kolab/kolabformat.h>
 #include <kdebug.h>
+#include "testutils.h"
 
 KMime::Message::Ptr readMimeFile( const QString &fileName )
 {
@@ -55,7 +56,7 @@ void BenchmarkTests::parsingBenchmarkComparison_data()
 
 void BenchmarkTests::parsingBenchmarkComparison()
 {
-    const KMime::Message::Ptr kolabItem = readMimeFile( "../../../testfiles/v2/event/complex.ics.mime" );
+    const KMime::Message::Ptr kolabItem = readMimeFile( TESTFILEDIR+QString::fromLatin1("/v2/event/complex.ics.mime") );
     KMime::Content *xmlContent = findContentByType( kolabItem, "application/x-vnd.kolab.event" );
     QVERIFY ( xmlContent );
     const QByteArray xmlData = xmlContent->decodedContent();


commit fe06a90a95e2272ed534906350759071e9a55331
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Wed Apr 25 14:55:55 2012 +0200

    That's not an error.

diff --git a/conversion/kabcconversion.cpp b/conversion/kabcconversion.cpp
index 218b5f1..ed765a8 100644
--- a/conversion/kabcconversion.cpp
+++ b/conversion/kabcconversion.cpp
@@ -383,7 +383,6 @@ std::string getCustom(const std::string &id, T &object)
             return prop.value;
         }
     }
-    Error() << "custom property not found";
     return std::string();
 }
 


commit 4744e601c115913bd305d691e937ca1707dcd077
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Wed Apr 25 14:55:41 2012 +0200

    fixed tests.

diff --git a/tests/kcalconversiontest.cpp b/tests/kcalconversiontest.cpp
index e5d6ff4..f5bfddb 100644
--- a/tests/kcalconversiontest.cpp
+++ b/tests/kcalconversiontest.cpp
@@ -250,20 +250,18 @@ void KCalConversionTest::testDateTZ_data()
 {
     QTest::addColumn<Kolab::cDateTime>( "input" );
     QTest::addColumn<KDateTime>( "result" );
-    QTest::addColumn<int>( "offset" );
        
-    QTest::newRow( "berlin" ) << Kolab::cDateTime("Europe/Berlin",2006,1,8,12,0,0) << KDateTime(QDate(2006, 1, 8), QTime(12, 0, 0), KSystemTimeZones::zone("Europe/Berlin")) << 3600;
+    QTest::newRow( "berlin" ) << Kolab::cDateTime("Europe/Berlin",2006,1,8,12,0,0) << KDateTime(QDate(2006, 1, 8), QTime(12, 0, 0), KSystemTimeZones::zone("Europe/Berlin"));
 }
 
 void KCalConversionTest::testDateTZ()
 {
     QFETCH(Kolab::cDateTime, input);
     QFETCH(KDateTime, result);
-    QFETCH(int, offset);
     
     const KDateTime &r = Kolab::Conversion::toDate(input);
     QCOMPARE(result.timeZone().name(), QString::fromStdString(input.timezone()));
-    QCOMPARE(r.timeZone().currentOffset(), offset);
+    QCOMPARE(r.timeZone().currentOffset(), result.timeZone().currentOffset());
     
     const Kolab::cDateTime &r2 = Kolab::Conversion::fromDate(result);
     QCOMPARE(QString::fromStdString(r2.timezone()), result.timeZone().name());
@@ -593,7 +591,7 @@ void KCalConversionTest::testContactConversion_data()
     {
         KABC::Addressee kcal;
         kcal.setUid("uid");
-        kcal.setName("name");
+        kcal.setFormattedName("name");
         
         Kolab::Contact kolab;
         kolab.setUid("uid");
@@ -612,7 +610,7 @@ void KCalConversionTest::testContactConversion()
     const KABC::Addressee &e = toKABC(kolab);
     
     QCOMPARE(e.uid(), kcal.uid());
-    QCOMPARE(e.name(), kcal.name());
+    QCOMPARE(e.formattedName(), kcal.formattedName());
     
     const Kolab::Contact &b = fromKABC(kcal);
     QCOMPARE(b.uid(), kolab.uid());


commit b0211162a82b689f7dfb01cbdc82ad12bcf9efbd
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Wed Apr 25 14:55:28 2012 +0200

    Fixed error location.

diff --git a/kolabformat/errorhandler.cpp b/kolabformat/errorhandler.cpp
index 34b8241..9352679 100644
--- a/kolabformat/errorhandler.cpp
+++ b/kolabformat/errorhandler.cpp
@@ -33,9 +33,9 @@ void logMessage(const QString &message, const QString &file, int line, ErrorHand
 void ErrorHandler::addError(ErrorHandler::Severity s, const QString& message, const QString &location)
 {
     if (s == NoError) {
-        qDebug() << message;
+        qDebug() << location << ": " << message;
     } else {
-        qWarning() << message;
+        qWarning() << location << ": " << message;
     }
     if (s > m_worstError) {
         m_worstError = s;
diff --git a/kolabformat/errorhandler.h b/kolabformat/errorhandler.h
index 9ac429d..02e1c91 100644
--- a/kolabformat/errorhandler.h
+++ b/kolabformat/errorhandler.h
@@ -107,24 +107,25 @@ struct KolabLogger {
     QString m_message;
     QString m_location;
     ErrorHandler::Severity m_severity;
-    KolabLogger(ErrorHandler::Severity s, int line, const QString &file): isLast(true), m_message(), m_location(file + ":" + QString::number(line)), m_severity(s) {};
-    KolabLogger(ErrorHandler::Severity s, const QString &message): isLast(true), m_message(message), m_severity(s) {};
+    KolabLogger(ErrorHandler::Severity s, int line, const QString &file): isLast(true), m_message(), m_location(file + "(" + QString::number(line)+")"), m_severity(s) {};
+    KolabLogger(ErrorHandler::Severity s, const QString &message, const QString &location): isLast(true), m_message(message), m_location(location), m_severity(s) {};
     ~KolabLogger(){if (isLast) ErrorHandler::instance().addError(m_severity, m_message, m_location);}
+    QString maybeSpace() const { if (!m_message.isEmpty()) return " "; return ""; }
     KolabLogger operator<<(const QString &message) {
         isLast = false;
-        return KolabLogger(m_severity, m_message+" "+message);
+        return KolabLogger(m_severity, m_message+maybeSpace()+message, m_location);
     }
     KolabLogger operator<<(const QByteArray &message) {
         isLast = false;
-        return KolabLogger(m_severity, m_message+" "+message);
+        return KolabLogger(m_severity, m_message+maybeSpace()+message, m_location);
     }
     KolabLogger operator<<(const int &n) {
         isLast = false;
-        return KolabLogger(m_severity, m_message+" "+QString::number(n));
+        return KolabLogger(m_severity, m_message+maybeSpace()+QString::number(n), m_location);
     }
     inline KolabLogger operator<<(const char* t) {
         isLast = false;
-        return KolabLogger(m_severity, m_message+" "+QString::fromAscii(t));
+        return KolabLogger(m_severity, m_message+maybeSpace()+QString::fromAscii(t), m_location);
     }
 };
 #define Debug() Kolab::KolabLogger(Kolab::ErrorHandler::NoError, __LINE__, __FILE__)


commit 6cc06a01bce31896ccf6b6bad9ac3ee650586990
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Tue Apr 24 09:30:54 2012 +0200

    Made error location separately available from string.

diff --git a/kolabformat/errorhandler.cpp b/kolabformat/errorhandler.cpp
index 1547714..34b8241 100644
--- a/kolabformat/errorhandler.cpp
+++ b/kolabformat/errorhandler.cpp
@@ -26,11 +26,11 @@ namespace Kolab {
     
 void logMessage(const QString &message, const QString &file, int line, ErrorHandler::Severity s)
 {
-    ErrorHandler::instance().addError(s, file+" "+QString::number(line)+": " + "  " + message);
+    ErrorHandler::instance().addError(s, message, file+" "+QString::number(line));
 }
 
 
-void ErrorHandler::addError(ErrorHandler::Severity s, const QString& message)
+void ErrorHandler::addError(ErrorHandler::Severity s, const QString& message, const QString &location)
 {
     if (s == NoError) {
         qDebug() << message;
@@ -40,7 +40,7 @@ void ErrorHandler::addError(ErrorHandler::Severity s, const QString& message)
     if (s > m_worstError) {
         m_worstError = s;
     }
-    m_errorQueue.append(Err(s, message));
+    m_errorQueue.append(Err(s, message, location));
 }
 
 ErrorHandler::Severity ErrorHandler::error() const
@@ -63,16 +63,16 @@ void ErrorHandler::handleLibkolabxmlErrors()
 {
     switch (Kolab::error()) {
         case Kolab::NoError:
-            instance().addError(ErrorHandler::NoError, QString::fromStdString(Kolab::errorMessage()));
+            instance().addError(ErrorHandler::NoError, QString::fromStdString(Kolab::errorMessage()), "libkolabxml");
             break;
         case Kolab::Warning:
-            instance().addError(ErrorHandler::Warning, QString::fromStdString(Kolab::errorMessage()));
+            instance().addError(ErrorHandler::Warning, QString::fromStdString(Kolab::errorMessage()), "libkolabxml");
             break;
         case Kolab::Error:
-            instance().addError(ErrorHandler::Error, QString::fromStdString(Kolab::errorMessage()));
+            instance().addError(ErrorHandler::Error, QString::fromStdString(Kolab::errorMessage()), "libkolabxml");
             break;
         case Kolab::Critical:
-            instance().addError(ErrorHandler::Critical, QString::fromStdString(Kolab::errorMessage()));
+            instance().addError(ErrorHandler::Critical, QString::fromStdString(Kolab::errorMessage()), "libkolabxml");
             break;
     }
 }
diff --git a/kolabformat/errorhandler.h b/kolabformat/errorhandler.h
index 970e43f..9ac429d 100644
--- a/kolabformat/errorhandler.h
+++ b/kolabformat/errorhandler.h
@@ -51,9 +51,10 @@ public:
     };
     
     struct Err {
-        Err(Severity s, const QString &m): severity(s), message(m){};
+        Err(Severity s, const QString &m, const QString &l): severity(s), message(m), location(l){};
         Severity severity;
         QString message;
+        QString location;
     };
     
     static ErrorHandler &instance()
@@ -62,7 +63,7 @@ public:
         return inst;
     }
     
-    void addError(Severity s, const QString &message);
+    void addError(Severity s, const QString &message, const QString &location);
     const QList <Err> &getErrors() const;
     Severity error() const;
     void clear();
@@ -104,10 +105,11 @@ void logMessage(const QString &,const QString &, int, ErrorHandler::Severity s);
 struct KolabLogger {
     bool isLast;
     QString m_message;
+    QString m_location;
     ErrorHandler::Severity m_severity;
-    KolabLogger(ErrorHandler::Severity s, int line, const QString &file): isLast(true), m_message(file + ":" + QString::number(line) + ":"), m_severity(s) {};
+    KolabLogger(ErrorHandler::Severity s, int line, const QString &file): isLast(true), m_message(), m_location(file + ":" + QString::number(line)), m_severity(s) {};
     KolabLogger(ErrorHandler::Severity s, const QString &message): isLast(true), m_message(message), m_severity(s) {};
-    ~KolabLogger(){if (isLast) ErrorHandler::instance().addError(m_severity, m_message);}
+    ~KolabLogger(){if (isLast) ErrorHandler::instance().addError(m_severity, m_message, m_location);}
     KolabLogger operator<<(const QString &message) {
         isLast = false;
         return KolabLogger(m_severity, m_message+" "+message);


commit 38339ce013b027b46fb644c6010dfe57d2540f29
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Tue Apr 24 09:29:37 2012 +0200

    Cleanup, comments, less debuginfo.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 45c73ff..6833c91 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,7 +11,7 @@ set(Libkolab_VERSION_MAJOR 0)
 set(Libkolab_VERSION_MINOR 1)
 set(Libkolab_VERSION_PATCH 0)
 set(Libkolab_VERSION ${Libkolab_VERSION_MAJOR}.${Libkolab_VERSION_MINOR}.${Libkolab_VERSION_PATCH} )
-set (Libkolab_VERSION_STRING ${CMAKE_PROJECT_NAME}-${Libkolab_VERSION})
+set(Libkolab_VERSION_STRING ${CMAKE_PROJECT_NAME}-${Libkolab_VERSION})
 
 # set up install directories. INCLUDE_INSTALL_DIR and LIB_INSTALL_DIR must not be absolute paths
 set(LIB_INSTALL_DIR_SUFFIX "" CACHE STRING "The directories where to install libraries to")
@@ -26,6 +26,7 @@ find_library(KOLABXML NAMES kolabxml)
 
 find_package(Qt4 REQUIRED)
 find_package(KDE4 REQUIRED)
+# find_package(Libkolab 0.4 REQUIRED) Works only since libkolabxml 0.4
 find_package(KolabKDELibraries REQUIRED)
 
 set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS} -fPIC" )
diff --git a/kolabformat/kolabobject.cpp b/kolabformat/kolabobject.cpp
index 673b462..136b2ad 100644
--- a/kolabformat/kolabobject.cpp
+++ b/kolabformat/kolabobject.cpp
@@ -108,36 +108,36 @@ ObjectType KolabObjectReader::parseMimeMessage(const KMime::Message::Ptr &msg)
         }
         const QByteArray &xmlData = xmlContent->decodedContent();
         QStringList attachments;
-        Debug() << kolabType;
+//         kDebug() << kolabType;
         if (kolabType == eventKolabType()) { //Event
-            Debug() << "v2event";
+//             kDebug() << "v2event";
             d->mIncidence = fromXML<KCalCore::Event::Ptr, KolabV2::Event>(xmlData, attachments);
             d->mObjectType = EventObject;
         } else if (kolabType == todoKolabType()) { //Todo 
-            Debug() << "v2todo";
+//             kDebug() << "v2todo";
             d->mIncidence = fromXML<KCalCore::Todo::Ptr, KolabV2::Task>(xmlData, attachments);
             d->mObjectType = TodoObject;
         } else if (kolabType == journalKolabType()) { //Journal
-            Debug() << "v2journal";
+//             kDebug() << "v2journal";
             d->mIncidence = fromXML<KCalCore::Journal::Ptr, KolabV2::Journal>(xmlData, attachments);
             d->mObjectType = JournalObject;
         } else if (kolabType == contactKolabType()) { //Contact
-            Debug() << "v2contact";
+//             kDebug() << "v2contact";
             d->mAddressee = addresseFromKolab(xmlData, msg);
             d->mObjectType = ContactObject;
         }  else if (kolabType == distlistKolabType()) { //Distlist
-            Debug() << "v2distlist";
+//             kDebug() << "v2distlist";
             d->mContactGroup = contactGroupFromKolab(xmlData);
             d->mObjectType = DistlistObject;
         }  else if (kolabType == noteKolabType()) { //Note
-            Debug() << "v2notes";
+//             kDebug() << "v2notes";
             d->mNote = noteFromKolab(xmlData, msg);
             d->mObjectType = NoteObject;
         } else {
             CRITICAL("no kolab object found "+kolabType);
         }
         if (d->mIncidence) {
-            Debug() << "v2 attachments " << attachments.size() << d->mIncidence->attachments().size();
+//             kDebug() << "v2 attachments " << attachments.size() << d->mIncidence->attachments().size();
             d->mIncidence->clearAttachments();
             Mime::getAttachments(d->mIncidence, attachments, msg);
             Q_ASSERT(d->mIncidence->attachments().size() == attachments.size());
@@ -145,8 +145,8 @@ ObjectType KolabObjectReader::parseMimeMessage(const KMime::Message::Ptr &msg)
     } else { //V3
         
         if (kolabType == eventKolabType()) { //Event
-            Debug() << "event";
-//             Debug() << msg->encodedContent();
+//             kDebug() << "event";
+//             kDebug() << msg->encodedContent();
             
             KMime::Content *xmlContent = Mime::findContentByType( msg, xCalMimeType().toLocal8Bit() );
             if ( !xmlContent ) {
@@ -157,7 +157,7 @@ ObjectType KolabObjectReader::parseMimeMessage(const KMime::Message::Ptr &msg)
             d->mIncidence = Kolab::Conversion::toKCalCore(event);
             d->mObjectType = EventObject;
         } else if (kolabType == todoKolabType()) { //Todo 
-            Debug() << "todo";
+//             kDebug() << "todo";
             KMime::Content *xmlContent = Mime::findContentByType( msg, xCalMimeType().toLocal8Bit() );
             if ( !xmlContent ) {
                 CRITICAL("no part found");
@@ -167,7 +167,7 @@ ObjectType KolabObjectReader::parseMimeMessage(const KMime::Message::Ptr &msg)
             d->mIncidence = Kolab::Conversion::toKCalCore(event);
             d->mObjectType = TodoObject;
         } else if (kolabType == journalKolabType()) { //Journal
-            Debug() << "journal";
+//             kDebug() << "journal";
             KMime::Content *xmlContent = Mime::findContentByType( msg, xCalMimeType().toLocal8Bit() );
             if ( !xmlContent ) {
                 CRITICAL("no part found");
@@ -177,7 +177,7 @@ ObjectType KolabObjectReader::parseMimeMessage(const KMime::Message::Ptr &msg)
             d->mIncidence = Kolab::Conversion::toKCalCore(event);
             d->mObjectType = JournalObject;
         } else if (kolabType == contactKolabType()) { //Contact
-            Debug() << "contact";
+//             kDebug() << "contact";
             KMime::Content *xmlContent = Mime::findContentByType( msg, xCardMimeType().toLocal8Bit() );
             if ( !xmlContent ) {
                 CRITICAL("no part found");
@@ -187,7 +187,7 @@ ObjectType KolabObjectReader::parseMimeMessage(const KMime::Message::Ptr &msg)
             d->mAddressee = Kolab::Conversion::toKABC(contact); //TODO extract attachments
             d->mObjectType = ContactObject;
         }  else if (kolabType == distlistKolabType()) { //Distlist
-            Debug() << "distlist";
+//             kDebug() << "distlist";
             KMime::Content *xmlContent = Mime::findContentByType( msg, xCardMimeType().toLocal8Bit() );
             if ( !xmlContent ) {
                 CRITICAL("no part found");
@@ -197,7 +197,7 @@ ObjectType KolabObjectReader::parseMimeMessage(const KMime::Message::Ptr &msg)
             d->mContactGroup = Kolab::Conversion::toKABC(distlist);
             d->mObjectType = DistlistObject;
         }  else if (kolabType == noteKolabType()) { //Note
-            Debug() << "notes";
+//             kDebug() << "notes";
             KMime::Content *xmlContent = Mime::findContentByType( msg, noteMimeType().toLocal8Bit() );
             if ( !xmlContent ) {
                 CRITICAL("no part found");
@@ -210,7 +210,7 @@ ObjectType KolabObjectReader::parseMimeMessage(const KMime::Message::Ptr &msg)
             CRITICAL("no kolab object found " + kolabType);
         }
         if (d->mIncidence) {
-            Debug() << "getting attachments";
+//             kDebug() << "getting attachments";
             Mime::getAttachmentsById(d->mIncidence, msg);
         }
         ErrorHandler::handleLibkolabxmlErrors();
diff --git a/kolabformat/kolabobject.h b/kolabformat/kolabobject.h
index 18a3640..5f0db29 100644
--- a/kolabformat/kolabobject.h
+++ b/kolabformat/kolabobject.h
@@ -50,7 +50,9 @@ KOLAB_EXPORT KCalCore::Event::Ptr readV2EventXML(const QByteArray &xmlData, QStr
 /**
  * Class to read Kolab Mime files
  * 
- * It implements the Kolab specifics of Mime message handling
+ * It implements the Kolab specifics of Mime message handling.
+ * This class is not reusable and only meant to read a single object.
+ * Parse the mime message and then call the correct getter, based on the type
  * 
  */
 class KOLAB_EXPORT KolabObjectReader {
@@ -60,10 +62,21 @@ public:
     ~KolabObjectReader();
     
     ObjectType parseMimeMessage(const KMime::Message::Ptr &msg);
-    
+    /**
+     * Returns the Object type of the parsed kolab object.
+     */
     ObjectType getType() const;
-    
+    /**
+     * Returns the kolab-format version of the parsed kolab object.
+     */
     Version getVersion() const;
+    
+    /**
+     * Getter to get the retrieved object.
+     * Only the correct one will return a valid object.
+     * 
+     * Use getType() to determine the correct one to call.
+     */
     KCalCore::Event::Ptr getEvent() const;
     KCalCore::Todo::Ptr getTodo() const;
     KCalCore::Journal::Ptr getJournal() const;
@@ -79,6 +92,10 @@ private:
     //@endcond
 };
 
+/**
+ * Class to write Kolab Mime files
+ * 
+ */
 class KOLAB_EXPORT KolabObjectWriter {
 public:
 


commit 1b933127bb7906ed84d939416627a98c57631423
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Mon Apr 23 14:07:32 2012 +0200

    Updated tests and got rid of akonadi-version.h.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8776e72..45c73ff 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -40,7 +40,6 @@ include_directories(
 )
 
 #Make akonadi version available for kolabformatv2 TODO Get rid of this, it shouldn't be necessary
-configure_file(akonadi-version.h.cmake "${CMAKE_BINARY_DIR}/akonadi-version.h" @ONLY)
 configure_file(libkolab-version.h.cmake "${CMAKE_BINARY_DIR}/libkolab-version.h" @ONLY)
 
 add_subdirectory(kolabformatV2)
diff --git a/akonadi-version.h.cmake b/akonadi-version.h.cmake
deleted file mode 100644
index 58c028e..0000000
--- a/akonadi-version.h.cmake
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-    This file is part of kdepim.
-    Copyright (C) 2009 Christophe Giboudeaux  <cgiboudeaux at gmail.com>
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-*/
-
-#ifndef AKONADI_VERSION_H
-#define AKONADI_VERSION_H
-
-#define AKONADI_VERSION "@AKONADI_VERSION@"
-
-#endif // AKONADI_VERSION_H
\ No newline at end of file
diff --git a/kolabformatV2/incidence.cpp b/kolabformatV2/incidence.cpp
index fcd5803..a800193 100644
--- a/kolabformatV2/incidence.cpp
+++ b/kolabformatV2/incidence.cpp
@@ -32,7 +32,7 @@
 */
 
 #include "incidence.h"
-#include "akonadi-version.h"
+#include "libkolab-version.h"
 
 #include <QList>
 
@@ -967,7 +967,7 @@ void Incidence::saveTo( const KCalCore::Incidence::Ptr &incidence )
 
 QString Incidence::productID() const
 {
-  return QString( "Akonadi %1, Kolab resource" ).arg( AKONADI_VERSION );
+  return QString( "%1, Kolab resource" ).arg( LIBKOLAB_LIB_VERSION_STRING );
 }
 
 // Unhandled KCalCore::Incidence fields:
diff --git a/kolabformatV2/journal.cpp b/kolabformatV2/journal.cpp
index 471b05f..3de3160 100644
--- a/kolabformatV2/journal.cpp
+++ b/kolabformatV2/journal.cpp
@@ -32,7 +32,7 @@
 */
 
 #include "journal.h"
-#include "akonadi-version.h"
+#include "libkolab-version.h"
 
 #include <kdebug.h>
 
@@ -180,5 +180,5 @@ void Journal::setFields( const KCalCore::Journal::Ptr &journal )
 
 QString Journal::productID() const
 {
-  return QString( "Akonadi " ) + AKONADI_VERSION + ", Kolab resource";
+  return QString( "Akonadi " ) + LIBKOLAB_LIB_VERSION_STRING + ", Kolab resource";
 }
diff --git a/kolabformatV2/note.cpp b/kolabformatV2/note.cpp
index 419fa5c..612a1a8 100644
--- a/kolabformatV2/note.cpp
+++ b/kolabformatV2/note.cpp
@@ -32,7 +32,7 @@
 */
 
 #include "note.h"
-#include "akonadi-version.h"
+#include "libkolab-version.h"
 
 #include <kcalcore/journal.h>
 #include <kdebug.h>
@@ -226,5 +226,5 @@ void Note::saveTo( const KCalCore::Journal::Ptr &journal )
 
 QString Note::productID() const
 {
-  return QString( "KNotes %1, Kolab resource" ).arg( AKONADI_VERSION );
+  return QString( "KNotes %1, Kolab resource" ).arg( LIBKOLAB_LIB_VERSION_STRING );
 }
diff --git a/tests/formattest.cpp b/tests/formattest.cpp
index a85b35b..013f232 100644
--- a/tests/formattest.cpp
+++ b/tests/formattest.cpp
@@ -79,7 +79,7 @@ static bool LexicographicalCompare( const T &_x, const T &_y )
     return op( x.toString(), y.toString() );
 }
 
-static bool normalizePhoneNumbers( KABC::Addressee &addressee, const KABC::Addressee &refAddressee )
+static bool normalizePhoneNumbers( KABC::Addressee &addressee, KABC::Addressee &refAddressee )
 {
     KABC::PhoneNumber::List phoneNumbers = addressee.phoneNumbers();
     KABC::PhoneNumber::List refPhoneNumbers = refAddressee.phoneNumbers();
@@ -95,6 +95,9 @@ static bool normalizePhoneNumbers( KABC::Addressee &addressee, const KABC::Addre
         addressee.removePhoneNumber( phoneNumber );
         phoneNumber.setId( refPhoneNumber.id() );
         addressee.insertPhoneNumber( phoneNumber );
+        //Make sure that both have the same sorted order
+        refAddressee.removePhoneNumber( refPhoneNumber );
+        refAddressee.insertPhoneNumber( refPhoneNumber );
     }
     
     return true;
@@ -122,7 +125,7 @@ static bool normalizeAddresses( KABC::Addressee &addressee, const KABC::Addresse
 }
 
 
-void createIndidenceTestSet()
+void FormatTest::testIncidence_data()
 {
     QTest::addColumn<Kolab::Version>( "version" );
     QTest::addColumn<Kolab::ObjectType>( "type" );
@@ -130,25 +133,18 @@ void createIndidenceTestSet()
     QTest::addColumn<QString>( "mimeFileName" );
     
     
-//     QTest::newRow( "v2eventSimple" ) << Kolab::KolabV2 << Kolab::EventObject << TESTFILEDIR+QString::fromLatin1("v2/event/simple.ics") << TESTFILEDIR+QString::fromLatin1("v2/event/simple.ics.mime");
-//     QTest::newRow( "v2eventComplex" ) << Kolab::KolabV2 << Kolab::EventObject << TESTFILEDIR+QString::fromLatin1("v2/event/complex.ics") << TESTFILEDIR+QString::fromLatin1("v2/event/complex.ics.mime");
-//     QTest::newRow( "v2eventAttachment" ) << Kolab::KolabV2 << Kolab::EventObject << TESTFILEDIR+QString::fromLatin1("v2/event/attachment.ics") << TESTFILEDIR+QString::fromLatin1("v2/event/attachment.ics.mime");
-//     QTest::newRow( "v2eventAllday" ) << Kolab::KolabV2 << Kolab::EventObject << TESTFILEDIR+QString::fromLatin1("v2/event/allday.ics") << TESTFILEDIR+QString::fromLatin1("v2/event/allday.ics.mime");
-//     QTest::newRow( "v2eventHorde" ) << Kolab::KolabV2 << Kolab::EventObject << TESTFILEDIR+QString::fromLatin1("v2/event/horde.ics") << TESTFILEDIR+QString::fromLatin1("v2/event/horde.ics.mime");
-//     QTest::newRow( "v2todoComplex" ) << Kolab::KolabV2 << Kolab::TodoObject << TESTFILEDIR+QString::fromLatin1("v2/task/complex.ics") << TESTFILEDIR+QString::fromLatin1("v2/task/complex.ics.mime");
-//     QTest::newRow( "v2todoPrio1" ) << Kolab::KolabV2 << Kolab::TodoObject << TESTFILEDIR+QString::fromLatin1("v2/task/prioritytest1.ics") << TESTFILEDIR+QString::fromLatin1("v2/task/prioritytest1.ics.mime");
-//     QTest::newRow( "v2todoPrio2" ) << Kolab::KolabV2 << Kolab::TodoObject << TESTFILEDIR+QString::fromLatin1("v2/task/prioritytest2.ics") << TESTFILEDIR+QString::fromLatin1("v2/task/prioritytest2.ics.mime");
-//     QTest::newRow( "v2journalComplex" ) << Kolab::KolabV2 << Kolab::JournalObject << TESTFILEDIR+QString::fromLatin1("v2/journal/complex.ics") << TESTFILEDIR+QString::fromLatin1("v2/journal/complex.ics.mime");
-//     
+    //     QTest::newRow( "v2eventSimple" ) << Kolab::KolabV2 << Kolab::EventObject << TESTFILEDIR+QString::fromLatin1("v2/event/simple.ics") << TESTFILEDIR+QString::fromLatin1("v2/event/simple.ics.mime");
+    //     QTest::newRow( "v2eventComplex" ) << Kolab::KolabV2 << Kolab::EventObject << TESTFILEDIR+QString::fromLatin1("v2/event/complex.ics") << TESTFILEDIR+QString::fromLatin1("v2/event/complex.ics.mime");
+    //     QTest::newRow( "v2eventAttachment" ) << Kolab::KolabV2 << Kolab::EventObject << TESTFILEDIR+QString::fromLatin1("v2/event/attachment.ics") << TESTFILEDIR+QString::fromLatin1("v2/event/attachment.ics.mime");
+    //     QTest::newRow( "v2eventAllday" ) << Kolab::KolabV2 << Kolab::EventObject << TESTFILEDIR+QString::fromLatin1("v2/event/allday.ics") << TESTFILEDIR+QString::fromLatin1("v2/event/allday.ics.mime");
+    //     QTest::newRow( "v2eventHorde" ) << Kolab::KolabV2 << Kolab::EventObject << TESTFILEDIR+QString::fromLatin1("v2/event/horde.ics") << TESTFILEDIR+QString::fromLatin1("v2/event/horde.ics.mime");
+    //     QTest::newRow( "v2todoComplex" ) << Kolab::KolabV2 << Kolab::TodoObject << TESTFILEDIR+QString::fromLatin1("v2/task/complex.ics") << TESTFILEDIR+QString::fromLatin1("v2/task/complex.ics.mime");
+    //     QTest::newRow( "v2todoPrio1" ) << Kolab::KolabV2 << Kolab::TodoObject << TESTFILEDIR+QString::fromLatin1("v2/task/prioritytest1.ics") << TESTFILEDIR+QString::fromLatin1("v2/task/prioritytest1.ics.mime");
+    //     QTest::newRow( "v2todoPrio2" ) << Kolab::KolabV2 << Kolab::TodoObject << TESTFILEDIR+QString::fromLatin1("v2/task/prioritytest2.ics") << TESTFILEDIR+QString::fromLatin1("v2/task/prioritytest2.ics.mime");
+    //     QTest::newRow( "v2journalComplex" ) << Kolab::KolabV2 << Kolab::JournalObject << TESTFILEDIR+QString::fromLatin1("v2/journal/complex.ics") << TESTFILEDIR+QString::fromLatin1("v2/journal/complex.ics.mime");
+    //     
     QTest::newRow( "v3eventSimple" ) << Kolab::KolabV3 << Kolab::EventObject << TESTFILEDIR+QString::fromLatin1("v3/event/simple.ics") << TESTFILEDIR+QString::fromLatin1("v3/event/simple.ics.mime");
     QTest::newRow( "v3eventComplex" ) << Kolab::KolabV3 << Kolab::EventObject << TESTFILEDIR+QString::fromLatin1("v3/event/complex.ics") << TESTFILEDIR+QString::fromLatin1("v3/event/complex.ics.mime");
-    
-}
-
-
-void FormatTest::testIncidence_data()
-{
-    createIndidenceTestSet();
 }
 
 
@@ -174,15 +170,11 @@ void FormatTest::testIncidence()
     QFile icalFile( icalFileName );
     QVERIFY( icalFile.open( QFile::ReadOnly ) );
     KCalCore::ICalFormat format;
-    const KCalCore::Incidence::Ptr realIncidence( format.fromString( QString::fromUtf8( icalFile.readAll() ) ) );
+    KCalCore::Incidence::Ptr realIncidence( format.fromString( QString::fromUtf8( icalFile.readAll() ) ) );
         
     // fix up the converted incidence for comparisson
-    foreach ( KCalCore::Attendee::Ptr a, convertedIncidence->attendees() ) {
-        a->setUid( QString() ); // contains random values
-    }
-    foreach ( KCalCore::Attendee::Ptr a, realIncidence->attendees() ) {
-        a->setUid( QString() ); // contains random values
-    }
+    normalizeIncidence(convertedIncidence);
+    normalizeIncidence(realIncidence);
     if ( type == Kolab::TodoObject ) {
         KCalCore::Todo::Ptr todo = realIncidence.dynamicCast<KCalCore::Todo>();
         QVERIFY(todo);
@@ -194,11 +186,13 @@ void FormatTest::testIncidence()
     realIncidence->recurrence();
     convertedIncidence->recurrence();
     
+    realIncidence->setLastModified(convertedIncidence->lastModified());
+    
     //The following test is just for debugging and not really relevant
-//     if ( *(realIncidence.data()) != *(convertedIncidence.data()) ) {
-//         showDiff(format.toString( realIncidence ), format.toString( convertedIncidence ));
-//     }
-//     QVERIFY( *(realIncidence.data()) ==  *(convertedIncidence.data()) );
+    if ( *(realIncidence.data()) != *(convertedIncidence.data()) ) {
+        showDiff(format.toString( realIncidence ), format.toString( convertedIncidence ));
+    }
+    QVERIFY( *(realIncidence.data()) ==  *(convertedIncidence.data()) );
               
     
     //Write
@@ -223,30 +217,25 @@ void FormatTest::testIncidence()
     }
 }
 
-void createContactsTestSet()
+
+void FormatTest::testContact_data()
 {
     QTest::addColumn<Kolab::Version>( "version" );
     QTest::addColumn<Kolab::ObjectType>( "type" );
     QTest::addColumn<QString>( "vcardFileName" );
     QTest::addColumn<QString>( "mimeFileName" );
-
-//     QTest::newRow( "v2contactSimple" ) << Kolab::KolabV2 << Kolab::ContactObject << TESTFILEDIR+QString::fromLatin1("v2/contacts/simple.vcf") << TESTFILEDIR+QString::fromLatin1("v2/contacts/simple.vcf.mime");
-//     QTest::newRow( "v2contactComplex" ) << Kolab::KolabV2 << Kolab::ContactObject << TESTFILEDIR+QString::fromLatin1("v2/contacts/complex.vcf") << TESTFILEDIR+QString::fromLatin1("v2/contacts/complex.vcf.mime");
-//     QTest::newRow( "v2contactAddress" ) << Kolab::KolabV2 << Kolab::ContactObject << TESTFILEDIR+QString::fromLatin1("v2/contacts/address.vcf") << TESTFILEDIR+QString::fromLatin1("v2/contacts/address.vcf.mime");
-//     QTest::newRow( "v2contactBug238996" ) << Kolab::KolabV2 << Kolab::ContactObject << TESTFILEDIR+QString::fromLatin1("v2/contacts/bug238996.vcf") << TESTFILEDIR+QString::fromLatin1("v2/contacts/bug238996.vcf.mime");
-//     QTest::newRow( "v2contactDisplayname" ) << Kolab::KolabV2 << Kolab::ContactObject << TESTFILEDIR+QString::fromLatin1("v2/contacts/displayname.vcf") << TESTFILEDIR+QString::fromLatin1("v2/contacts/displayname.vcf.mime");
-//     QTest::newRow( "v2contactEmails" ) << Kolab::KolabV2 << Kolab::ContactObject << TESTFILEDIR+QString::fromLatin1("v2/contacts/emails.vcf") << TESTFILEDIR+QString::fromLatin1("v2/contacts/emails.vcf.mime");
-//     QTest::newRow( "v2contactPhonenumbers" ) << Kolab::KolabV2 << Kolab::ContactObject << TESTFILEDIR+QString::fromLatin1("v2/contacts/phonenumbers.vcf") << TESTFILEDIR+QString::fromLatin1("v2/contacts/phonenumbers.vcf.mime");
-//     QTest::newRow( "v2contactPicture" ) << Kolab::KolabV2 << Kolab::ContactObject << TESTFILEDIR+QString::fromLatin1("v2/contacts/picture.vcf") << TESTFILEDIR+QString::fromLatin1("v2/contacts/picture.vcf.mime");
+    
+    //     QTest::newRow( "v2contactSimple" ) << Kolab::KolabV2 << Kolab::ContactObject << TESTFILEDIR+QString::fromLatin1("v2/contacts/simple.vcf") << TESTFILEDIR+QString::fromLatin1("v2/contacts/simple.vcf.mime");
+    //     QTest::newRow( "v2contactComplex" ) << Kolab::KolabV2 << Kolab::ContactObject << TESTFILEDIR+QString::fromLatin1("v2/contacts/complex.vcf") << TESTFILEDIR+QString::fromLatin1("v2/contacts/complex.vcf.mime");
+    //     QTest::newRow( "v2contactAddress" ) << Kolab::KolabV2 << Kolab::ContactObject << TESTFILEDIR+QString::fromLatin1("v2/contacts/address.vcf") << TESTFILEDIR+QString::fromLatin1("v2/contacts/address.vcf.mime");
+    //     QTest::newRow( "v2contactBug238996" ) << Kolab::KolabV2 << Kolab::ContactObject << TESTFILEDIR+QString::fromLatin1("v2/contacts/bug238996.vcf") << TESTFILEDIR+QString::fromLatin1("v2/contacts/bug238996.vcf.mime");
+    //     QTest::newRow( "v2contactDisplayname" ) << Kolab::KolabV2 << Kolab::ContactObject << TESTFILEDIR+QString::fromLatin1("v2/contacts/displayname.vcf") << TESTFILEDIR+QString::fromLatin1("v2/contacts/displayname.vcf.mime");
+    //     QTest::newRow( "v2contactEmails" ) << Kolab::KolabV2 << Kolab::ContactObject << TESTFILEDIR+QString::fromLatin1("v2/contacts/emails.vcf") << TESTFILEDIR+QString::fromLatin1("v2/contacts/emails.vcf.mime");
+    //     QTest::newRow( "v2contactPhonenumbers" ) << Kolab::KolabV2 << Kolab::ContactObject << TESTFILEDIR+QString::fromLatin1("v2/contacts/phonenumbers.vcf") << TESTFILEDIR+QString::fromLatin1("v2/contacts/phonenumbers.vcf.mime");
+    //     QTest::newRow( "v2contactPicture" ) << Kolab::KolabV2 << Kolab::ContactObject << TESTFILEDIR+QString::fromLatin1("v2/contacts/picture.vcf") << TESTFILEDIR+QString::fromLatin1("v2/contacts/picture.vcf.mime");
     
     QTest::newRow( "v3contactSimple" ) << Kolab::KolabV3 << Kolab::ContactObject << TESTFILEDIR+QString::fromLatin1("v3/contacts/simple.vcf") << TESTFILEDIR+QString::fromLatin1("v3/contacts/simple.vcf.mime");
     QTest::newRow( "v3contactComplex" ) << Kolab::KolabV3 << Kolab::ContactObject << TESTFILEDIR+QString::fromLatin1("v3/contacts/complex.vcf") << TESTFILEDIR+QString::fromLatin1("v3/contacts/complex.vcf.mime");
-    
-}
-
-void FormatTest::testContact_data()
-{
-    createContactsTestSet();
 }
 
 void FormatTest::testContact()
@@ -274,13 +263,16 @@ void FormatTest::testContact()
     QFile vcardFile( vcardFileName );
     QVERIFY( vcardFile.open( QFile::ReadOnly ) );
     KABC::VCardConverter converter;
-    const KABC::Addressee realAddressee = converter.parseVCard( vcardFile.readAll() );
+    KABC::Addressee realAddressee = converter.parseVCard( vcardFile.readAll() );
 
     // fix up the converted addressee for comparisson
     convertedAddressee.setName( realAddressee.name() ); // name() apparently is something strange
     if (version == Kolab::KolabV2) { //No creation date in xcal
         QVERIFY( !convertedAddressee.custom( "KOLAB", "CreationDate" ).isEmpty() );
         convertedAddressee.removeCustom( "KOLAB", "CreationDate" ); // that's conversion time !?
+    } else {
+        normalizeContact(convertedAddressee);
+        normalizeContact(realAddressee);
     }
     QVERIFY( normalizePhoneNumbers( convertedAddressee, realAddressee ) ); // phone number ids are random
     QVERIFY( normalizeAddresses( convertedAddressee, realAddressee ) ); // same here
@@ -289,7 +281,7 @@ void FormatTest::testContact()
         showDiff(realAddressee.toString(), convertedAddressee.toString());
     }
     QCOMPARE( realAddressee, convertedAddressee );
-    
+
     //Write
     const KMime::Message::Ptr &convertedMime = Kolab::KolabObjectWriter::writeContact(realAddressee, version);
     
@@ -303,15 +295,15 @@ void FormatTest::testContact()
 //This function exists only to generate the reference files, it's not a real test.
 void FormatTest::generateMimefile()
 {
-    QFile icalFile( TESTFILEDIR+QString::fromLatin1("v3/event/complex.ics") );
-    QVERIFY( icalFile.open( QFile::ReadOnly ) );
-    KCalCore::ICalFormat format;
-    const KCalCore::Incidence::Ptr realIncidence( format.fromString( QString::fromUtf8( icalFile.readAll() ) ) );
-    
-    QString result;
-    QTextStream s(&result);
-    Kolab::overrideTimestamp(Kolab::cDateTime(2012, 5, 5, 5,5,5, true));
-    Kolab::KolabObjectWriter::writeEvent(realIncidence.dynamicCast<KCalCore::Event>(), Kolab::KolabV3)->toStream(s);
+//     QFile icalFile( TESTFILEDIR+QString::fromLatin1("v3/event/complex.ics") );
+//     QVERIFY( icalFile.open( QFile::ReadOnly ) );
+//     KCalCore::ICalFormat format;
+//     const KCalCore::Incidence::Ptr realIncidence( format.fromString( QString::fromUtf8( icalFile.readAll() ) ) );
+//     
+//     QString result;
+//     QTextStream s(&result);
+//     Kolab::overrideTimestamp(Kolab::cDateTime(2012, 5, 5, 5,5,5, true));
+//     Kolab::KolabObjectWriter::writeEvent(realIncidence.dynamicCast<KCalCore::Event>(), Kolab::KolabV3)->toStream(s);
     
     
 //     QFile vcardFile( TESTFILEDIR+QString::fromLatin1("v3/contacts/complex.vcf") );
@@ -327,7 +319,7 @@ void FormatTest::generateMimefile()
 //     Kolab::KolabObjectWriter::writeContact(realAddressee, Kolab::KolabV3)->toStream(s);
     
     
-    kDebug() << result;
+//     kDebug() << result;
 }
 
 QTEST_MAIN( FormatTest )
diff --git a/tests/formattest.h b/tests/formattest.h
index 8313ad1..1180532 100644
--- a/tests/formattest.h
+++ b/tests/formattest.h
@@ -31,11 +31,21 @@
  * The mime files are of course just a snapshot of how it is thought that the result should be. 
  * The files may have bugs themselves and will need to be updated to reflect future changes.
  * 
- * TODO: v2 test fail currently due to the last-modified-date (xml-file text comparsion fails)
+ * TODO: v2 test fail currently due to the last-modified-date (and some others such as product id) (xml-file text comparsion fails)
  * 
  * kompare (the kde diff tool) is launched if a test fails to show you the difference between expected and actual conversion.
  * Comment the code if you don't want it.
  * 
+ * Note that some parts of the mime message are not compared, but show up in kompare as difference:
+ * * Date-Header
+ * * Content-Type-Header
+ * * next-part markers
+ * * Content-ID Header
+ * 
+ * These are safe to be ignored as they are randomly generated.
+ * 
+ * FIXME: a referenced content using cid (inside the xml) should also be ignored, this leads currently to an error.
+ * 
  */
 class FormatTest: public QObject
 {
diff --git a/tests/testfiles/v2/contacts/complex.vcf.mime b/tests/testfiles/v2/contacts/complex.vcf.mime
index 09af84a..c9ad047 100644
--- a/tests/testfiles/v2/contacts/complex.vcf.mime
+++ b/tests/testfiles/v2/contacts/complex.vcf.mime
@@ -14,7 +14,7 @@ Content-Transfer-Encoding: 7Bit
 This is a Kolab Groupware object.
 To view this object you will need an email client that can understand the Kolab Groupware format.
 For a list of such email clients please visit                                                    
-http://www.kolab.org/kolab2-clients.html                                                         
+http://www.kolab.org/get-kolab                                                         
 
 --nextPart3762459.HDmZFN3AqE
 Content-Type: application/x-vnd.kolab.contact; name="kolab.xml"
diff --git a/tests/testfiles/v2/contacts/simple.vcf.mime b/tests/testfiles/v2/contacts/simple.vcf.mime
index 130fbd7..e3a6267 100644
--- a/tests/testfiles/v2/contacts/simple.vcf.mime
+++ b/tests/testfiles/v2/contacts/simple.vcf.mime
@@ -14,7 +14,7 @@ Content-Transfer-Encoding: 7Bit
 This is a Kolab Groupware object.
 To view this object you will need an email client that can understand the Kolab Groupware format.
 For a list of such email clients please visit
-http://www.kolab.org/kolab2-clients.html
+http://www.kolab.org/get-kolab
 
 --nextPart8293045.ykzvriC3IH
 Content-Type: application/x-vnd.kolab.contact; name="kolab.xml"
diff --git a/tests/testfiles/v2/event/allday.ics.mime b/tests/testfiles/v2/event/allday.ics.mime
index 76c5099..06f322a 100644
--- a/tests/testfiles/v2/event/allday.ics.mime
+++ b/tests/testfiles/v2/event/allday.ics.mime
@@ -13,7 +13,7 @@ Content-Transfer-Encoding: 7Bit
 This is a Kolab Groupware object.
 To view this object you will need an email client that can understand the Kolab Groupware format.
 For a list of such email clients please visit
-http://www.kolab.org/kolab2-clients.html
+http://www.kolab.org/get-kolab
 
 --nextPart2050770.69HWcxcYtE
 Content-Type: application/x-vnd.kolab.event; name="kolab.xml"
@@ -22,10 +22,10 @@ Content-Disposition: attachment; filename="kolab.xml"
 
 <?xml version=3D"1.0" encoding=3D"UTF-8"?>
 <event version=3D"1.0" >
- <product-id>Akonadi 1.2.61, Kolab resource</product-id>
+ <product-id>Libkolab-0.1.0, Kolab resource</product-id>
  <uid>KOrganizer-1256760206.500</uid>
  <creation-date>2009-09-01T13:15:14Z</creation-date>
- <last-modification-date>2009-09-01T13:15:14+00:00</last-modification-d=
+ <last-modification-date>2009-09-01T13:15:14Z</last-modification-d=
 ate>
  <sensitivity>public</sensitivity>
  <start-date>2009-09-02</start-date>
diff --git a/tests/testfiles/v2/event/attachment.ics.mime b/tests/testfiles/v2/event/attachment.ics.mime
index 1266fb9..af4ba4a 100644
--- a/tests/testfiles/v2/event/attachment.ics.mime
+++ b/tests/testfiles/v2/event/attachment.ics.mime
@@ -13,7 +13,7 @@ Content-Transfer-Encoding: 7Bit
 This is a Kolab Groupware object.
 To view this object you will need an email client that can understand the Kolab Groupware format.
 For a list of such email clients please visit
-http://www.kolab.org/kolab2-clients.html
+http://www.kolab.org/get-kolab
 
 --nextPart3083467.JSZapPgxdJ
 Content-Type: application/x-vnd.kolab.event; name="kolab.xml"
@@ -22,10 +22,10 @@ Content-Disposition: attachment; filename="kolab.xml"
 
 <?xml version=3D"1.0" encoding=3D"UTF-8"?>
 <event version=3D"1.0" >
- <product-id>Akonadi 1.2.61, Kolab resource</product-id>
+ <product-id>Libkolab-0.1.0, Kolab resource</product-id>
  <uid>KOrganizer-1181687251.384</uid>
  <creation-date>2009-09-01T12:58:43Z</creation-date>
- <last-modification-date>2009-09-01T12:58:43+00:00</last-modification-d=
+ <last-modification-date>2009-09-01T12:58:43Z</last-modification-d=
 ate>
  <sensitivity>public</sensitivity>
  <start-date>2009-09-02T10:00:00Z</start-date>
diff --git a/tests/testfiles/v2/event/complex.ics.mime b/tests/testfiles/v2/event/complex.ics.mime
index 21be329..8321927 100644
--- a/tests/testfiles/v2/event/complex.ics.mime
+++ b/tests/testfiles/v2/event/complex.ics.mime
@@ -13,7 +13,7 @@ Content-Transfer-Encoding: 7Bit
 This is a Kolab Groupware object.
 To view this object you will need an email client that can understand the Kolab Groupware format.
 For a list of such email clients please visit                                                    
-http://www.kolab.org/kolab2-clients.html                                                         
+http://www.kolab.org/get-kolab                                                         
 
 --nextPart1532650.N5Q3PfLWqK
 Content-Type: application/x-vnd.kolab.event; name="kolab.xml"
@@ -22,12 +22,12 @@ Content-Disposition: attachment; filename="kolab.xml"
 
 <?xml version=3D"1.0" encoding=3D"UTF-8"?>
 <event version=3D"1.0" >                  
- <product-id>Akonadi 1.2.61, Kolab resource</product-id>
+ <product-id>Libkolab-0.1.0, Kolab resource</product-id>
  <uid>KOrganizer-1687167952.818</uid>                   
  <body>Some notes on this event.</body>                 
  <categories>Appointment,Business</categories>          
  <creation-date>2009-09-01T12:52:58Z</creation-date>    
- <last-modification-date>2009-09-01T12:52:58+00:00</last-modification-d=
+ <last-modification-date>2009-09-01T12:52:58Z</last-modification-d=
 ate>                                                                    
  <sensitivity>private</sensitivity>                                     
  <start-date>2009-09-02T08:00:00Z</start-date>                          
diff --git a/tests/testfiles/v2/event/horde.ics.mime b/tests/testfiles/v2/event/horde.ics.mime
index 58ea5b2..0a48df9 100644
--- a/tests/testfiles/v2/event/horde.ics.mime
+++ b/tests/testfiles/v2/event/horde.ics.mime
@@ -16,7 +16,7 @@ Content-Transfer-Encoding: quoted-printable
 
 This is a Kolab Groupware object. To view this object you will need an email
 client that understands the Kolab Groupware format. For a list of such email
-clients please visit http://www.kolab.org/kolab2-clients.html
+clients please visit http://www.kolab.org/get-kolab
 --=_ncb7q5bbyhm
 Content-Type: application/x-vnd.kolab.event; name="kolab.xml"
 Content-Disposition: attachment; filename="kolab.xml"
diff --git a/tests/testfiles/v2/event/simple.ics.mime b/tests/testfiles/v2/event/simple.ics.mime
index b0a68f4..22620eb 100644
--- a/tests/testfiles/v2/event/simple.ics.mime
+++ b/tests/testfiles/v2/event/simple.ics.mime
@@ -13,7 +13,7 @@ Content-Transfer-Encoding: 7Bit
 This is a Kolab Groupware object.
 To view this object you will need an email client that can understand the Kolab Groupware format.
 For a list of such email clients please visit
-http://www.kolab.org/kolab2-clients.html
+http://www.kolab.org/get-kolab
 
 --nextPart3915010.RBqxP67orN
 Content-Type: application/x-vnd.kolab.event; name="kolab.xml"
@@ -21,12 +21,11 @@ Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment; filename="kolab.xml"
 
 <?xml version=3D"1.0" encoding=3D"UTF-8"?>
-<event version=3D"1.0" >
- <product-id>Akonadi 1.2.61, Kolab resource</product-id>
+<event version=3D"1.0">
+ <product-id>Libkolab-0.1.0, Kolab resource</product-id>
  <uid>KOrganizer-1353608432.168</uid>
  <creation-date>2009-09-01T11:36:44Z</creation-date>
- <last-modification-date>2009-09-01T11:36:44+00:00</last-modification-d=
-ate>
+ <last-modification-date>2009-09-01T11:36:44Z</last-modification-date>
  <sensitivity>public</sensitivity>
  <start-date>2009-09-02T06:00:00Z</start-date>
  <summary>Simple Event</summary>
diff --git a/tests/testfiles/v3/contacts/simple.vcf.mime b/tests/testfiles/v3/contacts/simple.vcf.mime
index b297ae2..edc86a5 100644
--- a/tests/testfiles/v3/contacts/simple.vcf.mime
+++ b/tests/testfiles/v3/contacts/simple.vcf.mime
@@ -1,23 +1,23 @@
-Date: Fri, 30 Mar 2012 15:51:29 +0200
+Date: Mon, 23 Apr 2012 12:46:37 +0200
 X-Kolab-Type: application/x-vnd.kolab.contact
 X-Kolab-Version: v3
-User-Agent: Akonadi Kolab Proxy Resource
-Content-Type: multipart/mixed; boundary="nextPart1564121.3EOzHLFOl8"
+User-Agent: Libkolab-0.1.0
+Content-Type: multipart/mixed; boundary="nextPart1365947.WmFcbPlLFA"
 Subject: 4xuyC0cyjV
 From: Volker Krause <vkrause at kde.org>
 MIME-Version: 1.0
 
 
---nextPart1564121.3EOzHLFOl8
+--nextPart1365947.WmFcbPlLFA
 Content-Type: text/plain; charset="us-ascii"
 Content-Transfer-Encoding: 7Bit
 
 This is a Kolab Groupware object.
 To view this object you will need an email client that can understand the Kolab Groupware format.
 For a list of such email clients please visit
-http://www.kolab.org/kolab2-clients.html
+http://www.kolab.org/get-kolab
 
---nextPart1564121.3EOzHLFOl8
+--nextPart1365947.WmFcbPlLFA
 Content-Type: application/vcard+xml; name="kolab.xml"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment; filename="kolab.xml"
@@ -33,7 +33,7 @@ Content-Disposition: attachment; filename="kolab.xml"
       <text>3.0dev1</text>
     </x-kolab-version>
     <prodid>
-      <text>libkolabxml-0.2.0</text>
+      <text>Libkolab-0.1.0 Libkolabxml-0.3.0</text>
     </prodid>
     <rev>
       <timestamp>20120505T050505Z</timestamp>
@@ -63,4 +63,4 @@ Content-Disposition: attachment; filename="kolab.xml"
 
 </vcards>
 
---nextPart1564121.3EOzHLFOl8--
\ No newline at end of file
+--nextPart1365947.WmFcbPlLFA--
\ No newline at end of file
diff --git a/tests/testfiles/v3/event/complex.ics.mime b/tests/testfiles/v3/event/complex.ics.mime
index 14f2b13..2a89cb3 100644
--- a/tests/testfiles/v3/event/complex.ics.mime
+++ b/tests/testfiles/v3/event/complex.ics.mime
@@ -1,22 +1,22 @@
-Date: Wed, 04 Apr 2012 13:20:24 +0200
+Date: Mon, 23 Apr 2012 12:37:59 +0200
 X-Kolab-Type: application/x-vnd.kolab.event
 X-Kolab-Version: v3
-User-Agent: Akonadi Kolab Proxy Resource
-Content-Type: multipart/mixed; boundary="nextPart21511161.J1Pqs0mEBB"
+User-Agent: Libkolab-0.1.0
+Content-Type: multipart/mixed; boundary="nextPart1929983.SbWkbbbi0G"
 Subject: KOrganizer-1687167952.818
 MIME-Version: 1.0
 
 
---nextPart21511161.J1Pqs0mEBB
+--nextPart1929983.SbWkbbbi0G
 Content-Type: text/plain; charset="us-ascii"
 Content-Transfer-Encoding: 7Bit
 
 This is a Kolab Groupware object.
 To view this object you will need an email client that can understand the Kolab Groupware format.
 For a list of such email clients please visit
-http://www.kolab.org/kolab2-clients.html
+http://www.kolab.org/get-kolab
 
---nextPart21511161.J1Pqs0mEBB
+--nextPart1929983.SbWkbbbi0G
 Content-Type: application/calendar+xml; name="kolab.xml"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment; filename="kolab.xml"
@@ -27,7 +27,7 @@ Content-Disposition: attachment; filename="kolab.xml"
   <vcalendar>
     <properties>
       <prodid>
-        <text>libkolabxml-0.2.0</text>
+        <text>Libkolab-0.1.0 Libkolabxml-0.3.0</text>
       </prodid>
       <version>
         <text>2.0</text>
@@ -154,7 +154,7 @@ Content-Disposition: attachment; filename="kolab.xml"
                 <text>akonadi.png</text>
               </x-label>
             </parameters>
-            <uri>cid:3239220.4xKdUVi0xg at kolab.resource.akonadi</uri>
+            <uri>cid:7313173.zaagFSsPPv at kolab.resource.akonadi</uri>
           </attach>
         </properties>
         <components>
@@ -189,8 +189,8 @@ Content-Disposition: attachment; filename="kolab.xml"
 
 </icalendar>
 
---nextPart21511161.J1Pqs0mEBB
-Content-ID: <3239220.4xKdUVi0xg at kolab.resource.akonadi>
+--nextPart1929983.SbWkbbbi0G
+Content-ID: <7313173.zaagFSsPPv at kolab.resource.akonadi>
 Content-Type: image/png; name="akonadi.png"
 Content-Transfer-Encoding: base64
 Content-Disposition: attachment; filename="akonadi.png"
@@ -213,4 +213,4 @@ SbQ+O65+euqEszo4UPytWMhvCwBUkSqq1jk356xNDUevLK/sPbl+L7jQ8ZLyUaepGE1xMDZhfDlb
 KSwPFt1tXcp9qWk1VWjhP2e6dneLvhdqLc/L7B3UzfX1qttsdfKKguo4ZlguO36xWAgLth3mbSsy
 TatnyFz6B+BnWV0A/UiAAAAAAElFTkSuQmCC
 
---nextPart21511161.J1Pqs0mEBB--
\ No newline at end of file
+--nextPart1929983.SbWkbbbi0G--
\ No newline at end of file
diff --git a/tests/testfiles/v3/event/simple.ics.mime b/tests/testfiles/v3/event/simple.ics.mime
index e4b8e49..2c7a50d 100644
--- a/tests/testfiles/v3/event/simple.ics.mime
+++ b/tests/testfiles/v3/event/simple.ics.mime
@@ -1,86 +1,86 @@
-Date: Fri, 30 Mar 2012 12:26:46 +0200
+Date: Mon, 23 Apr 2012 12:33:34 +0200
 X-Kolab-Type: application/x-vnd.kolab.event
 X-Kolab-Version: v3
-User-Agent: Akonadi Kolab Proxy Resource
-Content-Type: multipart/mixed; boundary="nextPart1399434.G4AVyt0pMb"
+User-Agent: Libkolab-0.1.0
+Content-Type: multipart/mixed; boundary="nextPart1440420.ZGVZUGuhry"
 Subject: KOrganizer-1353608432.168
 MIME-Version: 1.0
 
 
---nextPart1399434.G4AVyt0pMb
+--nextPart1440420.ZGVZUGuhry
 Content-Type: text/plain; charset="us-ascii"
 Content-Transfer-Encoding: 7Bit
 
 This is a Kolab Groupware object.
 To view this object you will need an email client that can understand the Kolab Groupware format.
 For a list of such email clients please visit
-http://www.kolab.org/kolab2-clients.html
+http://www.kolab.org/get-kolab
 
---nextPart1399434.G4AVyt0pMb
+--nextPart1440420.ZGVZUGuhry
 Content-Type: application/calendar+xml; name="kolab.xml"
 Content-Transfer-Encoding: quoted-printable
 Content-Disposition: attachment; filename="kolab.xml"
 
 <?xml version=3D"1.0" encoding=3D"UTF-8" standalone=3D"no" ?>
 <icalendar xmlns=3D"urn:ietf:params:xml:ns:icalendar-2.0">
-    
-    <vcalendar>
+
+  <vcalendar>
+    <properties>
+      <prodid>
+        <text>Libkolab-0.1.0 Libkolabxml-0.3.0</text>
+      </prodid>
+      <version>
+        <text>2.0</text>
+      </version>
+      <x-kolab-version>
+        <text>3.0dev1</text>
+      </x-kolab-version>
+    </properties>
+    <components>
+      <vevent>
         <properties>
-            <prodid>
-                <text>libkolabxml-0.2.0</text>
-            </prodid>
-            <version>
-                <text>2.0</text>
-            </version>
-            <x-kolab-version>
-                <text>3.0dev1</text>
-            </x-kolab-version>
+          <uid>
+            <text>KOrganizer-1353608432.168</text>
+          </uid>
+          <created>
+            <date-time>2009-09-01T11:36:44Z</date-time>
+          </created>
+          <dtstamp>
+            <date-time>2012-05-05T05:05:05Z</date-time>
+          </dtstamp>
+          <sequence>
+            <integer>0</integer>
+          </sequence>
+          <class>
+            <text>PUBLIC</text>
+          </class>
+          <dtstart>
+            <parameters>
+              <tzid>
+                <text>/kolab.org/Europe/Berlin</text>
+              </tzid>
+            </parameters>
+            <date-time>2009-09-02T08:00:00</date-time>
+          </dtstart>
+          <dtend>
+            <parameters>
+              <tzid>
+                <text>/kolab.org/Europe/Berlin</text>
+              </tzid>
+            </parameters>
+            <date-time>2009-09-02T09:00:00</date-time>
+          </dtend>
+          <summary>
+            <text>Simple Event</text>
+          </summary>
+          <location>
+            <text>Here</text>
+          </location>
         </properties>
-        <components>
-            <vevent>
-                <properties>
-                    <uid>
-                        <text>KOrganizer-1353608432.168</text>
-                    </uid>
-                    <created>
-                        <date-time>2009-09-01T11:36:44Z</date-time>
-                    </created>
-                    <dtstamp>
-                        <date-time>2012-05-05T05:05:05Z</date-time>
-                    </dtstamp>
-                    <sequence>
-                        <integer>0</integer>
-                    </sequence>
-                    <class>
-                        <text>PUBLIC</text>
-                    </class>
-                    <dtstart>
-                        <parameters>
-                            <tzid>
-                                <text>/kolab.org/Europe/Berlin</text>
-                            </tzid>
-                        </parameters>
-                        <date-time>2009-09-02T08:00:00</date-time>
-                    </dtstart>
-                    <dtend>
-                        <parameters>
-                            <tzid>
-                                <text>/kolab.org/Europe/Berlin</text>
-                            </tzid>
-                        </parameters>
-                        <date-time>2009-09-02T09:00:00</date-time>
-                    </dtend>
-                    <summary>
-                        <text>Simple Event</text>
-                    </summary>
-                    <location>
-                        <text>Here</text>
-                    </location>
-                </properties>
-            </vevent>
-        </components>
-    </vcalendar>
-    
+      </vevent>
+    </components>
+  </vcalendar>
+
 </icalendar>
 
---nextPart1399434.G4AVyt0pMb--
\ No newline at end of file
+--nextPart1440420.ZGVZUGuhry--
\ No newline at end of file
diff --git a/tests/testutils.h b/tests/testutils.h
index 9979bdb..71c0de4 100644
--- a/tests/testutils.h
+++ b/tests/testutils.h
@@ -74,10 +74,7 @@ static KMime::Message::Ptr readMimeFile( const QString &fileName, bool &ok)
 
 //Normalize incidences for comparison
 static void normalizeIncidence( KCalCore::Incidence::Ptr incidence)
-{
-    //We have to override the last modified time with a specific value, so we normalize the input to the same
-    incidence->setLastModified(KDateTime(QDate(2012,5,5),QTime(5,5,5),KDateTime::Spec::UTC()));
-    
+{   
     //The UID is not persistent (it's just the internal pointer), therefore we clear it
     //TODO make sure that the UID does really not need to be persistent
     foreach(KCalCore::Attendee::Ptr attendee, incidence->attendees()) {
@@ -85,6 +82,21 @@ static void normalizeIncidence( KCalCore::Incidence::Ptr incidence)
     }
 }
 
+void normalizeContact(KABC::Addressee &addressee)
+{
+    KABC::Address::List addresses = addressee.addresses();
+    
+    foreach(KABC::Address a, addresses) {
+        addressee.removeAddress(a);
+        a.setPostOfficeBox(QString()); //Not supported anymore
+        addressee.insertAddress(a);
+    }
+    addressee.setSound(KABC::Sound()); //Sound is not supported
+    
+    addressee.removeCustom("KOLAB", "CreationDate"); //The creation date is no longer existing
+    
+}
+
 #define KCOMPARE(actual, expected) \
 do {\
     if ( !(actual == expected) ) { \
diff --git a/tests/upgradetest.cpp b/tests/upgradetest.cpp
index 407e9bd..7e25642 100644
--- a/tests/upgradetest.cpp
+++ b/tests/upgradetest.cpp
@@ -90,6 +90,8 @@ void UpgradeTest::testIncidence()
     KCalCore::Incidence::Ptr v3result = reader2.getIncidence();
     QVERIFY(!v3result.isNull());
     normalizeIncidence(v2result);
+    //We have to override the last modified time with a specific value, so we normalize the input to the same
+    v2result->setLastModified(KDateTime(QDate(2012,5,5),QTime(5,5,5),KDateTime::Spec::UTC()));
     normalizeIncidence(v3result);
     kDebug() <<"--------------------------------------------------------";
     KCalCore::ICalFormat format;
@@ -125,20 +127,6 @@ void UpgradeTest::testContact_data()
     
 }
 
-void normalizeContact(KABC::Addressee &addressee)
-{
-    KABC::Address::List addresses = addressee.addresses();
-    
-    foreach(KABC::Address a, addresses) {
-        addressee.removeAddress(a);
-        a.setPostOfficeBox(QString()); //Not supported anymore
-        addressee.insertAddress(a);
-    }
-    addressee.setSound(KABC::Sound()); //Sound is not supported
-    
-    addressee.removeCustom("KOLAB", "CreationDate"); //The creation date is no longer existing
-    
-}
 
 void UpgradeTest::testContact()
 {


commit 888d0be18ccca4a4230c41dd1153a4dc5e599f85
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Mon Apr 23 12:19:49 2012 +0200

    Set the product id string.

diff --git a/kolabformat/kolabobject.cpp b/kolabformat/kolabobject.cpp
index 821be22..673b462 100644
--- a/kolabformat/kolabobject.cpp
+++ b/kolabformat/kolabobject.cpp
@@ -20,6 +20,8 @@
 #include "v2helpers.h"
 #include "kolabdefinitions.h"
 #include "errorhandler.h"
+#include "libkolab-version.h"
+
 #include <kolabbase.h>
 #include <kolabformatV2/journal.h>
 #include <kolabformatV2/task.h>
@@ -271,88 +273,96 @@ KCalCore::Incidence::Ptr normalizeIncidence(KCalCore::Incidence::Ptr original)
     return i;
 }
 
-KMime::Message::Ptr KolabObjectWriter::writeEvent(const KCalCore::Event::Ptr &i, Version v, const QString &tz)
+QString getProductId(const QString &pId)
+{
+    if (pId.isEmpty()) {
+        return LIBKOLAB_LIB_VERSION_STRING;
+    }
+    return pId+" "+LIBKOLAB_LIB_VERSION_STRING;
+}
+
+KMime::Message::Ptr KolabObjectWriter::writeEvent(const KCalCore::Event::Ptr &i, Version v, const QString &productId, const QString &tz)
 {
     ErrorHandler::clearErrors();
     Q_ASSERT(!i.isNull());
     if (v == KolabV3) {
         KCalCore::Event::Ptr ic = normalizeIncidence(i).dynamicCast<KCalCore::Event>();
         const Kolab::Event &incidence = Kolab::Conversion::fromKCalCore(*ic);
-        const std::string &v3String = Kolab::writeEvent(incidence);
+        const std::string &v3String = Kolab::writeEvent(incidence, getProductId(productId).toStdString());
         ErrorHandler::handleLibkolabxmlErrors();
-        return Mime::createMessage(ic, xCalMimeType(), eventKolabType(), QString::fromStdString(v3String).toLocal8Bit(), true);
+        return Mime::createMessage(ic, xCalMimeType(), eventKolabType(), QString::fromStdString(v3String).toLocal8Bit(), true, getProductId(productId));
     }
     const QString &xml = KolabV2::Event::eventToXML(i, tz);
-    return Mime::createMessage(i, eventKolabType(), eventKolabType(), xml.toLocal8Bit(), false);
+    return Mime::createMessage(i, eventKolabType(), eventKolabType(), xml.toLocal8Bit(), false, getProductId(productId));
 }
 
-KMime::Message::Ptr KolabObjectWriter::writeTodo(const KCalCore::Todo::Ptr &i, Version v, const QString &tz)
+KMime::Message::Ptr KolabObjectWriter::writeTodo(const KCalCore::Todo::Ptr &i, Version v, const QString &productId, const QString &tz)
 {
     ErrorHandler::clearErrors();
     Q_ASSERT(!i.isNull());
     if (v == KolabV3) {
         KCalCore::Todo::Ptr ic = normalizeIncidence(i).dynamicCast<KCalCore::Todo>();
         const Kolab::Todo &incidence = Kolab::Conversion::fromKCalCore(*ic);
-        const std::string &v3String = Kolab::writeTodo(incidence);
+        const std::string &v3String = Kolab::writeTodo(incidence, getProductId(productId).toStdString());
         ErrorHandler::handleLibkolabxmlErrors();
-        return Mime::createMessage(ic, xCalMimeType(), todoKolabType(), QString::fromStdString(v3String).toLocal8Bit(), true);
+        return Mime::createMessage(ic, xCalMimeType(), todoKolabType(), QString::fromStdString(v3String).toLocal8Bit(), true, getProductId(productId));
     }
     const QString &xml = KolabV2::Task::taskToXML(i, tz);
-    return Mime::createMessage(i, todoKolabType(), todoKolabType(), xml.toLocal8Bit(), false);
+    return Mime::createMessage(i, todoKolabType(), todoKolabType(), xml.toLocal8Bit(), false, getProductId(productId));
 }
 
-KMime::Message::Ptr KolabObjectWriter::writeJournal(const KCalCore::Journal::Ptr &i, Version v, const QString &tz)
+KMime::Message::Ptr KolabObjectWriter::writeJournal(const KCalCore::Journal::Ptr &i, Version v, const QString &productId, const QString &tz)
 {
     ErrorHandler::clearErrors();
     Q_ASSERT(!i.isNull());
     if (v == KolabV3) {
         KCalCore::Journal::Ptr ic = normalizeIncidence(i).dynamicCast<KCalCore::Journal>();
         const Kolab::Journal &incidence = Kolab::Conversion::fromKCalCore(*ic);
-        const std::string &v3String = Kolab::writeJournal(incidence);
+        const std::string &v3String = Kolab::writeJournal(incidence, getProductId(productId).toStdString());
         ErrorHandler::handleLibkolabxmlErrors();
-        return  Mime::createMessage(ic, xCalMimeType(), journalKolabType(), QString::fromStdString(v3String).toLocal8Bit(), true);
+        return  Mime::createMessage(ic, xCalMimeType(), journalKolabType(), QString::fromStdString(v3String).toLocal8Bit(), true, getProductId(productId));
     }
     const QString &xml = KolabV2::Journal::journalToXML(i, tz);
-    return Mime::createMessage(i, journalKolabType(), journalKolabType(), xml.toLocal8Bit(), false);
+    return Mime::createMessage(i, journalKolabType(), journalKolabType(), xml.toLocal8Bit(), false, getProductId(productId));
 }
 
-KMime::Message::Ptr KolabObjectWriter::writeContact(const KABC::Addressee &addressee, Version v)
+KMime::Message::Ptr KolabObjectWriter::writeContact(const KABC::Addressee &addressee, Version v, const QString &productId)
 {
     ErrorHandler::clearErrors();
     if (v == KolabV3) {
         const Kolab::Contact &contact = Kolab::Conversion::fromKABC(addressee);
-        const std::string &v3String = Kolab::writeContact(contact);
+        const std::string &v3String = Kolab::writeContact(contact, getProductId(productId).toStdString());
         ErrorHandler::handleLibkolabxmlErrors();
-        return  Mime::createMessage(addressee, xCardMimeType(), contactKolabType(), QString::fromStdString(v3String).toLocal8Bit(), true);
+        return  Mime::createMessage(addressee, xCardMimeType(), contactKolabType(), QString::fromStdString(v3String).toLocal8Bit(), true, getProductId(productId));
     }
     KolabV2::Contact contact(&addressee);
-    return contactToKolabFormat(contact);
+    return contactToKolabFormat(contact, getProductId(productId));
 }
 
-KMime::Message::Ptr KolabObjectWriter::writeDistlist(const KABC::ContactGroup &distlist, Version v)
+KMime::Message::Ptr KolabObjectWriter::writeDistlist(const KABC::ContactGroup &distlist, Version v, const QString &productId)
 {
     ErrorHandler::clearErrors();
     if (v == KolabV3) {
         const Kolab::DistList &dist = Kolab::Conversion::fromKABC(distlist);
-        const std::string &v3String = Kolab::writeDistlist(dist);
+        const std::string &v3String = Kolab::writeDistlist(dist, getProductId(productId).toStdString());
         ErrorHandler::handleLibkolabxmlErrors();
-        return  Mime::createMessage(QString(), xCardMimeType(), contactKolabType(), QString::fromStdString(v3String).toLocal8Bit(), true);
+        return  Mime::createMessage(QString(), xCardMimeType(), contactKolabType(), QString::fromStdString(v3String).toLocal8Bit(), true, getProductId(productId));
     }
     KolabV2::DistributionList d(&distlist);
-    return distListToKolabFormat(d);
+    return distListToKolabFormat(d, getProductId(productId));
 }
 
-KMime::Message::Ptr KolabObjectWriter::writeNote(const KMime::Message::Ptr &note, Version v)
+KMime::Message::Ptr KolabObjectWriter::writeNote(const KMime::Message::Ptr &note, Version v, const QString &productId)
 {
     ErrorHandler::clearErrors();
     Q_ASSERT(note.get());
     if (v == KolabV3) {
         const Kolab::Note &n = Kolab::Conversion::fromNote(note);
-        const std::string &v3String = Kolab::writeNote(n);
+        const std::string &v3String = Kolab::writeNote(n, getProductId(productId).toStdString());
         ErrorHandler::handleLibkolabxmlErrors();
-        return  Mime::createMessage(QString::fromStdString(n.summary()) ,noteMimeType(), noteKolabType(), QString::fromStdString(v3String).toLocal8Bit(), true);
+        return  Mime::createMessage(QString::fromStdString(n.summary()) ,noteMimeType(), noteKolabType(), QString::fromStdString(v3String).toLocal8Bit(), true, getProductId(productId));
     }
-    return noteToKolab(note);
+    return noteToKolab(note, getProductId(productId));
 }
 
 
diff --git a/kolabformat/kolabobject.h b/kolabformat/kolabobject.h
index 759fed0..18a3640 100644
--- a/kolabformat/kolabobject.h
+++ b/kolabformat/kolabobject.h
@@ -45,7 +45,6 @@ enum ObjectType {
     NoteObject
 };
 
-
 KOLAB_EXPORT KCalCore::Event::Ptr readV2EventXML(const QByteArray &xmlData, QStringList &attachments);
 
 /**
@@ -82,12 +81,13 @@ private:
 
 class KOLAB_EXPORT KolabObjectWriter {
 public:
-    static KMime::Message::Ptr writeEvent(const KCalCore::Event::Ptr &, Version v = KolabV3, const QString &tz = QString());
-    static KMime::Message::Ptr writeTodo(const KCalCore::Todo::Ptr &, Version v = KolabV3, const QString &tz = QString());
-    static KMime::Message::Ptr writeJournal(const KCalCore::Journal::Ptr &, Version v = KolabV3, const QString &tz = QString());
-    static KMime::Message::Ptr writeContact(const KABC::Addressee &, Version v = KolabV3);
-    static KMime::Message::Ptr writeDistlist(const KABC::ContactGroup &, Version v = KolabV3);
-    static KMime::Message::Ptr writeNote(const KMime::Message::Ptr &, Version v = KolabV3);
+
+    static KMime::Message::Ptr writeEvent(const KCalCore::Event::Ptr &, Version v = KolabV3, const QString &productId = QString(), const QString &tz = QString());
+    static KMime::Message::Ptr writeTodo(const KCalCore::Todo::Ptr &, Version v = KolabV3, const QString &productId = QString(),const QString &tz = QString());
+    static KMime::Message::Ptr writeJournal(const KCalCore::Journal::Ptr &, Version v = KolabV3, const QString &productId = QString(),const QString &tz = QString());
+    static KMime::Message::Ptr writeContact(const KABC::Addressee &, Version v = KolabV3, const QString &productId = QString());
+    static KMime::Message::Ptr writeDistlist(const KABC::ContactGroup &, Version v = KolabV3, const QString &productId = QString());
+    static KMime::Message::Ptr writeNote(const KMime::Message::Ptr &, Version v = KolabV3, const QString &productId = QString());
 };
 
 }; //Namespace
diff --git a/kolabformat/v2helpers.h b/kolabformat/v2helpers.h
index ced0c8c..75b8702 100644
--- a/kolabformat/v2helpers.h
+++ b/kolabformat/v2helpers.h
@@ -36,9 +36,9 @@
 
 namespace Kolab {
 
-KMime::Message::Ptr distListToKolabFormat(const KolabV2::DistributionList& distList)
+KMime::Message::Ptr distListToKolabFormat(const KolabV2::DistributionList& distList, const QString &productId)
 {    
-    KMime::Message::Ptr message = Mime::createMessage( distlistKolabType(), false );
+    KMime::Message::Ptr message = Mime::createMessage( distlistKolabType(), false, productId );
     message->subject()->fromUnicodeString( distList.uid(), "utf-8" );
     message->from()->fromUnicodeString( distList.uid(), "utf-8" );
     
@@ -159,19 +159,19 @@ KMime::Message::Ptr noteFromKolab(const QByteArray &xmlData, const KMime::Messag
     return note.message();
 }
 
-KMime::Message::Ptr noteToKolab(const KMime::Message::Ptr& msg)
+KMime::Message::Ptr noteToKolab(const KMime::Message::Ptr& msg, const QString &productId)
 {
     Akonadi::NoteUtils::NoteMessageWrapper note(msg);
     KolabV2::Note j;
     j.setSummary( note.title() );
     j.setBody( note.text() );
     
-    return Mime::createMessage(j.summary(), noteKolabType(), noteKolabType(), j.saveXML().toUtf8(), false); 
+    return Mime::createMessage(j.summary(), noteKolabType(), noteKolabType(), j.saveXML().toUtf8(), false, productId); 
 }
 
-KMime::Message::Ptr contactToKolabFormat(const KolabV2::Contact& contact)
+KMime::Message::Ptr contactToKolabFormat(const KolabV2::Contact& contact, const QString &productId)
 {
-    KMime::Message::Ptr message = Mime::createMessage( contactKolabType(), false ); //TODO v3 mimetype
+    KMime::Message::Ptr message = Mime::createMessage( contactKolabType(), false, productId ); //TODO v3 mimetype
     message->subject()->fromUnicodeString( contact.uid(), "utf-8" );
     message->from()->fromUnicodeString( contact.fullEmail(), "utf-8" );
     
diff --git a/mime/mimeutils.cpp b/mime/mimeutils.cpp
index 5245475..0e53bdb 100644
--- a/mime/mimeutils.cpp
+++ b/mime/mimeutils.cpp
@@ -23,6 +23,7 @@
 #include <kabc/addressee.h>
 #include "kolabformat/kolabdefinitions.h"
 #include "kolabformat/errorhandler.h"
+#include "libkolab-version.h"
 
 namespace Kolab {
     namespace Mime {
@@ -92,9 +93,9 @@ QString fromCid(const QString &cid)
     return cid.right(cid.size()-4);
 }
 
-KMime::Message::Ptr createMessage(const KCalCore::Incidence::Ptr &incidencePtr, const QString &mimetype, const QString &xKolabType, const QByteArray &xml, bool v3)
+KMime::Message::Ptr createMessage(const KCalCore::Incidence::Ptr &incidencePtr, const QString &mimetype, const QString &xKolabType, const QByteArray &xml, bool v3, const QString &productId)
 {
-    KMime::Message::Ptr message = createMessage( xKolabType, v3 );
+    KMime::Message::Ptr message = createMessage( xKolabType, v3, productId );
     message->from()->addAddress( incidencePtr->organizer()->email().toUtf8(), incidencePtr->organizer()->name() );
     message->subject()->fromUnicodeString( incidencePtr->uid(), "utf-8" );
     
@@ -114,9 +115,9 @@ KMime::Message::Ptr createMessage(const KCalCore::Incidence::Ptr &incidencePtr,
     return message;
 }
 
-KMime::Message::Ptr createMessage(const KABC::Addressee &contact, const QString &mimetype, const QString &xKolabType, const QByteArray &xml, bool v3)
+KMime::Message::Ptr createMessage(const KABC::Addressee &contact, const QString &mimetype, const QString &xKolabType, const QByteArray &xml, bool v3, const QString &prodid)
 {
-    KMime::Message::Ptr message = Mime::createMessage( xKolabType, v3 );
+    KMime::Message::Ptr message = Mime::createMessage( xKolabType, v3, prodid );
     message->subject()->fromUnicodeString( contact.uid(), "utf-8" );
     message->from()->fromUnicodeString( contact.fullEmail(), "utf-8" );
     
@@ -154,9 +155,9 @@ KMime::Message::Ptr createMessage(const KABC::Addressee &contact, const QString
     return message;
 }
 
-KMime::Message::Ptr createMessage(const QString &subject, const QString &mimetype, const QString &xKolabType, const QByteArray &xml, bool v3)
+KMime::Message::Ptr createMessage(const QString &subject, const QString &mimetype, const QString &xKolabType, const QByteArray &xml, bool v3, const QString &prodid)
 {
-    KMime::Message::Ptr message = createMessage( xKolabType, v3 );
+    KMime::Message::Ptr message = createMessage( xKolabType, v3, prodid );
     if (!subject.isEmpty()) {
         message->subject()->fromUnicodeString( subject, "utf-8" );
     }
@@ -189,7 +190,7 @@ KMime::Content* createExplanationPart(bool v3)
 }
 
 
-KMime::Message::Ptr createMessage(const QString& xKolabType, bool v3)
+KMime::Message::Ptr createMessage(const QString& xKolabType, bool v3, const QString &prodid)
 {
     KMime::Message::Ptr message( new KMime::Message );
     message->date()->setDateTime( KDateTime::currentLocalDateTime() );
@@ -199,7 +200,7 @@ KMime::Message::Ptr createMessage(const QString& xKolabType, bool v3)
         KMime::Headers::Generic *vh = new KMime::Headers::Generic( X_KOLAB_VERSION_HEADER, message.get(), KOLAB_VERSION_V3, "utf-8" );
         message->appendHeader( vh );
     }
-    message->userAgent()->from7BitString( "Akonadi Kolab Proxy Resource" ); //FIXME
+    message->userAgent()->from7BitString( prodid.toLatin1() );
     message->contentType()->setMimeType( "multipart/mixed" );
     message->contentType()->setBoundary( KMime::multiPartBoundary() );
     
diff --git a/mime/mimeutils.h b/mime/mimeutils.h
index 5244068..428cbcf 100644
--- a/mime/mimeutils.h
+++ b/mime/mimeutils.h
@@ -48,12 +48,12 @@ void getAttachments(KCalCore::Incidence::Ptr incidence, const QStringList &attac
 void getAttachmentsById(KCalCore::Incidence::Ptr incidence, const KMime::Message::Ptr &mimeData);
 
 ///Generic serializing functions
-KMime::Message::Ptr createMessage(const KCalCore::Incidence::Ptr &incidencePtr, const QString &mimetype, const QString &xKolabType, const QByteArray &xml, bool v3);
-KMime::Message::Ptr createMessage(const KABC::Addressee &contact, const QString &mimetype, const QString &xKolabType, const QByteArray &xml, bool v3);
-KMime::Message::Ptr createMessage(const QString &subject, const QString &mimetype, const QString &xKolabType, const QByteArray &xml, bool v3);
+KMime::Message::Ptr createMessage(const KCalCore::Incidence::Ptr &incidencePtr, const QString &mimetype, const QString &xKolabType, const QByteArray &xml, bool v3, const QString &prodid);
+KMime::Message::Ptr createMessage(const KABC::Addressee &contact, const QString &mimetype, const QString &xKolabType, const QByteArray &xml, bool v3, const QString &prodid);
+KMime::Message::Ptr createMessage(const QString &subject, const QString &mimetype, const QString &xKolabType, const QByteArray &xml, bool v3, const QString &prodid);
 
 KMime::Content* createExplanationPart();
-KMime::Message::Ptr createMessage(const QString& mimeType, bool v3);
+KMime::Message::Ptr createMessage(const QString& mimeType, bool v3, const QString &prodid);
 KMime::Content* createMainPart(const QString& mimeType, const QByteArray& decodedContent);
 KMime::Content* createAttachmentPart(const QByteArray &cid, const QString& mimeType, const QString& fileName, const QByteArray& decodedContent);
 


commit fea6d3ed681ff2fe7f2f186be50375411b38312e
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Mon Apr 23 11:54:18 2012 +0200

    Added version file.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6a5509c..8776e72 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,6 +11,7 @@ set(Libkolab_VERSION_MAJOR 0)
 set(Libkolab_VERSION_MINOR 1)
 set(Libkolab_VERSION_PATCH 0)
 set(Libkolab_VERSION ${Libkolab_VERSION_MAJOR}.${Libkolab_VERSION_MINOR}.${Libkolab_VERSION_PATCH} )
+set (Libkolab_VERSION_STRING ${CMAKE_PROJECT_NAME}-${Libkolab_VERSION})
 
 # set up install directories. INCLUDE_INSTALL_DIR and LIB_INSTALL_DIR must not be absolute paths
 set(LIB_INSTALL_DIR_SUFFIX "" CACHE STRING "The directories where to install libraries to")
@@ -40,6 +41,7 @@ include_directories(
 
 #Make akonadi version available for kolabformatv2 TODO Get rid of this, it shouldn't be necessary
 configure_file(akonadi-version.h.cmake "${CMAKE_BINARY_DIR}/akonadi-version.h" @ONLY)
+configure_file(libkolab-version.h.cmake "${CMAKE_BINARY_DIR}/libkolab-version.h" @ONLY)
 
 add_subdirectory(kolabformatV2)
 add_subdirectory(conversion)
diff --git a/libkolab-version.h.cmake b/libkolab-version.h.cmake
new file mode 100644
index 0000000..1e921f9
--- /dev/null
+++ b/libkolab-version.h.cmake
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2012  Christian Mollekopf <mollekopf at kolabsys.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef LIBKOLAB_VERSION_H
+#define LIBKOLAB_VERSION_H
+
+#define LIBKOLAB_LIBNAME "@CMAKE_PROJECT_NAME@"
+#define LIBKOLAB_LIB_VERSION "@Libkolab_VERSION@"
+#define LIBKOLAB_LIB_VERSION_STRING "@Libkolab_VERSION_STRING@"
+
+#endif
\ No newline at end of file


commit fc400f71a98fcc9b4824bf278e728a1312080a98
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Mon Apr 23 01:57:55 2012 +0200

    Proper singleton implementation.

diff --git a/kolabformat/errorhandler.h b/kolabformat/errorhandler.h
index 351f14b..970e43f 100644
--- a/kolabformat/errorhandler.h
+++ b/kolabformat/errorhandler.h
@@ -56,7 +56,7 @@ public:
         QString message;
     };
     
-    static ErrorHandler instance()
+    static ErrorHandler &instance()
     {
         static ErrorHandler inst;
         return inst;
@@ -79,6 +79,9 @@ public:
     
 private:
     ErrorHandler():m_worstError(NoError) {};
+    ErrorHandler(const ErrorHandler &);
+    ErrorHandler & operator= (const ErrorHandler &);
+    
     Severity m_worstError;
     QList <Err> m_errorQueue;
 };


commit 18d311779ecd0bcd9d0c55b3cfd1cc40988f47f0
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Sun Apr 22 23:47:48 2012 +0200

    Use the right directory for cmake files, so they are automatically found by cmake.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1f15a29..6a5509c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,7 +15,7 @@ set(Libkolab_VERSION ${Libkolab_VERSION_MAJOR}.${Libkolab_VERSION_MINOR}.${Libko
 # set up install directories. INCLUDE_INSTALL_DIR and LIB_INSTALL_DIR must not be absolute paths
 set(LIB_INSTALL_DIR_SUFFIX "" CACHE STRING "The directories where to install libraries to")
 set(LIB_INSTALL_DIR lib${LIB_INSTALL_DIR_SUFFIX} )
-set(CMAKECONFIG_INSTALL_DIR ${LIB_INSTALL_DIR}/cmake/Kolab ) 
+set(CMAKECONFIG_INSTALL_DIR ${LIB_INSTALL_DIR}/cmake/Libkolab )
 
 # Use a versioned install directory for the headers so multiple versions can be installed in parallel
 set(INCLUDE_INSTALL_DIR include/kolab )





More information about the commits mailing list