<table><tr><td style="">dvratil created this revision.<br />Herald added a project: KDE PIM.<br />Herald added a subscriber: kde-pim.<br />dvratil requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D23856">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>The akonadi_control process now reacts to a new KAccounts account being<br />
added, removeda or modified.</p>

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

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

<p>When a particular service is enabled or disabled its treated as if it<br />
were added or removed, so the respective resource is added or removed.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Implemented the org.kde.Akonadi.Accounts service in the Google resources<br />
and tested that creating a new account in the Online Accounts KCM causes<br />
the Akonadi Google resources to be created and configured for the given<br />
account. Removing the account from Online Accounts KCM removes the agents.</p>

<p>Video of the proof of concept: <a href="https://youtu.be/7plCbvfQlA8" class="remarkup-link" target="_blank" rel="noreferrer">https://youtu.be/7plCbvfQlA8</a></p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R165 Akonadi </div></div></div><br /><div><strong>BRANCH</strong><div><div>dev/online-accounts</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D23856">https://phabricator.kde.org/D23856</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>CMakeLists.txt<br />
config-akonadi.h.cmake<br />
src/akonadicontrol/CMakeLists.txt<br />
src/akonadicontrol/accountsintegration.cpp<br />
src/akonadicontrol/accountsintegration.h<br />
src/akonadicontrol/main.cpp<br />
src/interfaces/org.kde.Akonadi.Accounts.xml</div></div></div><br /><div><strong>To: </strong>dvratil<br /><strong>Cc: </strong>kde-pim, fbampaloukas, dvasin, rodsevich, winterz, vkrause, mlaurent, knauss, dvratil<br /></div>