Hello community, here is the log from the commit of package libkolab for openSUSE:Factory checked in at 2013-05-16 18:00:43 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libkolab (Old) and /work/SRC/openSUSE:Factory/.libkolab.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libkolab" Changes: -------- --- /work/SRC/openSUSE:Factory/libkolab/libkolab.changes 2013-01-17 13:18:19.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.libkolab.new/libkolab.changes 2013-05-16 18:00:44.000000000 +0200 @@ -1,0 +2,21 @@ +Fri Apr 26 10:21:41 UTC 2013 - [email protected] + +- New upstream version 0.4.2 + * Fixes bindings for event vectors + * Requires libkolabxml 0.8.4 + +------------------------------------------------------------------- +Tue Mar 19 13:16:29 UTC 2013 - [email protected] + +- Removed patch libkolab-0.4.1_SLE11_SP2_cmake_version.patch +- Added repo devel:tools:building/SLE11 (for cmake, swig, ...) +- Fixed php bindings for SLE 11 SP2 + +------------------------------------------------------------------- +Tue Mar 12 19:45:50 UTC 2013 - [email protected] + +- Add patch libkolab-0.4.1_SLE11_SP2_cmake_version.patch + * Lowers cmake requirement from 2.6.4 to 2.6 + * Enabless SLE 11 SP2 build + +------------------------------------------------------------------- Old: ---- libkolab-0.4.1.tar.gz New: ---- libkolab-0.4.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libkolab.spec ++++++ --- /var/tmp/diff_new_pack.69kXcM/_old 2013-05-16 18:00:45.000000000 +0200 +++ /var/tmp/diff_new_pack.69kXcM/_new 2013-05-16 18:00:45.000000000 +0200 @@ -1,7 +1,7 @@ # # spec file for package libkolab # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -21,7 +21,7 @@ %global php_inidir %{_sysconfdir}/%{phpdir}/conf.d Name: libkolab -Version: 0.4.1 +Version: 0.4.2 Release: 0 %define soname 0 Summary: Conversions from/to KDE containers @@ -31,12 +31,18 @@ Source: http://mirror.kolabsys.com/pub/releases/%{name}-%{version}.tar.gz # Patch to hack SWIGUtils.cmake to find PHP5 on openSUSE Patch0: fix_php5_bindings.diff -BuildRequires: libkdepimlibs4-devel -BuildRequires: libkolabxml-devel +BuildRequires: boost-devel +BuildRequires: cmake >= 2.6.4 +BuildRequires: libkdepimlibs4-devel >= 4.9 +BuildRequires: libkolabxml-devel >= 0.8.4 +BuildRequires: libqt4-devel BuildRequires: libxerces-c-devel -BuildRequires: php5-devel +BuildRequires: php-devel >= 5.3 BuildRequires: python-devel -BuildRequires: swig +%if 0%{?sles_version} == 11 +BuildRequires: uuid-devel = 1.6.2 +%endif +BuildRequires: swig >= 2.0 BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -101,6 +107,10 @@ -DLIB_INSTALL_DIR="%{_lib}" \ -DCMAKE_SKIP_RPATH=TRUE \ -DCMAKE_BUILD_TYPE=RELEASE \ +%if 0%{?sles_version} == 11 || 0%{?fedora} == 17 + -DUSE_LIBCALENDARING=TRUE \ + -DLibkolabxml_DIR=%{_libdir}/cmake/Libkolabxml \ +%endif -DPHP_BINDINGS=TRUE -DPHP_INSTALL_DIR=%{php_extdir} \ -DPYTHON_BINDINGS=TRUE -DPYTHON_INSTALL_DIR=%{python_sitearch} \ .. ++++++ libkolab-0.4.1.tar.gz -> libkolab-0.4.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolab-0.4.1/CMakeLists.txt new/libkolab-0.4.2/CMakeLists.txt --- old/libkolab-0.4.1/CMakeLists.txt 2013-01-09 13:59:23.000000000 +0100 +++ new/libkolab-0.4.2/CMakeLists.txt 2013-04-11 11:40:10.000000000 +0200 @@ -33,10 +33,10 @@ set(Libkolab_VERSION_MAJOR 0) set(Libkolab_VERSION_MINOR 4) # Enable the full x.y.z version only for release versions -set(Libkolab_VERSION_PATCH 1) +set(Libkolab_VERSION_PATCH 2) set(Libkolab_VERSION ${Libkolab_VERSION_MAJOR}.${Libkolab_VERSION_MINOR}.${Libkolab_VERSION_PATCH} ) #set(Libkolab_VERSION ${Libkolab_VERSION_MAJOR}.${Libkolab_VERSION_MINOR} ) -#set(Libkolab_VERSION_STRING ${CMAKE_PROJECT_NAME}-${Libkolab_VERSION}) +set(Libkolab_VERSION_STRING ${CMAKE_PROJECT_NAME}-${Libkolab_VERSION}) # set up install directories. set(LIB_INSTALL_DIR lib CACHE STRING "The directories where to install libraries to") @@ -74,6 +74,7 @@ set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -DQT_NO_EXCEPTIONS -fno-check-new -fno-common -Woverloaded-virtual -fno-threadsafe-statics -fvisibility=hidden -Werror=return-type -fvisibility-inlines-hidden -fexceptions -UQT_NO_EXCEPTIONS -fPIC -g" ) # message("${CMAKE_CXX_FLAGS}") +set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DQT_NO_DEBUG") if (USE_LIBCALENDARING) set( KDE_INCLUDES ${Libcalendaring_INCLUDE_DIRS} ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolab-0.4.1/autogen.sh new/libkolab-0.4.2/autogen.sh --- old/libkolab-0.4.1/autogen.sh 2013-01-09 13:59:23.000000000 +0100 +++ new/libkolab-0.4.2/autogen.sh 2013-04-11 11:40:10.000000000 +0200 @@ -63,7 +63,20 @@ -DPHP_BINDINGS=ON \ -DPHP_INSTALL_DIR=/usr/lib64/php/modules \ -DPYTHON_BINDINGS=ON \ - .. + -DCMAKE_BUILD_TYPE=Release \ + .. || \ + cmake \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DLIB_INSTALL_DIR=/usr/lib64 \ + -DINCLUDE_INSTALL_DIR=/usr/include \ + -DUSE_LIBCALENDARING=OFF \ + -DPHP_BINDINGS=ON \ + -DPHP_INSTALL_DIR=/usr/lib64/php/modules \ + -DPYTHON_BINDINGS=ON \ + -DCMAKE_BUILD_TYPE=Release \ + .. || \ + exit 1 fi if [ ${dobuild} -eq 1 ]; then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolab-0.4.1/conversion/commonconversion.cpp new/libkolab-0.4.2/conversion/commonconversion.cpp --- old/libkolab-0.4.1/conversion/commonconversion.cpp 2013-01-09 13:59:23.000000000 +0100 +++ new/libkolab-0.4.2/conversion/commonconversion.cpp 2013-04-11 11:40:10.000000000 +0200 @@ -36,7 +36,11 @@ return KDateTime::Spec(KDateTime::ClockTime); } //Timezone - KTimeZone tz = KSystemTimeZones::zone(QString::fromStdString(timezone)); //Needs ktimezoned (timezone daemon running) http://api.kde.org/4.x-api/kdelibs-apidocs/kdecore/html/classKSystemTimeZones.html + + //Convert non-olson timezones if necessary + const QString normalizedTz = TimezoneConverter::normalizeTimezone(QString::fromStdString(timezone)); + Debug() << "normalized " << normalizedTz; + KTimeZone tz = KSystemTimeZones::zone(normalizedTz); //Needs ktimezoned (timezone daemon running) http://api.kde.org/4.x-api/kdelibs-apidocs/kdecore/html/classKSystemTimeZones.html if (!tz.isValid()) { Error() << "timezone not found" << QString::fromStdString(timezone); if (!KSystemTimeZones::isTimeZoneDaemonAvailable()) { @@ -161,4 +165,5 @@ } } -} \ No newline at end of file +} + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolab-0.4.1/conversion/timezoneconverter.cpp new/libkolab-0.4.2/conversion/timezoneconverter.cpp --- old/libkolab-0.4.1/conversion/timezoneconverter.cpp 2013-01-09 13:59:23.000000000 +0100 +++ new/libkolab-0.4.2/conversion/timezoneconverter.cpp 2013-04-11 11:40:10.000000000 +0200 @@ -21,12 +21,15 @@ #include <kdebug.h> #include <QRegExp> #include <QStringList> +#include "kolabformat/errorhandler.h" QString TimezoneConverter::normalizeTimezone(const QString& tz) { KTimeZone timezone = KSystemTimeZones::zone(tz); //Needs ktimezoned (timezone daemon running) http://api.kde.org/4.x-api/kdelibs-apidocs/kdecore/html/classKSystemTimeZones.html if (timezone.isValid()) { return tz; + } else if (!KSystemTimeZones::isTimeZoneDaemonAvailable()) { + Error() << "ktimezoned is not available and required for timezone interpretation"; } //We're dealing with an invalid or unknown timezone, try to parse it QString guessedTimezone = fromCityName(tz); @@ -36,6 +39,7 @@ if (guessedTimezone.isEmpty()) { guessedTimezone = fromGMTOffsetTimezone(tz); } + Debug() << "Guessed timezone and found: " << guessedTimezone; return guessedTimezone; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolab-0.4.1/kolabformat/v2helpers.cpp new/libkolab-0.4.2/kolabformat/v2helpers.cpp --- old/libkolab-0.4.1/kolabformat/v2helpers.cpp 2013-01-09 13:59:23.000000000 +0100 +++ new/libkolab-0.4.2/kolabformat/v2helpers.cpp 2013-04-11 11:40:10.000000000 +0200 @@ -40,6 +40,10 @@ static QImage getPicture(const QString &pictureAttachmentName, const KMime::Message::Ptr &data, QByteArray &type) { + if (!data) { + Critical() << "empty message"; + return QImage(); + } KMime::Content *imgContent = Mime::findContentByName(data, pictureAttachmentName/*"kolab-picture.png"*/, type); if (!imgContent) { Warning() << "could not find picture: " << pictureAttachmentName; @@ -79,6 +83,10 @@ KABC::Addressee addresseeFromKolab( const QByteArray &xmlData, const KMime::Message::Ptr &data) { + if (!data) { + Critical() << "empty message"; + return KABC::Addressee(); + } KABC::Addressee addressee; // Debug() << "xmlData " << xmlData; KolabV2::Contact contact(QString::fromUtf8(xmlData)); @@ -140,6 +148,10 @@ KMime::Message::Ptr contactToKolabFormat(const KolabV2::Contact& contact, const QString &productId) { KMime::Message::Ptr message = Mime::createMessage( KOLAB_TYPE_CONTACT, false, productId ); + if (!message) { + Critical() << "empty message"; + return KMime::Message::Ptr(); + } message->subject()->fromUnicodeString( contact.uid(), "utf-8" ); message->from()->fromUnicodeString( contact.fullEmail(), "utf-8" ); @@ -181,6 +193,10 @@ KMime::Message::Ptr distListToKolabFormat(const KolabV2::DistributionList& distList, const QString &productId) { KMime::Message::Ptr message = Mime::createMessage( KOLAB_TYPE_DISTLIST, false, productId ); + if (!message) { + Critical() << "empty message"; + return KMime::Message::Ptr(); + } message->subject()->fromUnicodeString( distList.uid(), "utf-8" ); message->from()->fromUnicodeString( distList.uid(), "utf-8" ); @@ -209,12 +225,20 @@ KMime::Message::Ptr noteToKolab(const KMime::Message::Ptr& msg, const QString &productId) { + if (!msg) { + Critical() << "empty message"; + return KMime::Message::Ptr(); + } Akonadi::NoteUtils::NoteMessageWrapper note(msg); return Mime::createMessage(note.title(), KOLAB_TYPE_NOTE, KOLAB_TYPE_NOTE, noteToKolabXML(msg), false, productId); } QByteArray noteToKolabXML(const KMime::Message::Ptr& msg) { + if (!msg) { + Critical() << "empty message"; + return QByteArray(); + } Akonadi::NoteUtils::NoteMessageWrapper note(msg); KolabV2::Note j; j.setSummary( note.title() ); @@ -226,7 +250,10 @@ { QStringList dictionary; const QDomDocument xmlDoc = KolabV2::KolabBase::loadDocument( QString::fromUtf8(xmlData) ); //TODO extract function from V2 format - Q_ASSERT ( !xmlDoc.isNull() ); + if ( xmlDoc.isNull() ) { + Error() << "Failed to read the xml document"; + return QStringList(); + } QDomElement top = xmlDoc.documentElement(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolab-0.4.1/kolabformat/v2helpers.h new/libkolab-0.4.2/kolabformat/v2helpers.h --- old/libkolab-0.4.1/kolabformat/v2helpers.h 2013-01-09 13:59:23.000000000 +0100 +++ new/libkolab-0.4.2/kolabformat/v2helpers.h 2013-04-11 11:40:10.000000000 +0200 @@ -46,7 +46,10 @@ static KCalPtr fromXML(const QByteArray &xmlData, QStringList &attachments) { const QDomDocument xmlDoc = KolabV2::KolabBase::loadDocument( QString::fromUtf8(xmlData) ); //TODO extract function from V2 format - Q_ASSERT ( !xmlDoc.isNull() ); + if ( xmlDoc.isNull() ) { + Critical() << "Failed to read the xml document"; + return KCalPtr(); + } const KCalPtr i = Container::fromXml( xmlDoc, QString() ); //For parsing we don't need the timezone, so we don't set one Q_ASSERT ( i ); QDomNodeList nodes = xmlDoc.elementsByTagName("inline-attachment"); @@ -61,7 +64,7 @@ { KMime::Content *xmlContent = Mime::findContentByType( data, mimetype ); if ( !xmlContent ) { - Warning() << "couldn't find part"; + Critical() << "couldn't find part"; return IncidencePtr(); } const QByteArray &xmlData = xmlContent->decodedContent(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolab-0.4.1/kolabformat/xmlobject.cpp new/libkolab-0.4.2/kolabformat/xmlobject.cpp --- old/libkolab-0.4.1/kolabformat/xmlobject.cpp 2013-01-09 13:59:23.000000000 +0100 +++ new/libkolab-0.4.2/kolabformat/xmlobject.cpp 2013-04-11 11:40:10.000000000 +0200 @@ -52,6 +52,10 @@ mWrittenUID.clear(); if (version == KolabV2) { const KCalCore::Event::Ptr i = Conversion::toKCalCore(event); + if (!i) { + Critical() << "invalid incidence"; + return std::string(); + } if (i->uid().isEmpty()) { i->setUid(createUuid()); } @@ -70,6 +74,10 @@ if (version == KolabV2) { QStringList attachments; const KCalCore::Event::Ptr event = Kolab::fromXML<KCalCore::Event::Ptr, KolabV2::Event>(QString::fromUtf8(s.c_str()).toUtf8(), attachments); + if (!event || Kolab::ErrorHandler::errorOccured()) { + Critical() << "failed to read xml"; + return Event(); + } mAttachments.clear(); foreach (const QString &attachment, attachments) { mAttachments.push_back(Conversion::toStdString(attachment)); @@ -84,6 +92,10 @@ mWrittenUID.clear(); if (version == KolabV2) { const KCalCore::Todo::Ptr i = Conversion::toKCalCore(event); + if (!i) { + Critical() << "invalid incidence"; + return std::string(); + } if (i->uid().isEmpty()) { i->setUid(createUuid()); } @@ -102,6 +114,10 @@ if (version == KolabV2) { QStringList attachments; const KCalCore::Todo::Ptr event = Kolab::fromXML<KCalCore::Todo::Ptr, KolabV2::Task>(QString::fromUtf8(s.c_str()).toUtf8(), attachments); + if (!event || Kolab::ErrorHandler::errorOccured()) { + Error() << "failed to read xml"; + return Todo(); + } mAttachments.clear(); foreach (const QString &attachment, attachments) { mAttachments.push_back(Conversion::toStdString(attachment)); @@ -116,6 +132,10 @@ mWrittenUID.clear(); if (version == KolabV2) { const KCalCore::Journal::Ptr i = Conversion::toKCalCore(event); + if (!i) { + Critical() << "invalid journal"; + return std::string(); + } if (i->uid().isEmpty()) { i->setUid(createUuid()); } @@ -134,6 +154,10 @@ if (version == KolabV2) { QStringList attachments; const KCalCore::Journal::Ptr event = Kolab::fromXML<KCalCore::Journal::Ptr, KolabV2::Journal>(QString::fromUtf8(s.c_str()).toUtf8(), attachments); + if (!event || Kolab::ErrorHandler::errorOccured()) { + Critical() << "failed to read xml"; + return Journal(); + } mAttachments.clear(); foreach (const QString &attachment, attachments) { mAttachments.push_back(Conversion::toStdString(attachment)); @@ -244,6 +268,10 @@ { if (version == KolabV2) { const KMime::Message::Ptr msg = noteFromKolab(QByteArray(s.c_str(), s.length()), KDateTime()); + if (!msg || Kolab::ErrorHandler::errorOccured()) { + Critical() << "failed to read xml"; + return Note(); + } return Conversion::fromNote(msg); } return Kolab::readNote(s, false); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolab-0.4.1/mime/mimeutils.cpp new/libkolab-0.4.2/mime/mimeutils.cpp --- old/libkolab-0.4.1/mime/mimeutils.cpp 2013-01-09 13:59:23.000000000 +0100 +++ new/libkolab-0.4.2/mime/mimeutils.cpp 2013-04-11 11:40:10.000000000 +0200 @@ -258,6 +258,10 @@ void getAttachments(KCalCore::Incidence::Ptr incidence, const QStringList &attachments, const KMime::Message::Ptr &mimeData) { + if (!incidence) { + Error() << "Invalid incidence"; + return; + } // kDebug() << "getting " << attachments.size() << "attachments"; // kDebug() << mimeData->encodedContent(); foreach (const QString &name, attachments) { @@ -278,6 +282,10 @@ void getAttachmentsById(KCalCore::Incidence::Ptr incidence, const KMime::Message::Ptr &mimeData) { + if (!incidence) { + Error() << "Invalid incidence"; + return; + } // kDebug() << "getting " << attachments.size() << "attachments"; // kDebug() << mimeData->encodedContent(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolab-0.4.1/shared.i new/libkolab-0.4.2/shared.i --- old/libkolab-0.4.1/shared.i 2013-01-09 13:59:23.000000000 +0100 +++ new/libkolab-0.4.2/shared.i 2013-04-11 11:40:10.000000000 +0200 @@ -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> >; */ }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolab-0.4.1/tests/CMakeLists.txt new/libkolab-0.4.2/tests/CMakeLists.txt --- old/libkolab-0.4.1/tests/CMakeLists.txt 2013-01-09 13:59:23.000000000 +0100 +++ new/libkolab-0.4.2/tests/CMakeLists.txt 2013-04-11 11:40:10.000000000 +0200 @@ -21,3 +21,11 @@ addTest(freebusytest) addTest(kolabobjecttest) addTest(timezonetest) +addTest(xmlobjecttest) + +if(PHP_BINDINGS) + 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() + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolab-0.4.1/tests/kcalconversiontest.h new/libkolab-0.4.2/tests/kcalconversiontest.h --- old/libkolab-0.4.1/tests/kcalconversiontest.h 2013-01-09 13:59:23.000000000 +0100 +++ new/libkolab-0.4.2/tests/kcalconversiontest.h 2013-04-11 11:40:10.000000000 +0200 @@ -20,7 +20,6 @@ #include <QtCore/QObject> #include <QtTest/QtTest> -#include <boost/concept_check.hpp> class KCalConversionTest : public QObject { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolab-0.4.1/tests/testfiles/timezone/windowsTimezone.ics new/libkolab-0.4.2/tests/testfiles/timezone/windowsTimezone.ics --- old/libkolab-0.4.1/tests/testfiles/timezone/windowsTimezone.ics 1970-01-01 01:00:00.000000000 +0100 +++ new/libkolab-0.4.2/tests/testfiles/timezone/windowsTimezone.ics 2013-04-11 11:40:10.000000000 +0200 @@ -0,0 +1,16 @@ +BEGIN:VCALENDAR +PRODID:-//K Desktop Environment//NONSGML libkcal 3.2//EN +VERSION:2.0 +BEGIN:VEVENT +DTSTAMP:20090901T113644Z +CREATED:20090901T113644Z +UID:KOrganizer-1353608432.168 +LAST-MODIFIED:20090901T113644Z +SUMMARY:Windows Event +LOCATION:Here +DTSTART;TZID=Europe/Berlin:20090902T080000 +DTEND;TZID=Europe/Berlin:20090902T090000 +TRANSP:OPAQUE +END:VEVENT + +END:VCALENDAR diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolab-0.4.1/tests/testfiles/timezone/windowsTimezoneV3.mime new/libkolab-0.4.2/tests/testfiles/timezone/windowsTimezoneV3.mime --- old/libkolab-0.4.1/tests/testfiles/timezone/windowsTimezoneV3.mime 1970-01-01 01:00:00.000000000 +0100 +++ new/libkolab-0.4.2/tests/testfiles/timezone/windowsTimezoneV3.mime 2013-04-11 11:40:10.000000000 +0200 @@ -0,0 +1,86 @@ +Date: Thu, 28 Feb 2013 18:22:55 +0000 +X-Kolab-Type: application/x-vnd.kolab.event +X-Kolab-Mime-Version: 3.0 +User-Agent: Libkolab-0.5 +Content-Type: multipart/mixed; boundary="nextPart3504925.NqhbgOChlS" +Subject: KOrganizer-1353608432.168 +MIME-Version: 1.0 + + +--nextPart3504925.NqhbgOChlS +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/get-kolab + +--nextPart3504925.NqhbgOChlS +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> + <properties> + <prodid> + <text>Libkolab-0.5 Libkolabxml-0.8</text> + </prodid> + <version> + <text>2.0</text> + </version> + <x-kolab-version> + <text>3.0dev1</text> + </x-kolab-version> + </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>2009-09-01T11:36:44Z</date-time> + </dtstamp> + <sequence> + <integer>0</integer> + </sequence> + <class> + <text>PUBLIC</text> + </class> + <dtstart> + <parameters> + <tzid> + <text>/kolab.org/W. Europe Standard Time</text> + </tzid> + </parameters> + <date-time>2009-09-02T08:00:00</date-time> + </dtstart> + <dtend> + <parameters> + <tzid> + <text>/kolab.org/W. Europe Standard Time</text> + </tzid> + </parameters> + <date-time>2009-09-02T09:00:00</date-time> + </dtend> + <summary> + <text>Windows Event</text> + </summary> + <location> + <text>Here</text> + </location> + </properties> + </vevent> + </components> + </vcalendar> + +</icalendar> + +--nextPart3504925.NqhbgOChlS-- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolab-0.4.1/tests/testutils.h new/libkolab-0.4.2/tests/testutils.h --- old/libkolab-0.4.1/tests/testutils.h 2013-01-09 13:59:23.000000000 +0100 +++ new/libkolab-0.4.2/tests/testutils.h 2013-04-11 11:40:10.000000000 +0200 @@ -53,20 +53,20 @@ kWarning() << "contents are the same"; return; } - QTemporaryFile expectedFile("expectedFile"); - QTemporaryFile convertedFile("convertedFile"); - if (expectedFile.open() && convertedFile.open()) { - expectedFile.write(expected.toLatin1()); - convertedFile.write(converted.toLatin1()); - expectedFile.close(); - convertedFile.close(); - QProcess::execute("kompare", QStringList() << "-c" << expectedFile.fileName() << convertedFile.fileName()); - } else { - kWarning() << "files are not open"; - } + // QTemporaryFile expectedFile("expectedFile"); + // QTemporaryFile convertedFile("convertedFile"); + // if (expectedFile.open() && convertedFile.open()) { + // expectedFile.write(expected.toLatin1()); + // convertedFile.write(converted.toLatin1()); + // expectedFile.close(); + // convertedFile.close(); + // QProcess::execute("kompare", QStringList() << "-c" << expectedFile.fileName() << convertedFile.fileName()); + // } else { + // kWarning() << "files are not open"; + // } -// qDebug() << "EXPECTED: " << expected; -// qDebug() << "CONVERTED: " << converted; + qDebug() << "EXPECTED: " << expected; + qDebug() << "CONVERTED: " << converted; } KMime::Message::Ptr readMimeFile( const QString &fileName, bool &ok) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolab-0.4.1/tests/timezonetest.cpp new/libkolab-0.4.2/tests/timezonetest.cpp --- old/libkolab-0.4.1/tests/timezonetest.cpp 2013-01-09 13:59:23.000000000 +0100 +++ new/libkolab-0.4.2/tests/timezonetest.cpp 2013-04-11 11:40:10.000000000 +0200 @@ -19,6 +19,7 @@ #include <conversion/timezoneconverter.h> #include <kolabformat/kolabobject.h> #include <kolabformat/errorhandler.h> +#include "testutils.h" #include <QTest> // #include <unicode/uversion.h> @@ -26,6 +27,7 @@ // #include <iostream> #include <kdebug.h> #include <kcalcore/event.h> +#include <kcalcore/icalformat.h> // void icuFoo() // { @@ -99,6 +101,49 @@ QCOMPARE(result->dtStart().timeZone().name(), KTimeZone(QLatin1String("Africa/Lagos")).name()); } +void TimezoneTest::testKolabObjectReader() +{ + const Kolab::Version version = Kolab::KolabV3; + const Kolab::ObjectType type = Kolab::EventObject; + QString icalFileName = TESTFILEDIR+QString::fromLatin1("timezone/windowsTimezone.ics"); //To compare + QString mimeFileName = TESTFILEDIR+QString::fromLatin1("timezone/windowsTimezoneV3.mime"); //For parsing + + //Parse mime message + bool ok = false; + const KMime::Message::Ptr &msg = readMimeFile( mimeFileName, ok ); + QVERIFY(ok); + Kolab::KolabObjectReader reader; + Kolab::ObjectType t = reader.parseMimeMessage(msg); + QCOMPARE(t, type); + QCOMPARE(reader.getVersion(), version); + QCOMPARE(Kolab::ErrorHandler::instance().error(), Kolab::ErrorHandler::Debug); + + KCalCore::Incidence::Ptr convertedIncidence = reader.getIncidence(); + kDebug() << "read incidence"; + + //Parse ICalFile for comparison + QFile icalFile( icalFileName ); + QVERIFY( icalFile.open( QFile::ReadOnly ) ); + KCalCore::ICalFormat format; + KCalCore::Incidence::Ptr realIncidence( format.fromString( QString::fromUtf8( icalFile.readAll() ) ) ); + + // fix up the converted incidence for comparisson + normalizeIncidence(convertedIncidence); + normalizeIncidence(realIncidence); + + // recurrence objects are created on demand, but KCalCore::Incidence::operator==() doesn't take that into account + // so make sure both incidences have one + 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()) ); +} QTEST_MAIN( TimezoneTest ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolab-0.4.1/tests/timezonetest.h new/libkolab-0.4.2/tests/timezonetest.h --- old/libkolab-0.4.1/tests/timezonetest.h 2013-01-09 13:59:23.000000000 +0100 +++ new/libkolab-0.4.2/tests/timezonetest.h 2013-04-11 11:40:10.000000000 +0200 @@ -27,6 +27,7 @@ void testFromHardcodedList_data(); void testFromHardcodedList(); void testKolabObjectWriter(); + void testKolabObjectReader(); }; #endif // TIMEZONETEST_H diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolab-0.4.1/tests/xmlobjecttest.cpp new/libkolab-0.4.2/tests/xmlobjecttest.cpp --- old/libkolab-0.4.1/tests/xmlobjecttest.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/libkolab-0.4.2/tests/xmlobjecttest.cpp 2013-04-11 11:40:10.000000000 +0200 @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2012 Christian Mollekopf <[email protected]> + * + * 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/>. + */ + +#include "xmlobjecttest.h" + +#include <QTest> +#include <iostream> + +#include "kolabformat/xmlobject.h" + +void XMLObjectTest::testEvent() +{ + Kolab::Event event; + event.setStart(Kolab::cDateTime(2012,01,01)); + + Kolab::XMLObject xmlobject; + const std::string output = xmlobject.writeEvent(event, Kolab::KolabV2, "productid"); + QVERIFY(!output.empty()); + std::cout << output; + + const Kolab::Event resultEvent = xmlobject.readEvent(output, Kolab::KolabV2); + QVERIFY(resultEvent.isValid()); + +} + +void XMLObjectTest::testDontCrash() +{ + Kolab::XMLObject ob; + ob.writeEvent(Kolab::Event(), Kolab::KolabV2, ""); + ob.writeTodo(Kolab::Todo(), Kolab::KolabV2, ""); + ob.writeJournal(Kolab::Journal(), Kolab::KolabV2, ""); + ob.writeFreebusy(Kolab::Freebusy(), Kolab::KolabV2, ""); + ob.writeContact(Kolab::Contact(), Kolab::KolabV2, ""); + ob.writeDistlist(Kolab::DistList(), Kolab::KolabV2, ""); + ob.writeNote(Kolab::Note(), Kolab::KolabV2, ""); + ob.writeConfiguration(Kolab::Configuration(), Kolab::KolabV2, ""); + + ob.readEvent("", Kolab::KolabV2); + ob.readTodo("", Kolab::KolabV2); + ob.readJournal("", Kolab::KolabV2); + ob.readFreebusy("", Kolab::KolabV2); + ob.readContact("", Kolab::KolabV2); + ob.readDistlist("", Kolab::KolabV2); + ob.readNote("", Kolab::KolabV2); + ob.readConfiguration("", Kolab::KolabV2); + +} + +QTEST_MAIN( XMLObjectTest ) + +#include "xmlobjecttest.moc" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libkolab-0.4.1/tests/xmlobjecttest.h new/libkolab-0.4.2/tests/xmlobjecttest.h --- old/libkolab-0.4.1/tests/xmlobjecttest.h 1970-01-01 01:00:00.000000000 +0100 +++ new/libkolab-0.4.2/tests/xmlobjecttest.h 2013-04-11 11:40:10.000000000 +0200 @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2012 Christian Mollekopf <[email protected]> + * + * 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 XMLOBJECTTEST_H +#define XMLOBJECTTEST_H + +#include <QObject> + +class XMLObjectTest: public QObject +{ + Q_OBJECT +private slots: + void testEvent(); + void testDontCrash(); +}; + +#endif // XMLOBJECTTEST_H -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
