Implement a migrator that migrates the user from the legacy Google Calendar
and Google Contacts resources to the new unified Google Groupware Resource.
Details
- Reviewers
poboiko vkrause - Commits
- R44:97c896cae59e: Migrator: implement Google Resource migrator
Diff Detail
- Repository
- R44 KDE PIM Runtime
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
+1. Can't comment on the Google-specifics in there, but the general approach looks good to me, and should in a similar fashion also work for Kolab :)
I've tested it a bit too, on couple of Google accounts.
Apart from couple nitpicks, I think it's good to go.
migration/googlegroupware/CMakeLists.txt | ||
---|---|---|
28 | Is it really needed? It seems like the code is using just the DBus interface | |
migration/googlegroupware/googleresourcemigrator.cpp | ||
33 | Duplicated include | |
79 | What would happen here if only one of the resources was present (e.g. only contacts)? Could instance be invalid here? | |
203 | Although this should not happen, it will probably remove tokens from Wallet (as the result of cleanup procedure for legacy instances). As they store tokens in the same place, it will affect the new instance too. | |
283 | Interval checking options could in principle also come from contacts resource. We can probably merge somewhat it like that: const auto contactSettings = settingsForResource(oldInstances.contactResource); [...] resourceSettings.setEnableIntervalCheck(calendarSettings->value(QStringLiteral("EnableIntervalCheck"), false) || contactSettings->value(QStringLiteral("EnableIntervalCheck"), false)); resourceSettings.setIntervalCheckTime(qMin(calendarSettings->value(QStringLiteral("IntervalCheckTime"), 60).toInt(), contactSettings->value(QStringLiteral("IntervalCheckTime"), 60).toInt())); |
migration/googlegroupware/googleresourcemigrator.cpp | ||
---|---|---|
79 | Well spotted, it would have worked if only calendar were configured, but not if only contacts were configured. |
- Remove unused LibKGAPI dependency
- Make sure we always backup KWallet data before removing instances
- Fix race condition between the resource wiping the KWallet data and the migrator restoring them
- Merge enableIntervalCheck and intervalCheckTime configurations from both resources
- Fix migration when only Contacts resource is set up for an account
I just realized a problem: if we remove the old Google resources from git, then the code that waits for the DBus interface to disappear will fail, because the resources won't be running in the first place.