Introduce (optional) KAccounts integration into akonadi_control

Authored by dvratil on Tue, Sep 10, 8:42 PM.



The akonadi_control process now reacts to a new KAccounts account being
added, removeda or modified.

When a new KAccounts account is added it looks for the KAccounts services
provided by the account (e.g. contacts, calendars, ...) and it checks the
service details for which agent type can handle this service (e.g. the
google-calendar service can be handled by the akonadi_googlecalendar_resource)
and then it creates a new instance of the resource and calls its new
org.kde.Akonadi.Accounts DBus interface to set the KAccounts account ID,
so the resource can configure itself.

When a KAccounts account is removed, it scans all current resources if
they implement the org.kde.Akonadi.Accounts interface and if they are
configured for the removed account - and if so, it removes them.

When a particular service is enabled or disabled its treated as if it
were added or removed, so the respective resource is added or removed.

Test Plan

Implemented the org.kde.Akonadi.Accounts service in the Google resources
and tested that creating a new account in the Online Accounts KCM causes
the Akonadi Google resources to be created and configured for the given
account. Removing the account from Online Accounts KCM removes the agents.

Video of the proof of concept:

Diff Detail

R165 Akonadi
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
dvratil created this revision.Tue, Sep 10, 8:42 PM
Restricted Application added a project: KDE PIM. · View Herald TranscriptTue, Sep 10, 8:42 PM
Restricted Application added a subscriber: kde-pim. · View Herald Transcript
dvratil requested review of this revision.Tue, Sep 10, 8:42 PM
vkrause accepted this revision.Tue, Sep 10, 9:49 PM
This revision is now accepted and ready to land.Tue, Sep 10, 9:49 PM