Commit aa0e6410 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖

Import Akonadi Serializer plugins for contacts from kdepim-runtime

See commit cde643e6d840d591b6ae1b7f1a49488c495c4774 in kdepim-runtime
for details.
parent 9d15a2e8
......@@ -60,6 +60,7 @@ endif()
add_subdirectory(src)
add_subdirectory(kcm)
add_subdirectory(serializers)
install( FILES akonadi-contacts.renamecategories akonadi-contacts.categories DESTINATION ${KDE_INSTALL_CONFDIR} )
......
add_definitions(-DTRANSLATION_DOMAIN=\"akonadicontact5-serializer\")
if (BUILD_TESTING)
add_subdirectory(autotests)
endif()
set(akonadi_serializer_addressee_SRCS
akonadi_serializer_addressee.cpp
)
add_library(akonadi_serializer_addressee MODULE ${akonadi_serializer_addressee_SRCS})
target_link_libraries(akonadi_serializer_addressee
KF5::Contacts
KF5::AkonadiCore
KF5::I18n
)
install(TARGETS akonadi_serializer_addressee
DESTINATION ${KDE_INSTALL_PLUGINDIR}
)
install(FILES akonadi_serializer_addressee.desktop
DESTINATION ${KDE_INSTALL_DATADIR}/akonadi/plugins/serializer
)
set(akonadi_serializer_contactgroup_SRCS
akonadi_serializer_contactgroup.cpp
)
add_library(akonadi_serializer_contactgroup MODULE ${akonadi_serializer_contactgroup_SRCS})
target_link_libraries(akonadi_serializer_contactgroup
KF5::Contacts
KF5::AkonadiCore
KF5::I18n
KF5::AkonadiContact
)
install(TARGETS akonadi_serializer_contactgroup
DESTINATION ${KDE_INSTALL_PLUGINDIR}
)
install(FILES akonadi_serializer_contactgroup.desktop
DESTINATION ${KDE_INSTALL_DATADIR}/akonadi/plugins/serializer
)
#!/bin/sh
$XGETTEXT `find . -name \*.cpp | grep -v '/autotests/'` -o $podir/akonadicontact5-serializer.pot
This diff is collapsed.
[Misc]
Name=Addressee Serializer
Name[ar]=مُسلسِل المخاطبين
Name[bs]=Serializator adresiranog
Name[ca]=Serialitzador de destinataris
Name[ca@valencia]=Serialitzador de destinataris
Name[da]=Serieordning af adressater
Name[de]=Empfänger-Serialisierung
Name[el]=Σειριακοποιητής παραληπτών
Name[en_GB]=Addressee Serialiser
Name[es]=Serializador de destinatarios
Name[et]=Aadresside jadasti
Name[fi]=Vastaanottajaserialisoija
Name[fr]=Sérialiseur de destinataires
Name[ga]=Srathóir Seolaithe
Name[gl]=Serializador de destinatarios
Name[hu]=Címzettkezelő
Name[ia]=Divulgator partial pro adresses
Name[it]=Serializzatore degli indirizzi
Name[ja]=受信者用シリアライザ
Name[kk]=Адрес тізбектеуіші
Name[km]=ម៉ាស៊ីន​បោះពុម្ព​អ្នក​ទទួល​សំបុត្រ
Name[ko]=주소록 시리얼라이저
Name[lt]=Adresatų serializatorius
Name[lv]=Adrešu serializētājs
Name[nb]=Adressatserialisator
Name[nds]=Adressaten-Reegmoduul
Name[ne]=प्रापक मिलानकर्ता
Name[nl]=Adressenadministratie
Name[nn]=Adressatserialisator
Name[pa]=ਐਡਰੈੱਸ ਸੀਰੀਅਲਾਈਜ਼ਰ
Name[pl]=Szeregowanie adresatów
Name[pt]=Serializador de Destinatários
Name[pt_BR]=Serializador de destinatários
Name[ro]=Serializator destinatar
Name[ru]=Сохранение контактов
Name[sk]=Serializátor adresátov
Name[sl]=Razvrščevalnik naslovnikov v zaporedje
Name[sr]=Серијализатор адресаната
Name[sr@ijekavian]=Серијализатор адресаната
Name[sr@ijekavianlatin]=Serijalizator adresanata
Name[sr@latin]=Serijalizator adresanata
Name[sv]=Adressatserialisering
Name[tr]=Adres Sıralandırıcı
Name[uk]=Серіалізатор адрес
Name[x-test]=xxAddressee Serializerxx
Name[zh_CN]=收信人序列转换器
Name[zh_TW]=地址序列器
Comment=An Akonadi serializer plugin for addressee objects
Comment[ar]=ملحقة سَلسَلة «أكونادي» لكائنات المخاطبين
Comment[bs]=Akonadi serializator za adresirane objekte
Comment[ca]=Un connector de serialització de l'Akonadi pels objectes destinataris
Comment[ca@valencia]=Un connector de serialització de l'Akonadi pels objectes destinataris
Comment[da]=Et Akonadi-plugin til serieordning af adressatobjekter
Comment[de]=Akonadi-Modul zur Serialisierung von Adressobjekten
Comment[el]=Ένα πρόσθετο σειριακοποιητή του Akonadi για αντικείμενα παραληπτών
Comment[en_GB]=An Akonadi serialiser plugin for addressee objects
Comment[es]=Un complemento serializador de Akonadi para objetos destinatario
Comment[et]=Akonadi aadressiobjektide jadastamisplugin
Comment[fi]=Akonadi-serialisoijaliitännäinen vastaanottajaobjekteille
Comment[fr]=Un module externe Akonadi pour la sérialisation des destinataires
Comment[ga]=Breiseán srathóra Akonadi le haghaidh seolaithe
Comment[gl]=Complemento de serialización do Akonadi para obxectos destinatario
Comment[hu]=Akonadi-modul a címzettek kezeléséhez
Comment[ia]=Un plug-in pro divulgator partial de Akonadi pro objectos de adresses
Comment[it]=Un'estensione di Akonadi per la serializzazione degli indirizzi
Comment[ja]=受信者オブジェクトのための Akonadi シリアライザプラグイン
Comment[kk]=Akonadi адресат нысандарының тізбектеуіш плагині
Comment[km]=កម្មវិធី​ជំនួយ​កម្មវិធី​បោះពុម្ព Akonadi សម្រាប់​វត្ថុ​អ្នក​ទទួល​សំបុត្រ
Comment[ko]=주소 객체를 위한 시리얼라이저 플러그인
Comment[lt]=Akonadi adresatų objektų serializatoriaus papildinys
Comment[lv]=Akonadi adrešu serializēšanas spraudnis
Comment[nb]=Et Akonadi programtillegg for serialisering av adressat-objekter
Comment[nds]=Akonadi-Inreegmoduul för Adressaten
Comment[ne]=प्रापक वस्तुका लागि एउटा एकोनाडी मिलानकर्ता प्लगइन
Comment[nl]=Een administratieplug-in voor Akonadi voor adressen
Comment[nn]=Eit Akonadi-serialisatortillegg for adressatobjekt
Comment[pa]=ਐਡਰੈੱਸ ਆਬਜੈਕਟਾਂ ਲਈ ਅਕੌਂਡੀ ਸੀਰੀਲਾਈਜ਼ਰ ਪਲੱਗਇਨ
Comment[pl]=Wtyczka Akonadi do szeregowania obiektów adresata
Comment[pt]=Um 'plugin' de serialização do Akonadi para os objectos endereçados
Comment[pt_BR]=Um plugin de serialização do Akonadi para os objetos dos destinatários
Comment[ro]=Modul de serializare Akonadi pentru obiecte „destinatar”
Comment[ru]=Модуль сохранения контактов для Akonadi
Comment[sk]=Plugin serializátora Akonadi pre objekty adresátov
Comment[sl]=Akonadijev vstavek za razvrščanje predmetov naslovnikov v zaporedje
Comment[sr]=Аконадијев прикључак серијализатора за објекте адресаната
Comment[sr@ijekavian]=Аконадијев прикључак серијализатора за објекте адресаната
Comment[sr@ijekavianlatin]=Akonadijev priključak serijalizatora za objekte adresanata
Comment[sr@latin]=Akonadijev priključak serijalizatora za objekte adresanata
Comment[sv]=Ett insticksprogram till Akonadi för serialisering av adressatobjekt
Comment[tr]=Adres nesneleri için bir Akonadi sıralandırıcısı
Comment[uk]=Додаток серіалізації Akonadi для об'єктів адресатів
Comment[x-test]=xxAn Akonadi serializer plugin for addressee objectsxx
Comment[zh_CN]=对收信人对象进行序列转换的 Akonadi 插件
Comment[zh_TW]=地址物件的 Akonadi 序列器外掛程式
[Plugin]
Type=text/vcard,text/directory
X-Akonadi-Class=legacy;default;KContacts::Addressee;
X-KDE-Library=akonadi_serializer_addressee
X-KDE-ClassName=Akonadi::SerializerPluginAddressee
/*
Copyright (c) 2007 Till Adam <adam@kde.org>
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This library 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 Library General Public
License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
*/
#ifndef __AKONADI_SERIALIZER_ADDRESSEE_H__
#define __AKONADI_SERIALIZER_ADDRESSEE_H__
#include <QObject>
#include <AkonadiCore/differencesalgorithminterface.h>
#include <AkonadiCore/itemserializerplugin.h>
#include <AkonadiCore/gidextractorinterface.h>
#include <kcontacts/vcardconverter.h>
namespace Akonadi {
class SerializerPluginAddressee : public QObject
, public ItemSerializerPlugin
, public DifferencesAlgorithmInterface
, public GidExtractorInterface
{
Q_OBJECT
Q_INTERFACES(Akonadi::ItemSerializerPlugin)
Q_INTERFACES(Akonadi::DifferencesAlgorithmInterface)
Q_INTERFACES(Akonadi::GidExtractorInterface)
Q_PLUGIN_METADATA(IID "org.kde.akonadi.SerializerPluginAddressee")
public:
bool deserialize(Item &item, const QByteArray &label, QIODevice &data, int version) override;
void serialize(const Item &item, const QByteArray &label, QIODevice &data, int &version) override;
void compare(Akonadi::AbstractDifferencesReporter *reporter, const Akonadi::Item &leftItem, const Akonadi::Item &rightItem) override;
QString extractGid(const Item &item) const override;
private:
KContacts::VCardConverter m_converter;
};
}
#endif
/*
Copyright (c) 2008 Kevin Krammer <kevin.krammer@gmx.at>
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This library 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 Library General Public
License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
*/
#include "akonadi_serializer_contactgroup.h"
#include <AkonadiCore/abstractdifferencesreporter.h>
#include <Akonadi/Contact/ContactGroupExpandJob>
#include <AkonadiCore/item.h>
#include <kcontacts/contactgroup.h>
#include <kcontacts/contactgrouptool.h>
#include <KLocalizedString>
#include <qplugin.h>
using namespace Akonadi;
//// ItemSerializerPlugin interface
bool SerializerPluginContactGroup::deserialize(Item &item, const QByteArray &label, QIODevice &data, int version)
{
Q_UNUSED(label);
Q_UNUSED(version);
KContacts::ContactGroup contactGroup;
if (!KContacts::ContactGroupTool::convertFromXml(&data, contactGroup)) {
// TODO: error reporting
return false;
}
item.setPayload<KContacts::ContactGroup>(contactGroup);
return true;
}
void SerializerPluginContactGroup::serialize(const Item &item, const QByteArray &label, QIODevice &data, int &version)
{
Q_UNUSED(label);
Q_UNUSED(version);
if (!item.hasPayload<KContacts::ContactGroup>()) {
return;
}
KContacts::ContactGroupTool::convertToXml(item.payload<KContacts::ContactGroup>(), &data);
}
//// DifferencesAlgorithmInterface interface
static bool compareString(const QString &left, const QString &right)
{
if (left.isEmpty() && right.isEmpty()) {
return true;
} else {
return left == right;
}
}
static QString toString(const KContacts::Addressee &contact)
{
return contact.fullEmail();
}
template<class T>
static void compareVector(AbstractDifferencesReporter *reporter, const QString &id, const QVector<T> &left, const QVector<T> &right)
{
for (int i = 0; i < left.count(); ++i) {
if (!right.contains(left[ i ])) {
reporter->addProperty(AbstractDifferencesReporter::AdditionalLeftMode, id, toString(left[ i ]), QString());
}
}
for (int i = 0; i < right.count(); ++i) {
if (!left.contains(right[ i ])) {
reporter->addProperty(AbstractDifferencesReporter::AdditionalRightMode, id, QString(), toString(right[ i ]));
}
}
}
void SerializerPluginContactGroup::compare(Akonadi::AbstractDifferencesReporter *reporter, const Akonadi::Item &leftItem, const Akonadi::Item &rightItem)
{
Q_ASSERT(reporter);
Q_ASSERT(leftItem.hasPayload<KContacts::ContactGroup>());
Q_ASSERT(rightItem.hasPayload<KContacts::ContactGroup>());
reporter->setLeftPropertyValueTitle(i18n("Changed Contact Group"));
reporter->setRightPropertyValueTitle(i18n("Conflicting Contact Group"));
const KContacts::ContactGroup leftContactGroup = leftItem.payload<KContacts::ContactGroup>();
const KContacts::ContactGroup rightContactGroup = rightItem.payload<KContacts::ContactGroup>();
if (!compareString(leftContactGroup.name(), rightContactGroup.name())) {
reporter->addProperty(AbstractDifferencesReporter::ConflictMode, i18n("Name"),
leftContactGroup.name(), rightContactGroup.name());
}
// using job->exec() is ok here, not a hot path
Akonadi::ContactGroupExpandJob *leftJob = new Akonadi::ContactGroupExpandJob(leftContactGroup);
leftJob->exec();
Akonadi::ContactGroupExpandJob *rightJob = new Akonadi::ContactGroupExpandJob(rightContactGroup);
rightJob->exec();
compareVector(reporter, i18n("Member"), leftJob->contacts(), rightJob->contacts());
}
//// GidExtractorInterface
QString SerializerPluginContactGroup::extractGid(const Item &item) const
{
if (!item.hasPayload<KContacts::ContactGroup>()) {
return QString();
}
return item.payload<KContacts::ContactGroup>().id();
}
[Misc]
Name=Contact Group Serializer
Name[ar]=مُسلسِل مجموعات المتراسلين
Name[bs]=Serializator kontaktne grupe
Name[ca]=Serialitzador de grup de contactes
Name[ca@valencia]=Serialitzador de grup de contactes
Name[da]=Serieordning af kontaktgruppe
Name[de]=Kontaktgruppen-Serialisierung
Name[el]=Σειριακοποιητής ομάδας επαφών
Name[en_GB]=Contact Group Serialiser
Name[es]=Serializador de grupos de contactos
Name[et]=Kontaktirühma jadasti
Name[fi]=Yhteystietoryhmäserialisoija
Name[fr]=Sérialiseur de groupes de contacts
Name[ga]=Srathóir Grúpa Teagmhálacha
Name[gl]=Serializador de grupos de contacto
Name[hu]=Névjegycsoport-kezelő
Name[ia]=Divulgator partial de gruppo de contactos
Name[it]=Serializzatore gruppi di contatti
Name[ja]=連絡先グループ用シリアライザ
Name[kk]=Контакт тобын тізбектеуіші
Name[km]=អ្នក​ដាក់​លេខ​សៀរៀល​ក្រុម​ទំនាក់ទំនង
Name[ko]=연락처 그룹 시리얼라이저
Name[lt]=Adresatų grupių serializatorius
Name[lv]=Kontaktu grupu serializētājs
Name[nb]=Kontaktgruppeserialisator
Name[nds]=Kontaktkoppel-Reegmoduul
Name[nl]=Contactgroepadministratie
Name[nn]=Kontaktgruppeserialisator
Name[pa]=ਸੰਪਰਕ ਗਰੁੱਪ ਸੀਰੀਅਲਾਈਜ਼ਰ
Name[pl]=Szeregowanie grup kontaktów
Name[pt]=Serializador de Grupos de Contactos
Name[pt_BR]=Serializador de grupos de contatos
Name[ro]=Serializator grupuri de contacte
Name[ru]=Сохранение групп контактов
Name[sk]=Serializátor skupín kontaktov
Name[sl]=Razvrščevalnik skupin stikov v zaporedje
Name[sr]=Серијализатор група контаката
Name[sr@ijekavian]=Серијализатор група контаката
Name[sr@ijekavianlatin]=Serijalizator grupa kontakata
Name[sr@latin]=Serijalizator grupa kontakata
Name[sv]=Kontaktgruppserialisering
Name[tr]=Kişi Grubu Sıralandırıcı
Name[uk]=Серіалізатор груп контактів
Name[x-test]=xxContact Group Serializerxx
Name[zh_CN]=联系人分组序列转换器
Name[zh_TW]=聯絡人群組序列器
Comment=An Akonadi serializer plugin for contact group objects
Comment[ar]=ملحقة سَلسَلة «أكونادي» لكائنات مجموعات المتراسلين
Comment[bs]=Akonadi dodatak serializatora za objekte kontakt grupe
Comment[ca]=Un connector de serialització de l'Akonadi pels objectes de grup de contactes
Comment[ca@valencia]=Un connector de serialització de l'Akonadi pels objectes de grup de contactes
Comment[da]=Et Akonadi-plugin til serieordning af kontaktgruppeobjekter
Comment[de]=Akonadi-Modul zur Serialisierung von Kontaktgruppen
Comment[el]=Ένα πρόσθετο σειριακοποιητή Akonadi για αντικείμενα ομάδων επαφών
Comment[en_GB]=An Akonadi serialiser plugin for contact group objects
Comment[es]=Un complemento serializador de Akonadi para objetos de grupos de contacto
Comment[et]=Akonadi kontaktirühma objektide jadastamisplugin
Comment[fi]=Akonadi-serialisoijaliitännäinen yhteystietoryhmäobjekteille
Comment[fr]=Un module externe Akonadi pour la sérialisation des groupes de contacts
Comment[ga]=Breiseán srathóra Akonadi le haghaidh grúpaí teagmhálacha
Comment[gl]=Complemento de serialización do Akonadi para obxectos de grupo de contacto
Comment[hu]=Akonadi-modul névjegycsoportok kezeléséhez
Comment[ia]=Un plug-in pro divulgator partial de Akonadi pro objectos de gruppo de contactos
Comment[it]=Un'estensione di Akonadi per la serializzazione dei gruppi di contatti
Comment[ja]=連絡先グループオブジェクトのための Akonadi シリアライザプラグイン
Comment[kk]=Akonadi контакт тобы нысандарының тізбектеуіш плагині
Comment[km]=កម្មវិធី​ជំនួយ​អ្នក​ដាក់លេខ​សៀរៀល Akonadi សម្រាប់​វត្ថុ​ក្រុម​ទំនាក់ទំនង
Comment[ko]=연락처 그룹 객체를 위한 Akonadi 시리얼라이저 플러그인
Comment[lt]=Akonadi serializatoriaus papildinys adresatų grupių objektams
Comment[lv]=Akonadi kontaktu grupu serializēšanas spraudnis
Comment[nb]=Et Akonadi programtillegg for serialisering av kontaktgruppe-objekter
Comment[nds]=Akonadi-Inreegmoduul för Kontaktkoppeln
Comment[nl]=Een administratieplug-in voor Akonadi voor contactgroepobjecten
Comment[nn]=Eit Akonadi-serialisatortillegg for kontaktgruppeobjekt
Comment[pa]=ਸੰਪਰਕ ਗਰੁੱਪ ਆਬਜੈਕਟਾਂ ਲਈ ਅਕੌਂਡੀ ਸੀਰੀਲਾਈਜ਼ਰ ਪਲੱਗਇਨ
Comment[pl]=Wtyczka Akonadi do szeregowania obiektów grup kontaktów
Comment[pt]=Um 'plugin' de serialização do Akonadi para os objectos de grupos de contactos
Comment[pt_BR]=Um plugin de serialização do Akonadi para os objetos de grupos de contatos
Comment[ro]=Modul de serializare Akonadi pentru obiecte „grup de contacte”
Comment[ru]=Модуль сохранения групп контактов для Akonadi
Comment[sk]=Plugin serializátora Akonadi pre objekty skupín kontaktov
Comment[sl]=Akonadijev vstavek za razvrščanje predmetov skupin stikov v zaporedje
Comment[sr]=Аконадијев прикључак серијализатора за објекте група контаката
Comment[sr@ijekavian]=Аконадијев прикључак серијализатора за објекте група контаката
Comment[sr@ijekavianlatin]=Akonadijev priključak serijalizatora za objekte grupa kontakata
Comment[sr@latin]=Akonadijev priključak serijalizatora za objekte grupa kontakata
Comment[sv]=Ett insticksprogram till Akonadi för serialisering av kontaktgruppobjekt
Comment[tr]=Kişi grubu nesneleri için bir Akonadi sıralandırıcısı
Comment[uk]=Додаток серіалізації Akonadi для об'єктів груп контактів
Comment[x-test]=xxAn Akonadi serializer plugin for contact group objectsxx
Comment[zh_CN]=对联系人分组对象进行序列转换的 Akonadi 插件
Comment[zh_TW]=聯絡人群組物件的 Akonadi 序列器外掛程式
[Plugin]
Type=application/x-vnd.kde.contactgroup
X-Akonadi-Class=legacy;default;KContacts::ContactGroup;
X-KDE-Library=akonadi_serializer_contactgroup
X-KDE-ClassName=Akonadi::SerializerPluginContactGroup
/*
Copyright (c) 2008 Kevin Krammer <kevin.krammer@gmx.at>
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This library 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 Library General Public
License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
*/
#ifndef __AKONADI_SERIALIZER_CONTACTGROUP_H__
#define __AKONADI_SERIALIZER_CONTACTGROUP_H__
#include <QObject>
#include <AkonadiCore/differencesalgorithminterface.h>
#include <AkonadiCore/itemserializerplugin.h>
#include <AkonadiCore/gidextractorinterface.h>
namespace Akonadi {
/**
* @since 4.2
*/
class SerializerPluginContactGroup : public QObject
, public ItemSerializerPlugin
, public DifferencesAlgorithmInterface
, public GidExtractorInterface
{
Q_OBJECT
Q_INTERFACES(Akonadi::ItemSerializerPlugin)
Q_INTERFACES(Akonadi::DifferencesAlgorithmInterface)
Q_INTERFACES(Akonadi::GidExtractorInterface)
Q_PLUGIN_METADATA(IID "org.kde.akonadi.SerializerPluginContactGroup")
public:
bool deserialize(Item &item, const QByteArray &label, QIODevice &data, int version) override;
void serialize(const Item &item, const QByteArray &label, QIODevice &data, int &version) override;
void compare(Akonadi::AbstractDifferencesReporter *reporter, const Akonadi::Item &leftItem, const Akonadi::Item &rightItem) override;
QString extractGid(const Item &item) const override;
};
}
#endif
include(ECMAddTests)
ecm_add_test(addresseeserializertest.cpp ../akonadi_serializer_addressee.cpp
LINK_LIBRARIES KF5::AkonadiCore KF5::AkonadiContact KF5::Contacts KF5::I18n Qt5::Core Qt5::Test
TEST_NAME addresseeserializertest
)
/*
Copyright (c) 2013 Christian Mollekopf <mollekopf@kolabsys.com>
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
This library 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 Library General Public
License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA.
*/
#include <AkonadiCore/Item>
#include <QTest>
#include <QObject>
#include "../akonadi_serializer_addressee.h"
using namespace Akonadi;
class AddresseeSerializerTest : public QObject
{
Q_OBJECT
private Q_SLOTS:
void testGid()
{
const QString uid(QStringLiteral("uid"));
KContacts::Addressee addressee;
addressee.setUid(uid);
Akonadi::Item item;
item.setMimeType(addressee.mimeType());
item.setPayload(addressee);
SerializerPluginAddressee plugin;
const QString gid = plugin.extractGid(item);
QCOMPARE(gid, uid);
}
};
QTEST_MAIN(AddresseeSerializerTest)
#include "addresseeserializertest.moc"
add_definitions(-DTRANSLATION_DOMAIN=\"akonadicontact5\")
add_subdirectory(contact-editor)
add_subdirectory(akonadi-contacts)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment