D28560: [resources] Add a unified Google Groupware Resource (WIP)
Igor Poboiko
noreply at phabricator.kde.org
Sat Apr 4 15:16:25 BST 2020
poboiko created this revision.
poboiko added a reviewer: dvratil.
Herald added a project: KDE PIM.
poboiko requested review of this revision.
REVISION SUMMARY
This is an attempt to unify existing Calendar&Tasks and Contacts resources into
a single Groupware resource. At some point, hopefully, GMail support could be also
added here (see task T646: [Google] Native Gmail resource / Google Groupware <https://phabricator.kde.org/T646> and T9422: Automatic setup of Gmail + Google Calendar/Contacts <https://phabricator.kde.org/T9422>).
Various "subresources" (Calendar, Tasks and Contacts) are implemented as subclasses of `GenericHandler`,
which is a basic `Akonadi::ResourceBase` interface. The resource decides which `Handler` it should call
by looking at mimetypes. `Handlers` are `friends` of `GoogleResource`, so they can call its callbacks
(like `itemsRetrieved()`) as needed. This was done primarily to separate logic of different subresources;
this might be not the best solution, I'm open to suggestions.
This patch also reworks the settings dialog & relevant code.
The dialog is now using `.ui` file. The "account picker" is gone, as it's no longer needed;
instead, a single "Configure..." button is added which invokes the auth process.
It also implements "last sync token" API (T647: [KGAPI] Investigate the new "last sync token" in Google API <https://phabricator.kde.org/T647>) for calendar incremental updates. Without this API,
event moving between calendars were not handled properly (i.e. event was not removed from the "source" calendar).
Work to be done:
1. KAccounts integration. Need to be able to `disable` various `subresources` on demand, and determine auth `scopes` based on that.
2. GMail integration. Need to somehow adopt `ImapResourceBase` / `ResourceState` scheme, and merge it with current `Handlers` scheme.
3. Add `Akonadi::Tag` support for Contacts. Tags seem to be more appropriate than having bunch of virtual collections, but this might require some changes inside KAddressBook.
TEST PLAN
Here's a comprehensive list of what was tested and what issues were discovered.
1. Adding event locally
2. Changing event locally
3. Removing event locally
4. Moving events between calendars locally
5. **Adding calendar locally**
- new calendar is added as a virtual collection, cannot add events there afterwards; probably a KOrganizer issue
- color of newly added calendar is not known, google just don't return it to us
6. Removing calendar locally
7. Changing calendar locally
8. Adding event remotely
9. Changing event remotely
10. Removing event remotely
11. Moving events between calendars remotely
12. Adding calendar remotely
13. Removing calendar remotely
14. Adding task&subtask remotely
15. Changing task locally
16. Removing task locally
17. Removing a task with subtasks locally (subtasks go to the upper level)
18. **Adding/removing tasklist locally**
- wasn't tested, but should work. KOrganizer just don't know how to add a tasklist, it adds a calendar by default (probably it sees no difference between them...)
19. Changing tasklist locally
20. Adding task&subtask remotely
21. Changing task remotely
22. Removing task remotely
23. Adding tasklist remotely (it is not subscribed automatically, however, so user have to go to account settings and enable it)
24. Changing tasklist remotely
25. Removing tasklist remotely
26. Adding contact (including photo) locally, both inside "My Contacts" and "Other Contacts" groups
27. Moving contact between "My Contacts" and "Other Contacts" groups
28. Chaging contact (including photo) locally
29. Removing contat locally
30. Adding contact to contact group locally
- D28432: [Akonadi/PasteHelper] Add support for items linking <https://phabricator.kde.org/D28432> required, otherwise "Link Item" gets silently ignored
31. **Removing contact from contact group locally**
- wasn't tested, since I've found to UI to "Unlink Item" :(
32. Adding contact (including photo) remotely
33. Changing contact (including photo) remotely
34. Removing contact remotely
35. Adding contact to contact group remotely
36. **Removing contact from contact group remotely**
- doesn't work: need an easy way to fetch all collections we're linked to (so we know which UnlinkJobs we should start)
REPOSITORY
R44 KDE PIM Runtime
BRANCH
dev/google-groupware
REVISION DETAIL
https://phabricator.kde.org/D28560
AFFECTED FILES
kdepim-runtime.categories
resources/CMakeLists.txt
resources/google-groupware/CMakeLists.txt
resources/google-groupware/calendarhandler.cpp
resources/google-groupware/calendarhandler.h
resources/google-groupware/contacthandler.cpp
resources/google-groupware/contacthandler.h
resources/google-groupware/defaultreminderattribute.cpp
resources/google-groupware/defaultreminderattribute.h
resources/google-groupware/generichandler.cpp
resources/google-groupware/generichandler.h
resources/google-groupware/googleresource.cpp
resources/google-groupware/googleresource.desktop
resources/google-groupware/googleresource.h
resources/google-groupware/googlesettings.cpp
resources/google-groupware/googlesettings.h
resources/google-groupware/googlesettingsdialog.cpp
resources/google-groupware/googlesettingsdialog.h
resources/google-groupware/googlesettingsdialog.ui
resources/google-groupware/settingsbase.kcfg
resources/google-groupware/settingsbase.kcfgc
resources/google-groupware/taskhandler.cpp
resources/google-groupware/taskhandler.h
To: poboiko, dvratil
Cc: kde-pim, fbampaloukas, dcaliste, dvasin, rodsevich, winterz, vkrause, mlaurent, knauss, dvratil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20200404/20ecfecd/attachment-0001.html>
More information about the kde-pim
mailing list