Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
KDE PIM Runtime
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PIM
KDE PIM Runtime
Commits
981208b1
Commit
981208b1
authored
Nov 07, 2014
by
Aleix Pol Gonzalez
🐧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port KAbc -> KContacts
REVIEW: 121011
parent
9bfd7137
Changes
48
Hide whitespace changes
Inline
Side-by-side
Showing
48 changed files
with
327 additions
and
327 deletions
+327
-327
CMakeLists.txt
CMakeLists.txt
+1
-1
agents/migration/CMakeLists.txt
agents/migration/CMakeLists.txt
+1
-1
agents/migration/migrationagent.cpp
agents/migration/migrationagent.cpp
+2
-2
agents/newmailnotifier/specialnotifierjob.cpp
agents/newmailnotifier/specialnotifierjob.cpp
+2
-2
migration/CMakeLists.txt
migration/CMakeLists.txt
+1
-1
migration/kaddressbook/CMakeLists.txt
migration/kaddressbook/CMakeLists.txt
+1
-1
migration/kaddressbook/kaddressbookmigrator.cpp
migration/kaddressbook/kaddressbookmigrator.cpp
+8
-8
migration/knotes/CMakeLists.txt
migration/knotes/CMakeLists.txt
+1
-1
plugins/CMakeLists.txt
plugins/CMakeLists.txt
+3
-3
plugins/akonadi_serializer_addressee.cpp
plugins/akonadi_serializer_addressee.cpp
+42
-42
plugins/akonadi_serializer_addressee.h
plugins/akonadi_serializer_addressee.h
+2
-2
plugins/akonadi_serializer_contactgroup.cpp
plugins/akonadi_serializer_contactgroup.cpp
+14
-14
plugins/autotests/CMakeLists.txt
plugins/autotests/CMakeLists.txt
+1
-1
plugins/autotests/addresseeserializertest.cpp
plugins/autotests/addresseeserializertest.cpp
+1
-1
resources/CMakeLists.txt
resources/CMakeLists.txt
+1
-1
resources/birthdays/CMakeLists.txt
resources/birthdays/CMakeLists.txt
+1
-1
resources/birthdays/birthdaysresource.cpp
resources/birthdays/birthdaysresource.cpp
+9
-9
resources/contacts/CMakeLists.txt
resources/contacts/CMakeLists.txt
+1
-1
resources/contacts/contactsresource.cpp
resources/contacts/contactsresource.cpp
+21
-21
resources/contacts/contactsresource.h
resources/contacts/contactsresource.h
+4
-4
resources/dav/common/davutils.cpp
resources/dav/common/davutils.cpp
+10
-10
resources/dav/protocols/carddavprotocol.cpp
resources/dav/protocols/carddavprotocol.cpp
+2
-2
resources/dav/resource/CMakeLists.txt
resources/dav/resource/CMakeLists.txt
+1
-1
resources/dav/resource/davgroupwareresource.cpp
resources/dav/resource/davgroupwareresource.cpp
+4
-4
resources/facebook/CMakeLists.txt
resources/facebook/CMakeLists.txt
+1
-1
resources/google/contacts/CMakeLists.txt
resources/google/contacts/CMakeLists.txt
+1
-1
resources/google/contacts/contactsresource.cpp
resources/google/contacts/contactsresource.cpp
+20
-20
resources/kdeaccounts/CMakeLists.txt
resources/kdeaccounts/CMakeLists.txt
+1
-1
resources/kdeaccounts/kdeaccountsresource.cpp
resources/kdeaccounts/kdeaccountsresource.cpp
+4
-4
resources/kdeaccounts/kdeaccountsresource.h
resources/kdeaccounts/kdeaccountsresource.h
+2
-2
resources/kolab/CMakeLists.txt
resources/kolab/CMakeLists.txt
+1
-1
resources/kolab/kolabhelpers.cpp
resources/kolab/kolabhelpers.cpp
+22
-22
resources/kolabproxy/CMakeLists.txt
resources/kolabproxy/CMakeLists.txt
+1
-1
resources/kolabproxy/addressbookhandler.cpp
resources/kolabproxy/addressbookhandler.cpp
+23
-23
resources/kolabproxy/autotests/CMakeLists.txt
resources/kolabproxy/autotests/CMakeLists.txt
+1
-1
resources/kolabproxy/autotests/kolabconvertertest.cpp
resources/kolabproxy/autotests/kolabconvertertest.cpp
+4
-4
resources/kolabproxy/kolabhandler.cpp
resources/kolabproxy/kolabhandler.cpp
+3
-3
resources/openxchange/CMakeLists.txt
resources/openxchange/CMakeLists.txt
+1
-1
resources/openxchange/openxchangeresource.cpp
resources/openxchange/openxchangeresource.cpp
+23
-23
resources/openxchange/oxa/contactutils.cpp
resources/openxchange/oxa/contactutils.cpp
+41
-41
resources/openxchange/oxa/object.cpp
resources/openxchange/oxa/object.cpp
+4
-4
resources/openxchange/oxa/object.h
resources/openxchange/oxa/object.h
+8
-8
resources/vcard/CMakeLists.txt
resources/vcard/CMakeLists.txt
+1
-1
resources/vcard/vcardresource.cpp
resources/vcard/vcardresource.cpp
+11
-11
resources/vcard/vcardresource.h
resources/vcard/vcardresource.h
+4
-4
resources/vcarddir/CMakeLists.txt
resources/vcarddir/CMakeLists.txt
+1
-1
resources/vcarddir/vcarddirresource.cpp
resources/vcarddir/vcarddirresource.cpp
+11
-11
resources/vcarddir/vcarddirresource.h
resources/vcarddir/vcarddirresource.h
+4
-4
No files found.
CMakeLists.txt
View file @
981208b1
...
...
@@ -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
(
KF5
Abc
${
KDEPIMLIBS_LIB_VERSION
}
CONFIG REQUIRED
)
find_package
(
KF5
Contacts
${
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
)
...
...
agents/migration/CMakeLists.txt
View file @
981208b1
...
...
@@ -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
}
)
...
...
agents/migration/migrationagent.cpp
View file @
981208b1
...
...
@@ -23,7 +23,7 @@
#include "migrationstatuswidget.h"
#include <migration/gid/gidmigrator.h>
#include <K
ABC
/Addressee>
#include <K
Contacts
/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
(
K
ABC
::
Addressee
::
mimeType
())));
mScheduler
.
addMigrator
(
QSharedPointer
<
GidMigrator
>
(
new
GidMigrator
(
K
Contacts
::
Addressee
::
mimeType
())));
}
void
MigrationAgent
::
configure
(
WId
windowId
)
...
...
agents/newmailnotifier/specialnotifierjob.cpp
View file @
981208b1
...
...
@@ -98,8 +98,8 @@ void SpecialNotifierJob::slotSearchJobFinished( KJob *job )
return
;
}
if
(
!
searchJob
->
contacts
().
isEmpty
())
{
const
K
ABC
::
Addressee
addressee
=
searchJob
->
contacts
().
first
();
const
K
ABC
::
Picture
photo
=
addressee
.
photo
();
const
K
Contacts
::
Addressee
addressee
=
searchJob
->
contacts
().
first
();
const
K
Contacts
::
Picture
photo
=
addressee
.
photo
();
const
QImage
image
=
photo
.
data
();
if
(
image
.
isNull
())
{
emitNotification
(
Util
::
defaultPixmap
());
...
...
migration/CMakeLists.txt
View file @
981208b1
...
...
@@ -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
(
KF5
Abc
${
KDEPIMLIBS_LIB_VERSION
}
CONFIG REQUIRED
)
find_package
(
KF5
Contacts
${
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
)
...
...
migration/kaddressbook/CMakeLists.txt
View file @
981208b1
...
...
@@ -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
}
)
migration/kaddressbook/kaddressbookmigrator.cpp
View file @
981208b1
...
...
@@ -22,7 +22,7 @@
#include <QtCore/QDir>
#include <QtCore/QFile>
#include <k
abc
/vcardconverter.h>
#include <k
contacts
/vcardconverter.h>
#include <kaboutdata.h>
#include <kconfig.h>
...
...
@@ -35,34 +35,34 @@
#include <QCommandLineParser>
#include <QCommandLineOption>
K
ABC
::
Addressee
::
List
readContacts
(
bool
*
ok
)
K
Contacts
::
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
K
ABC
::
Addressee
::
List
();
return
K
Contacts
::
Addressee
::
List
();
}
const
QByteArray
content
=
file
.
readAll
();
file
.
close
();
K
ABC
::
VCardConverter
converter
;
K
Contacts
::
VCardConverter
converter
;
*
ok
=
true
;
return
converter
.
parseVCards
(
content
);
}
bool
writeContacts
(
const
K
ABC
::
Addressee
::
List
&
contacts
)
bool
writeContacts
(
const
K
Contacts
::
Addressee
::
List
&
contacts
)
{
const
QString
path
=
QDir
::
home
().
absolutePath
()
+
QLatin1String
(
"/.local/share/contacts/"
);
if
(
!
QDir
::
root
().
mkpath
(
path
)
)
return
false
;
K
ABC
::
VCardConverter
converter
;
K
Contacts
::
VCardConverter
converter
;
for
(
int
i
=
0
;
i
<
contacts
.
count
();
++
i
)
{
const
K
ABC
::
Addressee
contact
=
contacts
.
at
(
i
);
const
K
Contacts
::
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
K
ABC
::
Addressee
::
List
contacts
=
readContacts
(
&
ok
);
const
K
Contacts
::
Addressee
::
List
contacts
=
readContacts
(
&
ok
);
if
(
!
ok
)
return
;
...
...
migration/knotes/CMakeLists.txt
View file @
981208b1
...
...
@@ -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
...
...
plugins/CMakeLists.txt
View file @
981208b1
...
...
@@ -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
(
KF5
Abc
${
KDEPIMLIBS_LIB_VERSION
}
CONFIG REQUIRED
)
find_package
(
KF5
Contacts
${
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
)
...
...
plugins/akonadi_serializer_addressee.cpp
View file @
981208b1
...
...
@@ -23,7 +23,7 @@
#include <AkonadiCore/item.h>
#include <akonadi/kabc/contactparts.h>
#include <k
abc
/addressee.h>
#include <k
contacts
/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
);
K
ABC
::
Addressee
addr
;
K
Contacts
::
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
(
K
ABC
::
Picture
()
);
addr
.
setLogo
(
K
ABC
::
Picture
()
);
addr
.
setSound
(
K
ABC
::
Sound
()
);
addr
.
setPhoto
(
K
Contacts
::
Picture
()
);
addr
.
setLogo
(
K
Contacts
::
Picture
()
);
addr
.
setSound
(
K
Contacts
::
Sound
()
);
}
else
if
(
label
==
Akonadi
::
ContactPart
::
Lookup
)
{
const
K
ABC
::
Addressee
temp
=
m_converter
.
parseVCard
(
data
.
readAll
()
);
const
K
Contacts
::
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
<
K
ABC
::
Addressee
>
(
addr
);
item
.
setPayload
<
K
Contacts
::
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
<
K
ABC
::
Addressee
>
()
)
if
(
!
item
.
hasPayload
<
K
Contacts
::
Addressee
>
()
)
return
;
K
ABC
::
Addressee
addr
,
temp
;
K
Contacts
::
Addressee
addr
,
temp
;
temp
=
item
.
payload
<
K
ABC
::
Addressee
>
();
temp
=
item
.
payload
<
K
Contacts
::
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
(
K
ABC
::
Picture
()
);
addr
.
setLogo
(
K
ABC
::
Picture
()
);
addr
.
setSound
(
K
ABC
::
Sound
()
);
addr
.
setPhoto
(
K
Contacts
::
Picture
()
);
addr
.
setLogo
(
K
Contacts
::
Picture
()
);
addr
.
setSound
(
K
Contacts
::
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
K
ABC
::
PhoneNumber
&
phoneNumber
)
static
QString
toString
(
const
K
Contacts
::
PhoneNumber
&
phoneNumber
)
{
return
phoneNumber
.
number
();
}
static
QString
toString
(
const
K
ABC
::
Address
&
address
)
static
QString
toString
(
const
K
Contacts
::
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
<
K
ABC
::
Addressee
>
()
);
Q_ASSERT
(
rightItem
.
hasPayload
<
K
ABC
::
Addressee
>
()
);
Q_ASSERT
(
leftItem
.
hasPayload
<
K
Contacts
::
Addressee
>
()
);
Q_ASSERT
(
rightItem
.
hasPayload
<
K
Contacts
::
Addressee
>
()
);
reporter
->
setLeftPropertyValueTitle
(
i18n
(
"Changed Contact"
)
);
reporter
->
setRightPropertyValueTitle
(
i18n
(
"Conflicting Contact"
)
);
const
K
ABC
::
Addressee
leftContact
=
leftItem
.
payload
<
KABC
::
Addressee
>
();
const
K
ABC
::
Addressee
rightContact
=
rightItem
.
payload
<
KABC
::
Addressee
>
();
const
K
Contacts
::
Addressee
leftContact
=
leftItem
.
payload
<
KContacts
::
Addressee
>
();
const
K
Contacts
::
Addressee
rightContact
=
rightItem
.
payload
<
KContacts
::
Addressee
>
();
if
(
!
compareString
(
leftContact
.
uid
(),
rightContact
.
uid
()
)
)
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
ABC
::
Addressee
::
uidLabel
(),
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
Contacts
::
Addressee
::
uidLabel
(),
leftContact
.
uid
(),
rightContact
.
uid
()
);
if
(
!
compareString
(
leftContact
.
name
(),
rightContact
.
name
()
)
)
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
ABC
::
Addressee
::
nameLabel
(),
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
Contacts
::
Addressee
::
nameLabel
(),
leftContact
.
name
(),
rightContact
.
name
()
);
if
(
!
compareString
(
leftContact
.
formattedName
(),
rightContact
.
formattedName
()
)
)
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
ABC
::
Addressee
::
formattedNameLabel
(),
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
Contacts
::
Addressee
::
formattedNameLabel
(),
leftContact
.
formattedName
(),
rightContact
.
formattedName
()
);
if
(
!
compareString
(
leftContact
.
familyName
(),
rightContact
.
familyName
()
)
)
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
ABC
::
Addressee
::
familyNameLabel
(),
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
Contacts
::
Addressee
::
familyNameLabel
(),
leftContact
.
familyName
(),
rightContact
.
familyName
()
);
if
(
!
compareString
(
leftContact
.
givenName
(),
rightContact
.
givenName
()
)
)
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
ABC
::
Addressee
::
givenNameLabel
(),
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
Contacts
::
Addressee
::
givenNameLabel
(),
leftContact
.
givenName
(),
rightContact
.
givenName
()
);
if
(
!
compareString
(
leftContact
.
additionalName
(),
rightContact
.
additionalName
()
)
)
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
ABC
::
Addressee
::
additionalNameLabel
(),
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
Contacts
::
Addressee
::
additionalNameLabel
(),
leftContact
.
additionalName
(),
rightContact
.
additionalName
()
);
if
(
!
compareString
(
leftContact
.
prefix
(),
rightContact
.
prefix
()
)
)
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
ABC
::
Addressee
::
prefixLabel
(),
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
Contacts
::
Addressee
::
prefixLabel
(),
leftContact
.
prefix
(),
rightContact
.
prefix
()
);
if
(
!
compareString
(
leftContact
.
suffix
(),
rightContact
.
suffix
()
)
)
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
ABC
::
Addressee
::
suffixLabel
(),
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
Contacts
::
Addressee
::
suffixLabel
(),
leftContact
.
suffix
(),
rightContact
.
suffix
()
);
if
(
!
compareString
(
leftContact
.
nickName
(),
rightContact
.
nickName
()
)
)
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
ABC
::
Addressee
::
nickNameLabel
(),
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
Contacts
::
Addressee
::
nickNameLabel
(),
leftContact
.
nickName
(),
rightContact
.
nickName
()
);
if
(
leftContact
.
birthday
()
!=
rightContact
.
birthday
()
)
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
ABC
::
Addressee
::
birthdayLabel
(),
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
Contacts
::
Addressee
::
birthdayLabel
(),
leftContact
.
birthday
().
toString
(),
rightContact
.
birthday
().
toString
()
);
if
(
!
compareString
(
leftContact
.
mailer
(),
rightContact
.
mailer
()
)
)
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
ABC
::
Addressee
::
mailerLabel
(),
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
Contacts
::
Addressee
::
mailerLabel
(),
leftContact
.
mailer
(),
rightContact
.
mailer
()
);
if
(
leftContact
.
timeZone
()
!=
rightContact
.
timeZone
()
)
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
ABC
::
Addressee
::
timeZoneLabel
(),
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
Contacts
::
Addressee
::
timeZoneLabel
(),
leftContact
.
timeZone
().
toString
(),
rightContact
.
timeZone
().
toString
()
);
if
(
leftContact
.
geo
()
!=
rightContact
.
geo
()
)
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
ABC
::
Addressee
::
geoLabel
(),
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
Contacts
::
Addressee
::
geoLabel
(),
leftContact
.
geo
().
toString
(),
rightContact
.
geo
().
toString
()
);
if
(
!
compareString
(
leftContact
.
title
(),
rightContact
.
title
()
)
)
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
ABC
::
Addressee
::
titleLabel
(),
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
Contacts
::
Addressee
::
titleLabel
(),
leftContact
.
title
(),
rightContact
.
title
()
);
if
(
!
compareString
(
leftContact
.
role
(),
rightContact
.
role
()
)
)
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
ABC
::
Addressee
::
roleLabel
(),
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
Contacts
::
Addressee
::
roleLabel
(),
leftContact
.
role
(),
rightContact
.
role
()
);
if
(
!
compareString
(
leftContact
.
organization
(),
rightContact
.
organization
()
)
)
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
ABC
::
Addressee
::
organizationLabel
(),
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
Contacts
::
Addressee
::
organizationLabel
(),
leftContact
.
organization
(),
rightContact
.
organization
()
);
if
(
!
compareString
(
leftContact
.
note
(),
rightContact
.
note
()
)
)
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
ABC
::
Addressee
::
noteLabel
(),
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
Contacts
::
Addressee
::
noteLabel
(),
leftContact
.
note
(),
rightContact
.
note
()
);
if
(
!
compareString
(
leftContact
.
productId
(),
rightContact
.
productId
()
)
)
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
ABC
::
Addressee
::
productIdLabel
(),
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
Contacts
::
Addressee
::
productIdLabel
(),
leftContact
.
productId
(),
rightContact
.
productId
()
);
if
(
!
compareString
(
leftContact
.
sortString
(),
rightContact
.
sortString
()
)
)
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
ABC
::
Addressee
::
sortStringLabel
(),
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
Contacts
::
Addressee
::
sortStringLabel
(),
leftContact
.
sortString
(),
rightContact
.
sortString
()
);
if
(
leftContact
.
secrecy
()
!=
rightContact
.
secrecy
()
)
{
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
ABC
::
Addressee
::
secrecyLabel
(),
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
Contacts
::
Addressee
::
secrecyLabel
(),
leftContact
.
secrecy
().
toString
(),
rightContact
.
secrecy
().
toString
()
);
}
if
(
leftContact
.
url
()
!=
rightContact
.
url
()
)
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
ABC
::
Addressee
::
urlLabel
(),
reporter
->
addProperty
(
AbstractDifferencesReporter
::
ConflictMode
,
K
Contacts
::
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
<
K
ABC
::
Addressee
>
()
)
{
if
(
!
item
.
hasPayload
<
K
Contacts
::
Addressee
>
()
)
{
return
QString
();
}
return
item
.
payload
<
K
ABC
::
Addressee
>
().
uid
();
return
item
.
payload
<
K
Contacts
::
Addressee
>
().
uid
();
}
plugins/akonadi_serializer_addressee.h
View file @
981208b1
...
...
@@ -25,7 +25,7 @@
#include <AkonadiCore/differencesalgorithminterface.h>
#include <AkonadiCore/itemserializerplugin.h>
#include <AkonadiCore/gidextractorinterface.h>
#include <k
abc
/vcardconverter.h>
#include <k
contacts
/vcardconverter.h>
namespace
Akonadi
{
...
...
@@ -50,7 +50,7 @@ class SerializerPluginAddressee : public QObject,
QString
extractGid
(
const
Item
&
item
)
const
;
private:
K
ABC
::
VCardConverter
m_converter
;
K
Contacts
::
VCardConverter
m_converter
;
};
}
...
...
plugins/akonadi_serializer_contactgroup.cpp
View file @
981208b1
...
...
@@ -24,8 +24,8 @@
#include <AkonadiCore/item.h>
#include <akonadi/kabc/contactparts.h>
#include <k
abc
/contactgroup.h>
#include <k
abc
/contactgrouptool.h>
#include <k
contacts
/contactgroup.h>
#include <k
contacts
/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
);
K
ABC
::
ContactGroup
contactGroup
;
K
Contacts
::
ContactGroup
contactGroup
;
if
(
!
K
ABC
::
ContactGroupTool
::
convertFromXml
(
&
data
,
contactGroup
)
)
{
if
(
!
K
Contacts
::
ContactGroupTool
::
convertFromXml
(
&
data
,
contactGroup
)
)
{
// TODO: error reporting
return
false
;
}
item
.
setPayload
<
K
ABC
::
ContactGroup
>
(
contactGroup
);
item
.
setPayload
<
K
Contacts
::
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
<
K
ABC
::
ContactGroup
>
()
)
if
(
!
item
.
hasPayload
<
K
Contacts
::
ContactGroup
>
()
)
return
;
K
ABC
::
ContactGroupTool
::
convertToXml
(
item
.
payload
<
KABC
::
ContactGroup
>
(),
&
data
);
K
Contacts
::
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
K
ABC
::
Addressee
&
contact
)
static
QString
toString
(
const
K
Contacts
::
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
<
K
ABC
::
ContactGroup
>
()
);
Q_ASSERT
(
rightItem
.
hasPayload
<
K
ABC
::
ContactGroup
>
()
);
Q_ASSERT
(
leftItem
.
hasPayload
<
K
Contacts
::
ContactGroup
>
()
);
Q_ASSERT
(
rightItem
.
hasPayload
<
K
Contacts
::
ContactGroup
>
()
);
reporter
->
setLeftPropertyValueTitle
(
i18n
(
"Changed Contact Group"
)
);
reporter
->
setRightPropertyValueTitle
(
i18n
(
"Conflicting Contact Group"
)
);
const
K
ABC
::
ContactGroup
leftContactGroup
=
leftItem
.
payload
<
KABC
::
ContactGroup
>
();
const
K
ABC
::
ContactGroup
rightContactGroup
=
rightItem
.
payload
<
KABC
::
ContactGroup
>
();
const
K
Contacts
::
ContactGroup
leftContactGroup
=
leftItem
.
payload
<
KContacts
::
ContactGroup
>
();
const
K
Contacts
::
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
<
K
ABC
::
ContactGroup
>
()
)
{
if
(
!
item
.
hasPayload
<
K
Contacts
::
ContactGroup
>
()
)
{
return
QString
();
}
return
item
.
payload
<
K
ABC
::
ContactGroup
>
().
id
();
return
item
.
payload
<
K
Contacts
::
ContactGroup
>
().
id
();
}
//Q_EXPORT_PLUGIN2( akonadi_serializer_contactgroup, Akonadi::SerializerPluginContactGroup )
...
...
plugins/autotests/CMakeLists.txt
View file @
981208b1
...
...
@@ -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"
)
plugins/autotests/addresseeserializertest.cpp
View file @
981208b1
...
...
@@ -31,7 +31,7 @@ class AddresseeSerializerTest : public QObject
void
testGid
()
{
const
QString
uid
(
QLatin1String
(
"uid"
));
K
ABC
::
Addressee
addressee
;
K
Contacts
::
Addressee
addressee
;
addressee
.
setUid
(
uid
);
Akonadi
::
Item
item
;
item
.
setMimeType
(
addressee
.
mimeType
());
...
...
resources/CMakeLists.txt
View file @
981208b1
...
...
@@ -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
(
KF5
Abc
${
KDEPIMLIBS_LIB_VERSION
}
CONFIG REQUIRED
)
find_package
(
KF5
Contacts
${
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
)
...
...
resources/birthdays/CMakeLists.txt
View file @
981208b1
...
...
@@ -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
}
)
...
...
resources/birthdays/birthdaysresource.cpp
View file @
981208b1
...
...
@@ -30,7 +30,7 @@
#include <monitor.h>
#include <entitydisplayattribute.h>
#include <k
abc
/addressee.h>
#include <k
contacts
/addressee.h>
#include <KPIMUtils/Email>
...
...
@@ -39,7 +39,7 @@
#include <KWindowSystem>
using
namespace
Akonadi
;
using
namespace
K
ABC
;
using
namespace
K
Contacts
;
using
namespace
KCalCore
;
...
...
@@ -141,10 +141,10 @@ void BirthdaysResource::contactRetrieved(KJob* job)
void
BirthdaysResource
::
contactChanged
(
const
Akonadi
::
Item
&
item
)
{
if
(
!
item
.
hasPayload
<
K
ABC
::
Addressee
>
()
)
if
(
!
item
.
hasPayload
<
K
Contacts
::
Addressee
>
()
)
return
;
K
ABC
::
Addressee
contact
=
item
.
payload
<
KABC
::
Addressee
>
();
K
Contacts
::
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
<
K
ABC
::
Addressee
>
()
)
if
(
!
contactItem
.
hasPayload
<
K
Contacts
::
Addressee
>
()
)
return
KCalCore
::
Event
::
Ptr
();
K
ABC
::
Addressee
contact
=
contactItem
.
payload
<
KABC
::
Addressee
>
();
K
Contacts
::
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
<
K
ABC
::
Addressee
>
()
)
if
(
!
contactItem
.
hasPayload
<
K
Contacts
::
Addressee
>
()
)
return
KCalCore
::
Event
::
Ptr
();
K
ABC
::
Addressee
contact
=
contactItem
.
payload
<
KABC
::
Addressee
>
();
K
Contacts
::
Addressee
contact
=
contactItem
.
payload
<
KContacts
::
Addressee
>
();
const
QString
name
=
contact
.
realName
().
isEmpty
()
?
contact
.
nickName
()
:
contact
.
realName
();