Projects
Kontact:4.13:Development
libkolab
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 4
View file
_service:set_version:libkolab.spec
Changed
@@ -30,7 +30,7 @@ Name: libkolab %endif -Version: 0.6.git.1412585128 +Version: 0.6.git.1415797490 Release: 0%{?dist} Summary: Kolab Object Handling Library @@ -150,6 +150,7 @@ %else %cmake \ %endif + -DBoost_NO_BOOST_CMAKE=TRUE \ -Wno-fatal-errors -Wno-errors \ -DINCLUDE_INSTALL_DIR=%{_includedir} \ %if 0%{?rhel} < 7 && 0%{?fedora} < 17
View file
libkolab.spec
Changed
@@ -150,6 +150,7 @@ %else %cmake \ %endif + -DBoost_NO_BOOST_CMAKE=TRUE \ -Wno-fatal-errors -Wno-errors \ -DINCLUDE_INSTALL_DIR=%{_includedir} \ %if 0%{?rhel} < 7 && 0%{?fedora} < 17
View file
_service:recompress:tar_scm:libkolab-0.6.git.1412585128.tar.gz/CMakeLists.txt -> _service:recompress:tar_scm:libkolab-0.6.git.1415797490.tar.gz/CMakeLists.txt
Changed
@@ -127,6 +127,7 @@ #we have to make sure that we only search in KDE_INCLUDES though, to not accidentally include a system akonadi/tag.h #when we're searching for one in libcalendaring. find_path(HAVE_TAG_H akonadi/tag.h PATHS ${KDE_INCLUDES} NO_DEFAULT_PATH NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH) +find_path(HAVE_RELATION_H akonadi/relation.h PATHS ${KDE_INCLUDES} NO_DEFAULT_PATH NO_SYSTEM_ENVIRONMENT_PATH NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libkolab_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/libkolab_config.h) add_subdirectory(kolabformatV2)
View file
_service:recompress:tar_scm:libkolab-0.6.git.1412585128.tar.gz/kolabformat/kolabobject.cpp -> _service:recompress:tar_scm:libkolab-0.6.git.1415797490.tar.gz/kolabformat/kolabobject.cpp
Changed
@@ -64,13 +64,22 @@ RelationMember parseMemberUrl(const QString &string) { - RelationMember member; + if (string.startsWith("urn:uuid:")) { + RelationMember member; + member.gid = string.mid(9); + return member; + } QUrl url(QUrl::fromPercentEncoding(string.toLatin1())); QList<QByteArray> path = url.encodedPath().split('/'); // qDebug() << path; + bool isShared = false; int start = path.indexOf("user"); if (start < 0) { - Warning() << "Couldn't find \"user\" in path: " << path; + start = path.indexOf("shared"); + isShared = true; + } + if (start < 0) { + Warning() << "Couldn't find \"user\" or \"shared\" in path: " << path; return RelationMember(); } path = path.mid(start + 1); @@ -78,8 +87,10 @@ Warning() << "Incomplete path: " << path; return RelationMember(); } - // user-name - path.removeFirst(); + RelationMember member; + if (!isShared) { + member.user = path.takeFirst(); + } member.uid = path.takeLast().toLong(); member.mailbox = path; member.messageId = url.queryItemValue("message-id"); @@ -101,11 +112,18 @@ KOLAB_EXPORT QString generateMemberUrl(const RelationMember &member) { + if (!member.gid.isEmpty()) { + return QString("urn:uuid:%1").arg(member.gid); + } QUrl url; url.setScheme("imap"); QList<QByteArray> path; - path << "user"; - path << "localuser@localhost"; + if (!member.user.isEmpty()) { + path << "user"; + path << member.user.toLatin1(); + } else { + path << "shared"; + } path << member.mailbox; path << QByteArray::number(member.uid); url.setPath("/" + join(path, "/")); @@ -134,7 +152,7 @@ ObjectType readKolabV2(const KMime::Message::Ptr &msg, Kolab::ObjectType objectType); ObjectType readKolabV3(const KMime::Message::Ptr &msg, Kolab::ObjectType objectType); - + KCalCore::Incidence::Ptr mIncidence; KABC::Addressee mAddressee; KABC::ContactGroup mContactGroup; @@ -144,13 +162,17 @@ ObjectType mObjectType; Version mVersion; Kolab::Freebusy mFreebusy; + ObjectType mOverrideObjectType; + Version mOverrideVersion; + bool mDoOverrideVersion; + +#ifdef HAVE_RELATION_H + Akonadi::Relation mRelation; +#endif #ifdef HAVE_TAG_H Akonadi::Tag mTag; QStringList mTagMembers; #endif - ObjectType mOverrideObjectType; - Version mOverrideVersion; - bool mDoOverrideVersion; }; //@endcond @@ -397,16 +419,36 @@ const Kolab::Configuration &configuration = Kolab::readConfiguration(xml, false); const Kolab::Relation &relation = configuration.relation(); - mTag = Akonadi::Tag(); - mTag.setName(Conversion::fromStdString(relation.name())); - mTag.setGid(Conversion::fromStdString(configuration.uid()).toLatin1()); - mTag.setType(Akonadi::Tag::PLAIN); - - mTagMembers.reserve(relation.members().size()); - foreach (const std::string &member, relation.members()) { - mTagMembers << Conversion::fromStdString(member); + if (relation.type() == "tag") { + mTag = Akonadi::Tag(); + mTag.setName(Conversion::fromStdString(relation.name())); + mTag.setGid(Conversion::fromStdString(configuration.uid()).toLatin1()); + mTag.setType(Akonadi::Tag::PLAIN); + + mTagMembers.reserve(relation.members().size()); + foreach (const std::string &member, relation.members()) { + mTagMembers << Conversion::fromStdString(member); + } + } else if (relation.type() == "generic") { +#ifdef HAVE_RELATION_H + if (relation.members().size() == 2) { + mRelation = Akonadi::Relation(); + mRelation.setRemoteId(Conversion::fromStdString(configuration.uid()).toLatin1()); + mRelation.setType(Akonadi::Relation::GENERIC); + + mTagMembers.reserve(relation.members().size()); + foreach (const std::string &member, relation.members()) { + mTagMembers << Conversion::fromStdString(member); + } + } else { + Critical() << "generic relation had wrong number of members:" << relation.members().size(); + printMessageDebugInfo(msg); + } +#endif + } else { + Critical() << "unknown configuration object type" << relation.type(); + printMessageDebugInfo(msg); } - } break; #endif @@ -537,6 +579,11 @@ } #ifdef HAVE_TAG_H +bool KolabObjectReader::isTag() const +{ + return d->mTag.isValid(); +} + Akonadi::Tag KolabObjectReader::getTag() const { return d->mTag; @@ -548,6 +595,18 @@ } #endif +#ifdef HAVE_RELATION_H +bool KolabObjectReader::isRelation() const +{ + return d->mRelation.isValid(); +} + +Akonadi::Relation KolabObjectReader::getRelation() const +{ + return d->mRelation; +} +#endif + //Normalize incidences before serializing them KCalCore::Incidence::Ptr normalizeIncidence(KCalCore::Incidence::Ptr original) @@ -727,6 +786,15 @@ } #ifdef HAVE_TAG_H +KMime::Message::Ptr writeRelationHelper(const Kolab::Relation &relation, const QByteArray &uid, const QString &productId) +{ + Kolab::Configuration configuration(relation); //TODO preserve creation/lastModified date + configuration.setUid(uid.constData()); + const std::string &v3String = Kolab::writeConfiguration(configuration, Conversion::toStdString(getProductId(productId))); + ErrorHandler::handleLibkolabxmlErrors(); + return Mime::createMessage(Conversion::fromStdString(configuration.uid()), kolabMimeType(), relationKolabType(), Conversion::fromStdString(v3String).toUtf8(), true, getProductId(productId)); +} + KMime::Message::Ptr KolabObjectWriter::writeTag(const Akonadi::Tag &tag, const QStringList &members, Version v, const QString &productId) { ErrorHandler::clearErrors(); @@ -742,17 +810,33 @@ } relation.setMembers(m); - Kolab::Configuration configuration(relation); //TODO preserve creation/lastModified date - configuration.setUid(tag.gid().constData()); - const std::string &v3String = Kolab::writeConfiguration(configuration, Conversion::toStdString(getProductId(productId))); - ErrorHandler::handleLibkolabxmlErrors(); - return Mime::createMessage(Conversion::fromStdString(configuration.uid()), kolabMimeType(), relationKolabType(), Conversion::fromStdString(v3String).toUtf8(), true, getProductId(productId)); + return writeRelationHelper(relation, tag.gid(), productId); } #endif +#ifdef HAVE_RELATION_H +KMime::Message::Ptr KolabObjectWriter::writeRelation(const Akonadi::Relation &relation, const QStringList &items, Version v, const QString &productId) +{ + ErrorHandler::clearErrors(); + if (v != KolabV3) { + Critical() << "only v3 implementation available"; + } + if (items.size() != 2) { + Critical() << "Wrong number of members for generic relation."; + return KMime::Message::Ptr(); + } + Kolab::Relation kolabRelation(std::string(), "generic"); + std::vector<std::string> m; + m.reserve(2); + m.push_back(Conversion::toStdString(items.at(0))); + m.push_back(Conversion::toStdString(items.at(1))); + kolabRelation.setMembers(m); + return writeRelationHelper(kolabRelation, relation.remoteId(), productId); +} +#endif }; //Namespace
View file
_service:recompress:tar_scm:libkolab-0.6.git.1412585128.tar.gz/kolabformat/kolabobject.h -> _service:recompress:tar_scm:libkolab-0.6.git.1415797490.tar.gz/kolabformat/kolabobject.h
Changed
@@ -23,8 +23,12 @@ #include <libkolab_config.h> #ifdef HAVE_TAG_H +#include <akonadi/item.h> #include <akonadi/tag.h> #endif +#ifdef HAVE_RELATION_H +#include <akonadi/relation.h> +#endif #include <kabc/addressee.h> #include <kabc/contactgroup.h> #include <kcalcore/incidence.h> @@ -49,6 +53,7 @@ QList<QByteArray> mailbox; QString user; qint64 uid; + QString gid; }; KOLAB_EXPORT RelationMember parseMemberUrl(const QString &url); KOLAB_EXPORT QString generateMemberUrl(const RelationMember &url); @@ -104,9 +109,14 @@ QStringList getDictionary(QString &lang) const; Freebusy getFreebusy() const; #ifdef HAVE_TAG_H + bool isTag() const; Akonadi::Tag getTag() const; QStringList getTagMembers() const; #endif +#ifdef HAVE_RELATION_H + bool isRelation() const; + Akonadi::Relation getRelation() const; +#endif private: //@cond PRIVATE @@ -134,6 +144,9 @@ #ifdef HAVE_TAG_H static KMime::Message::Ptr writeTag(const Akonadi::Tag &, const QStringList &items, Version v = KolabV3, const QString &productId = QString()); #endif +#ifdef HAVE_RELATION_H + static KMime::Message::Ptr writeRelation(const Akonadi::Relation &, const QStringList &items, Version v = KolabV3, const QString &productId = QString()); +#endif };
View file
_service:recompress:tar_scm:libkolab-0.6.git.1412585128.tar.gz/libkolab_config.h.in -> _service:recompress:tar_scm:libkolab-0.6.git.1415797490.tar.gz/libkolab_config.h.in
Changed
@@ -2,3 +2,5 @@ /* Whether akonadi/tag.h exists. */ #cmakedefine HAVE_TAG_H 1 +/* Whether akonadi/relation.h exists. */ +#cmakedefine HAVE_RELATION_H 1
View file
_service:recompress:tar_scm:libkolab-0.6.git.1412585128.tar.gz/tests/kolabobjecttest.cpp -> _service:recompress:tar_scm:libkolab-0.6.git.1415797490.tar.gz/tests/kolabobjecttest.cpp
Changed
@@ -83,15 +83,14 @@ void KolabObjectTest::parseRelationMembers() { { - // QString memberString("imap:///user/jan.aachen%40lhm.klab.cc/INBOX/20?message-id=%3Cf06aa3345a25005380b47547ad161d36%40lhm.klab.cc%3E&date=Tue%2C+12+Aug+2014+20%3A42%3A59+%2B0200&subject=Re%3A+test"); QString memberString("imap:///user/jan.aachen%40lhm.klab.cc/INBOX/20?message-id=%3Cf06aa3345a25005380b47547ad161d36%40lhm.klab.cc%3E&date=Tue%2C+12+Aug+2014+20%3A42%3A59+%2B0200&subject=Re%3A+test"); Kolab::RelationMember member = Kolab::parseMemberUrl(memberString); - const QString result = Kolab::generateMemberUrl(member); qDebug() << result; } + //user namespace by uid { Kolab::RelationMember member; @@ -106,6 +105,41 @@ Kolab::RelationMember result = Kolab::parseMemberUrl(url); QCOMPARE(result.uid, member.uid); QCOMPARE(result.mailbox, member.mailbox); + QCOMPARE(result.user, member.user); + QCOMPARE(result.messageId, member.messageId); + QCOMPARE(result.date, member.date); + QCOMPARE(result.subject, member.subject); + } + + //shared namespace by uid + { + + Kolab::RelationMember member; + member.uid = 20; + member.mailbox = QList<QByteArray>() << "foo" << "bar"; + member.messageId = "messageid"; + member.date = "date"; + member.subject = "subject"; + QString url = Kolab::generateMemberUrl(member); + qDebug() << url; + Kolab::RelationMember result = Kolab::parseMemberUrl(url); + QCOMPARE(result.uid, member.uid); + QCOMPARE(result.mailbox, member.mailbox); + QVERIFY(result.user.isEmpty()); + QCOMPARE(result.messageId, member.messageId); + QCOMPARE(result.date, member.date); + QCOMPARE(result.subject, member.subject); + } + + //by uuid/gid + { + + Kolab::RelationMember member; + member.gid = "fooobar"; + QString url = Kolab::generateMemberUrl(member); + qDebug() << url; + Kolab::RelationMember result = Kolab::parseMemberUrl(url); + QCOMPARE(result.gid, member.gid); } }
View file
_service:set_version:libkolab.dsc
Changed
@@ -2,7 +2,7 @@ Source: libkolab Binary: libkolab0, php-kolab, python-kolab, libkolab-dev Architecture: any -Version: 0.6.git.1412585128 +Version: 0.6.git.1415797490 Maintainer: Debian Kolab Maintainers <pkg-kolab-devel@lists.alioth.debian.org> Uploaders: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>, Paul Klos <kolab@klos2day.nl> Homepage: http://git.kolab.org/libkolab
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.