Bug 413078

Summary: Can't change name of akonadi EWS resource (sort of)
Product: [Applications] kdepim Reporter: Leandro Lucarella <leandro.lucarella>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: minor CC: craig.finnegan
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Korganizer
KMail folder view
KMail accounts view
KMail akonadi console

Description Leandro Lucarella 2019-10-17 09:07:20 UTC
Created attachment 123266 [details]
Korganizer

SUMMARY

When adding an akonadi EWS resource, I change the name of the account to something more meaningful than akonadi_ews_resource_1, but even when in Akonadi Console and KMail settings is shown as expected, in the tree views of KMail, Kontact and KOrganizer it still shows the akonadi_ews_resource_1 name.

STEPS TO REPRODUCE
1. Create a new EWS resource/account
2. Rename it to other than the generated default name
3. Open KMail/Korganizer/Kontact

OBSERVED RESULT

The generated default name is used as the account name/root folder.

EXPECTED RESULT

The chosen name is used as the account name/root folder.


SOFTWARE/OS VERSIONS
Operating System: Debian GNU/Linux 
KDE Plasma Version: 5.14.5
Qt Version: 5.11.3
KDE Frameworks Version: 5.62.0
Kernel Version: 5.2.0-3-amd64
OS Type: 64-bit
Processors: 4 × Intel® Core™ i7-7500U CPU @ 2.70GHz
Memory: 23.1 GiB of RAM

ADDITIONAL INFORMATION

kdepim-runtime 4:18.08.3-4
Comment 1 Leandro Lucarella 2019-10-17 09:09:53 UTC
Created attachment 123267 [details]
KMail folder view
Comment 2 Leandro Lucarella 2019-10-17 09:10:12 UTC
Created attachment 123268 [details]
KMail accounts view
Comment 3 Leandro Lucarella 2019-10-17 09:10:32 UTC
Created attachment 123269 [details]
KMail akonadi console
Comment 4 Craig 2020-01-29 00:02:23 UTC
Same issue here - wondering if right clicking the root item in the folder list and doing Folder Properties, then renaming it there, would do it but hesitant only because finally got EWS working with my work email (large inbox would never sync) haha - did you ever try anything else or just stuck with it as-is for time being as well?
Comment 5 Igor Poboiko 2020-03-21 13:14:19 UTC
Git commit 4484df3d6f0c449ec2cfd4956175eab507f4cc55 by Igor Poboiko.
Committed on 21/03/2020 at 13:14.
Pushed by poboiko into branch 'master'.

[resources/ews] Adjust name of root collection to the name of the resource

Summary:
The name of root collection inside the Akonadi DB (and thus, i.e. inside KMail)
is always `akonadi_ews_resource#`, even if the resource itself was renamed.
Even though we call `mRootCollection->setName(name())`, the name get's
overriden after we fetch it from DB.
The settings UI changes the name of the resource, but not root collection.

This patch runs `CollectionModifyJob` to rename the root collection in both
scenarios: either when we fetch root collection or change the resource name.
Related: bug 416663

Test Plan:
1) Open KMail -> Settings -> Accounts -> Receiving -> EWS account
2) Change "Account Name", save
3) The change gets applied to Mailbox View inside KMail UI immediately

Reviewers: dvratil, nowicki

Reviewed By: dvratil

Subscribers: kde-pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D27817

M  +13   -0    resources/ews/ewsresource.cpp
M  +1    -0    resources/ews/ewsresource.h

https://commits.kde.org/kdepim-runtime/4484df3d6f0c449ec2cfd4956175eab507f4cc55