Commit 981208b1 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Port KAbc -> KContacts

REVIEW: 121011
parent 9bfd7137
......@@ -86,7 +86,7 @@ find_package(KF5AkonadiMime ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5MailTransport ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5IdentityManagement ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiContact ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Abc ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Contacts ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5AlarmCalendar ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5CalendarCore ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5CalendarUtils ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
......
......@@ -31,7 +31,7 @@ target_link_libraries(akonadi_migration_agent
gidmigration
KF5::AkonadiCore
KF5::AkonadiAgentBase
KF5::Abc
KF5::Contacts
)
install(TARGETS akonadi_migration_agent ${INSTALL_TARGETS_DEFAULT_ARGS})
......
......@@ -23,7 +23,7 @@
#include "migrationstatuswidget.h"
#include <migration/gid/gidmigrator.h>
#include <KABC/Addressee>
#include <KContacts/Addressee>
#include <KWindowSystem>
#include <QDialog>
#include <KLocalizedString>
......@@ -38,7 +38,7 @@ MigrationAgent::MigrationAgent(const QString &id)
mScheduler(new KUiServerJobTracker)
{
KLocalizedString::setApplicationDomain( "akonadi_migration_agent" );
mScheduler.addMigrator(QSharedPointer<GidMigrator>(new GidMigrator(KABC::Addressee::mimeType())));
mScheduler.addMigrator(QSharedPointer<GidMigrator>(new GidMigrator(KContacts::Addressee::mimeType())));
}
void MigrationAgent::configure(WId windowId)
......
......@@ -98,8 +98,8 @@ void SpecialNotifierJob::slotSearchJobFinished( KJob *job )
return;
}
if (!searchJob->contacts().isEmpty()) {
const KABC::Addressee addressee = searchJob->contacts().first();
const KABC::Picture photo = addressee.photo();
const KContacts::Addressee addressee = searchJob->contacts().first();
const KContacts::Picture photo = addressee.photo();
const QImage image = photo.data();
if (image.isNull()) {
emitNotification(Util::defaultPixmap());
......
......@@ -19,7 +19,7 @@ if ("${CMAKE_SOURCE_DIR}" STREQUAL "${migration_SOURCE_DIR}")
find_package(KF5KDELibs4Support ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Akonadi ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Mime ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Abc ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Contacts ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5MailTransport ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Mbox ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5PimUtils ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
......
......@@ -2,7 +2,7 @@ set( kaddressbookmigrator_SRCS kaddressbookmigrator.cpp )
add_executable( kaddressbookmigrator ${kaddressbookmigrator_SRCS} )
target_link_libraries(kaddressbookmigrator KF5::Abc KF5::ConfigCore KF5::I18n)
target_link_libraries(kaddressbookmigrator KF5::Contacts KF5::ConfigCore KF5::I18n)
install(TARGETS kaddressbookmigrator ${INSTALL_TARGETS_DEFAULT_ARGS})
install(PROGRAMS kaddressbookmigrator.desktop DESTINATION ${AUTOSTART_INSTALL_DIR})
......@@ -22,7 +22,7 @@
#include <QtCore/QDir>
#include <QtCore/QFile>
#include <kabc/vcardconverter.h>
#include <kcontacts/vcardconverter.h>
#include <kaboutdata.h>
#include <kconfig.h>
......@@ -35,34 +35,34 @@
#include <QCommandLineParser>
#include <QCommandLineOption>
KABC::Addressee::List readContacts( bool *ok )
KContacts::Addressee::List readContacts( bool *ok )
{
const QString fileName = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1String("/kabc/std.vcf") ;
QFile file( fileName );
if ( !file.open( QIODevice::ReadOnly ) ) {
qDebug() << QString::fromLatin1("Unable to open file %1 for reading" ).arg( fileName );
*ok = false;
return KABC::Addressee::List();
return KContacts::Addressee::List();
}
const QByteArray content = file.readAll();
file.close();
KABC::VCardConverter converter;
KContacts::VCardConverter converter;
*ok = true;
return converter.parseVCards( content );
}
bool writeContacts( const KABC::Addressee::List &contacts )
bool writeContacts( const KContacts::Addressee::List &contacts )
{
const QString path = QDir::home().absolutePath() + QLatin1String("/.local/share/contacts/");
if ( !QDir::root().mkpath( path ) )
return false;
KABC::VCardConverter converter;
KContacts::VCardConverter converter;
for ( int i = 0; i < contacts.count(); ++i ) {
const KABC::Addressee contact = contacts.at( i );
const KContacts::Addressee contact = contacts.at( i );
const QByteArray content = converter.createVCard( contact );
const QString fileName = path + QDir::separator() + contact.uid() + QLatin1String(".vcf");
......@@ -87,7 +87,7 @@ void convertAddressBook()
*/
bool ok = false;
const KABC::Addressee::List contacts = readContacts( &ok );
const KContacts::Addressee::List contacts = readContacts( &ok );
if ( !ok )
return;
......
......@@ -26,7 +26,7 @@ add_executable(knotes-migrator ${knotes-migrator_srcs})
target_link_libraries(knotes-migrator
KF5::AkonadiCore
KF5::Abc
KF5::Contacts
${KDEPIMLIBS_KCAL_LIBS}
KF5::Mime
......
......@@ -17,7 +17,7 @@ if ("${CMAKE_SOURCE_DIR}" STREQUAL "${plugins_SOURCE_DIR}")
find_package(KF5KDELibs4Support ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Akonadi ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Mime ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Abc ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Contacts ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5AlarmCalendar ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5CalendarCore ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5CalendarUtils ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
......@@ -32,7 +32,7 @@ add_definitions(-DTRANSLATION_DOMAIN=\"akonadi_serializer_plugins\")
set(akonadi_serializer_addressee_PART_SRCS akonadi_serializer_addressee.cpp )
add_library(akonadi_serializer_addressee MODULE ${SERIALIZER_TYPE} ${akonadi_serializer_addressee_PART_SRCS})
target_link_libraries(akonadi_serializer_addressee KF5::Abc KF5::AkonadiCore KF5::AkonadiAbc)
target_link_libraries(akonadi_serializer_addressee KF5::Contacts KF5::AkonadiCore KF5::AkonadiAbc)
install(TARGETS akonadi_serializer_addressee DESTINATION ${PLUGIN_INSTALL_DIR})
set(akonadi_serializer_mail_PART_SRCS akonadi_serializer_mail.cpp akonadi_serializer_mail_debug.cpp)
......@@ -52,7 +52,7 @@ install(TARGETS akonadi_serializer_bookmark DESTINATION ${PLUGIN_INSTALL_DIR})
set(akonadi_serializer_contactgroup_PART_SRCS akonadi_serializer_contactgroup.cpp )
add_library(akonadi_serializer_contactgroup MODULE ${SERIALIZER_TYPE} ${akonadi_serializer_contactgroup_PART_SRCS})
target_link_libraries(akonadi_serializer_contactgroup KF5::Abc KF5::AkonadiCore KF5::AkonadiContact KF5::AkonadiAbc)
target_link_libraries(akonadi_serializer_contactgroup KF5::Contacts KF5::AkonadiCore KF5::AkonadiContact KF5::AkonadiAbc)
install(TARGETS akonadi_serializer_contactgroup DESTINATION ${PLUGIN_INSTALL_DIR})
set(akonadi_serializer_kalarm_SRCS akonadi_serializer_kalarm.cpp kaeventformatter.cpp akonadi_serializer_kalarm_debug.cpp)
......
......@@ -23,7 +23,7 @@
#include <AkonadiCore/item.h>
#include <akonadi/kabc/contactparts.h>
#include <kabc/addressee.h>
#include <kcontacts/addressee.h>
#include <KLocalizedString>
#include <QDebug>
#include <QtCore/qplugin.h>
......@@ -36,18 +36,18 @@ bool SerializerPluginAddressee::deserialize( Item& item, const QByteArray& label
{
Q_UNUSED( version );
KABC::Addressee addr;
KContacts::Addressee addr;
if ( label == Item::FullPayload ) {
addr = m_converter.parseVCard( data.readAll() );
} else if ( label == Akonadi::ContactPart::Standard ) {
addr = m_converter.parseVCard( data.readAll() );
// remove pictures and sound
addr.setPhoto( KABC::Picture() );
addr.setLogo( KABC::Picture() );
addr.setSound( KABC::Sound() );
addr.setPhoto( KContacts::Picture() );
addr.setLogo( KContacts::Picture() );
addr.setSound( KContacts::Sound() );
} else if ( label == Akonadi::ContactPart::Lookup ) {
const KABC::Addressee temp = m_converter.parseVCard( data.readAll() );
const KContacts::Addressee temp = m_converter.parseVCard( data.readAll() );
// copy only uid, name and email addresses
addr.setUid( temp.uid() );
......@@ -62,7 +62,7 @@ bool SerializerPluginAddressee::deserialize( Item& item, const QByteArray& label
}
if ( !addr.isEmpty() ) {
item.setPayload<KABC::Addressee>( addr );
item.setPayload<KContacts::Addressee>( addr );
} else {
qWarning( ) << "Empty addressee object!";
}
......@@ -77,12 +77,12 @@ void SerializerPluginAddressee::serialize( const Item& item, const QByteArray& l
if ( label != Item::FullPayload && label != Akonadi::ContactPart::Standard && label != Akonadi::ContactPart::Lookup )
return;
if ( !item.hasPayload<KABC::Addressee>() )
if ( !item.hasPayload<KContacts::Addressee>() )
return;
KABC::Addressee addr, temp;
KContacts::Addressee addr, temp;
temp = item.payload<KABC::Addressee>();
temp = item.payload<KContacts::Addressee>();
if ( label == Item::FullPayload ) {
addr = temp;
......@@ -90,9 +90,9 @@ void SerializerPluginAddressee::serialize( const Item& item, const QByteArray& l
addr = temp;
// remove pictures and sound
addr.setPhoto( KABC::Picture() );
addr.setLogo( KABC::Picture() );
addr.setSound( KABC::Sound() );
addr.setPhoto( KContacts::Picture() );
addr.setLogo( KContacts::Picture() );
addr.setSound( KContacts::Sound() );
} else if ( label == Akonadi::ContactPart::Lookup ) {
// copy only uid, name and email addresses
addr.setUid( temp.uid() );
......@@ -117,12 +117,12 @@ static bool compareString( const QString &left, const QString &right )
return left == right;
}
static QString toString( const KABC::PhoneNumber &phoneNumber )
static QString toString( const KContacts::PhoneNumber &phoneNumber )
{
return phoneNumber.number();
}
static QString toString( const KABC::Address &address )
static QString toString( const KContacts::Address &address )
{
return address.toString();
}
......@@ -151,98 +151,98 @@ void SerializerPluginAddressee::compare( Akonadi::AbstractDifferencesReporter *r
const Akonadi::Item &rightItem )
{
Q_ASSERT( reporter );
Q_ASSERT( leftItem.hasPayload<KABC::Addressee>() );
Q_ASSERT( rightItem.hasPayload<KABC::Addressee>() );
Q_ASSERT( leftItem.hasPayload<KContacts::Addressee>() );
Q_ASSERT( rightItem.hasPayload<KContacts::Addressee>() );
reporter->setLeftPropertyValueTitle( i18n( "Changed Contact" ) );
reporter->setRightPropertyValueTitle( i18n( "Conflicting Contact" ) );
const KABC::Addressee leftContact = leftItem.payload<KABC::Addressee>();
const KABC::Addressee rightContact = rightItem.payload<KABC::Addressee>();
const KContacts::Addressee leftContact = leftItem.payload<KContacts::Addressee>();
const KContacts::Addressee rightContact = rightItem.payload<KContacts::Addressee>();
if ( !compareString( leftContact.uid(), rightContact.uid() ) )
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KABC::Addressee::uidLabel(),
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KContacts::Addressee::uidLabel(),
leftContact.uid(), rightContact.uid() );
if ( !compareString( leftContact.name(), rightContact.name() ) )
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KABC::Addressee::nameLabel(),
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KContacts::Addressee::nameLabel(),
leftContact.name(), rightContact.name() );
if ( !compareString( leftContact.formattedName(), rightContact.formattedName() ) )
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KABC::Addressee::formattedNameLabel(),
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KContacts::Addressee::formattedNameLabel(),
leftContact.formattedName(), rightContact.formattedName() );
if ( !compareString( leftContact.familyName(), rightContact.familyName() ) )
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KABC::Addressee::familyNameLabel(),
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KContacts::Addressee::familyNameLabel(),
leftContact.familyName(), rightContact.familyName() );
if ( !compareString( leftContact.givenName(), rightContact.givenName() ) )
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KABC::Addressee::givenNameLabel(),
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KContacts::Addressee::givenNameLabel(),
leftContact.givenName(), rightContact.givenName() );
if ( !compareString( leftContact.additionalName(), rightContact.additionalName() ) )
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KABC::Addressee::additionalNameLabel(),
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KContacts::Addressee::additionalNameLabel(),
leftContact.additionalName(), rightContact.additionalName() );
if ( !compareString( leftContact.prefix(), rightContact.prefix() ) )
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KABC::Addressee::prefixLabel(),
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KContacts::Addressee::prefixLabel(),
leftContact.prefix(), rightContact.prefix() );
if ( !compareString( leftContact.suffix(), rightContact.suffix() ) )
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KABC::Addressee::suffixLabel(),
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KContacts::Addressee::suffixLabel(),
leftContact.suffix(), rightContact.suffix() );
if ( !compareString( leftContact.nickName(), rightContact.nickName() ) )
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KABC::Addressee::nickNameLabel(),
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KContacts::Addressee::nickNameLabel(),
leftContact.nickName(), rightContact.nickName() );
if ( leftContact.birthday() != rightContact.birthday() )
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KABC::Addressee::birthdayLabel(),
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KContacts::Addressee::birthdayLabel(),
leftContact.birthday().toString(), rightContact.birthday().toString() );
if ( !compareString( leftContact.mailer(), rightContact.mailer() ) )
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KABC::Addressee::mailerLabel(),
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KContacts::Addressee::mailerLabel(),
leftContact.mailer(), rightContact.mailer() );
if ( leftContact.timeZone() != rightContact.timeZone() )
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KABC::Addressee::timeZoneLabel(),
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KContacts::Addressee::timeZoneLabel(),
leftContact.timeZone().toString(), rightContact.timeZone().toString() );
if ( leftContact.geo() != rightContact.geo() )
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KABC::Addressee::geoLabel(),
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KContacts::Addressee::geoLabel(),
leftContact.geo().toString(), rightContact.geo().toString() );
if ( !compareString( leftContact.title(), rightContact.title() ) )
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KABC::Addressee::titleLabel(),
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KContacts::Addressee::titleLabel(),
leftContact.title(), rightContact.title() );
if ( !compareString( leftContact.role(), rightContact.role() ) )
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KABC::Addressee::roleLabel(),
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KContacts::Addressee::roleLabel(),
leftContact.role(), rightContact.role() );
if ( !compareString( leftContact.organization(), rightContact.organization() ) )
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KABC::Addressee::organizationLabel(),
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KContacts::Addressee::organizationLabel(),
leftContact.organization(), rightContact.organization() );
if ( !compareString( leftContact.note(), rightContact.note() ) )
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KABC::Addressee::noteLabel(),
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KContacts::Addressee::noteLabel(),
leftContact.note(), rightContact.note() );
if ( !compareString( leftContact.productId(), rightContact.productId() ) )
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KABC::Addressee::productIdLabel(),
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KContacts::Addressee::productIdLabel(),
leftContact.productId(), rightContact.productId() );
if ( !compareString( leftContact.sortString(), rightContact.sortString() ) )
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KABC::Addressee::sortStringLabel(),
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KContacts::Addressee::sortStringLabel(),
leftContact.sortString(), rightContact.sortString() );
if ( leftContact.secrecy() != rightContact.secrecy() ) {
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KABC::Addressee::secrecyLabel(),
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KContacts::Addressee::secrecyLabel(),
leftContact.secrecy().toString(), rightContact.secrecy().toString() );
}
if ( leftContact.url() != rightContact.url() )
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KABC::Addressee::urlLabel(),
reporter->addProperty( AbstractDifferencesReporter::ConflictMode, KContacts::Addressee::urlLabel(),
leftContact.url().toDisplayString(), rightContact.url().toDisplayString() );
compareList( reporter, i18n( "Emails" ), leftContact.emails(), rightContact.emails() );
......@@ -256,10 +256,10 @@ void SerializerPluginAddressee::compare( Akonadi::AbstractDifferencesReporter *r
QString SerializerPluginAddressee::extractGid( const Item& item ) const
{
if ( !item.hasPayload<KABC::Addressee>() ) {
if ( !item.hasPayload<KContacts::Addressee>() ) {
return QString();
}
return item.payload<KABC::Addressee>().uid();
return item.payload<KContacts::Addressee>().uid();
}
......@@ -25,7 +25,7 @@
#include <AkonadiCore/differencesalgorithminterface.h>
#include <AkonadiCore/itemserializerplugin.h>
#include <AkonadiCore/gidextractorinterface.h>
#include <kabc/vcardconverter.h>
#include <kcontacts/vcardconverter.h>
namespace Akonadi {
......@@ -50,7 +50,7 @@ class SerializerPluginAddressee : public QObject,
QString extractGid( const Item& item ) const;
private:
KABC::VCardConverter m_converter;
KContacts::VCardConverter m_converter;
};
}
......
......@@ -24,8 +24,8 @@
#include <AkonadiCore/item.h>
#include <akonadi/kabc/contactparts.h>
#include <kabc/contactgroup.h>
#include <kabc/contactgrouptool.h>
#include <kcontacts/contactgroup.h>
#include <kcontacts/contactgrouptool.h>
#include <KLocalizedString>
#include <QtCore/qplugin.h>
......@@ -39,14 +39,14 @@ bool SerializerPluginContactGroup::deserialize( Item& item, const QByteArray& la
Q_UNUSED( label );
Q_UNUSED( version );
KABC::ContactGroup contactGroup;
KContacts::ContactGroup contactGroup;
if ( !KABC::ContactGroupTool::convertFromXml( &data, contactGroup ) ) {
if ( !KContacts::ContactGroupTool::convertFromXml( &data, contactGroup ) ) {
// TODO: error reporting
return false;
}
item.setPayload<KABC::ContactGroup>( contactGroup );
item.setPayload<KContacts::ContactGroup>( contactGroup );
return true;
}
......@@ -56,10 +56,10 @@ void SerializerPluginContactGroup::serialize( const Item& item, const QByteArray
Q_UNUSED( label );
Q_UNUSED( version );
if ( !item.hasPayload<KABC::ContactGroup>() )
if ( !item.hasPayload<KContacts::ContactGroup>() )
return;
KABC::ContactGroupTool::convertToXml( item.payload<KABC::ContactGroup>(), &data );
KContacts::ContactGroupTool::convertToXml( item.payload<KContacts::ContactGroup>(), &data );
}
//// DifferencesAlgorithmInterface interface
......@@ -72,7 +72,7 @@ static bool compareString( const QString &left, const QString &right )
return left == right;
}
static QString toString( const KABC::Addressee &contact )
static QString toString( const KContacts::Addressee &contact )
{
return contact.fullEmail();
}
......@@ -96,14 +96,14 @@ void SerializerPluginContactGroup::compare( Akonadi::AbstractDifferencesReporter
const Akonadi::Item &rightItem )
{
Q_ASSERT( reporter );
Q_ASSERT( leftItem.hasPayload<KABC::ContactGroup>() );
Q_ASSERT( rightItem.hasPayload<KABC::ContactGroup>() );
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 KABC::ContactGroup leftContactGroup = leftItem.payload<KABC::ContactGroup>();
const KABC::ContactGroup rightContactGroup = rightItem.payload<KABC::ContactGroup>();
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" ),
......@@ -123,10 +123,10 @@ void SerializerPluginContactGroup::compare( Akonadi::AbstractDifferencesReporter
QString SerializerPluginContactGroup::extractGid( const Item &item ) const
{
if ( !item.hasPayload<KABC::ContactGroup>() ) {
if ( !item.hasPayload<KContacts::ContactGroup>() ) {
return QString();
}
return item.payload<KABC::ContactGroup>().id();
return item.payload<KContacts::ContactGroup>().id();
}
//Q_EXPORT_PLUGIN2( akonadi_serializer_contactgroup, Akonadi::SerializerPluginContactGroup )
......
......@@ -30,4 +30,4 @@ endmacro()
add_akonadiplugin_test(mailserializertest.cpp "KF5::Mime" "../akonadi_serializer_mail_debug.cpp")
add_akonadiplugin_test(mailserializerplugintest.cpp "KF5::Mime" "")
add_akonadiplugin_test(kcalcoreserializertest.cpp "KF5::CalendarCore" "")
add_akonadiplugin_test(addresseeserializertest.cpp "KF5::Abc;KF5::AkonadiAbc" "../akonadi_serializer_addressee.cpp")
add_akonadiplugin_test(addresseeserializertest.cpp "KF5::Contacts;KF5::AkonadiAbc" "../akonadi_serializer_addressee.cpp")
......@@ -31,7 +31,7 @@ class AddresseeSerializerTest : public QObject
void testGid()
{
const QString uid(QLatin1String("uid"));
KABC::Addressee addressee;
KContacts::Addressee addressee;
addressee.setUid(uid);
Akonadi::Item item;
item.setMimeType(addressee.mimeType());
......
......@@ -32,7 +32,7 @@ if ("${CMAKE_SOURCE_DIR}" STREQUAL "${resources_SOURCE_DIR}")
find_package(KF5Akonadi ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5CalendarCore ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5PimUtils ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Abc ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Contacts ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiMime ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5PimIdentities ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5MailTransport ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
......
......@@ -30,7 +30,7 @@ target_link_libraries(akonadi_birthdays_resource
KF5::CalendarCore
KF5::PimUtils
KF5::AkonadiAgentBase
KF5::Abc
KF5::Contacts
)
install( TARGETS akonadi_birthdays_resource ${INSTALL_TARGETS_DEFAULT_ARGS} )
......
......@@ -30,7 +30,7 @@
#include <monitor.h>
#include <entitydisplayattribute.h>
#include <kabc/addressee.h>
#include <kcontacts/addressee.h>
#include <KPIMUtils/Email>
......@@ -39,7 +39,7 @@
#include <KWindowSystem>
using namespace Akonadi;
using namespace KABC;
using namespace KContacts;
using namespace KCalCore;
......@@ -141,10 +141,10 @@ void BirthdaysResource::contactRetrieved(KJob* job)
void BirthdaysResource::contactChanged( const Akonadi::Item& item )
{
if ( !item.hasPayload<KABC::Addressee>() )
if ( !item.hasPayload<KContacts::Addressee>() )
return;
KABC::Addressee contact = item.payload<KABC::Addressee>();
KContacts::Addressee contact = item.payload<KContacts::Addressee>();
if ( Settings::self()->filterOnCategories() ) {
bool hasCategory = false;
......@@ -218,9 +218,9 @@ void BirthdaysResource::createEvents(const Akonadi::Item::List &items)
KCalCore::Event::Ptr BirthdaysResource::createBirthday(const Akonadi::Item& contactItem)
{
if ( !contactItem.hasPayload<KABC::Addressee>() )
if ( !contactItem.hasPayload<KContacts::Addressee>() )
return KCalCore::Event::Ptr();
KABC::Addressee contact = contactItem.payload<KABC::Addressee>();
KContacts::Addressee contact = contactItem.payload<KContacts::Addressee>();
const QString name = contact.realName().isEmpty() ? contact.nickName() : contact.realName();
if ( name.isEmpty() ) {
......@@ -249,9 +249,9 @@ KCalCore::Event::Ptr BirthdaysResource::createBirthday(const Akonadi::Item& cont
KCalCore::Event::Ptr BirthdaysResource::createAnniversary(const Akonadi::Item& contactItem)
{
if ( !contactItem.hasPayload<KABC::Addressee>() )
if ( !contactItem.hasPayload<KContacts::Addressee>() )
return KCalCore::Event::Ptr();
KABC::Addressee contact = contactItem.payload<KABC::Addressee>();
KContacts::Addressee contact = contactItem.payload<KContacts::Addressee>();
const QString name = contact.realName().isEmpty() ? contact.nickName() : contact.realName();