DAV resource: propagate color changes to the server
ClosedPublic

Authored by dfaure on Apr 18 2020, 9:41 AM.

Details

Summary

The resource didn't implement collectionChanged at all.

Now it does; saving colors work. I realized this meant renaming
folders didn't work either. But that's for another commit because
there are dragons due to the tree structure being flattened.

Depends on D28937 to actually trigger the collection modify job.

Test Plan

Change color in korganizer, refresh roundcube, it shows the new color.

What I'm not sure about is what "Disable color" is supposed to do.
The code says "save an invalid color". OK... but what does it mean for the user?
Right now the calendar just gets some random color instead. What purpose does this serve?
Why not remove this action, which would remove a submenu i.e. improve usability?

Diff Detail

Repository
R44 KDE PIM Runtime
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 25412
Build 25430: arc lint + arc unit
dfaure created this revision.Apr 18 2020, 9:41 AM
Restricted Application added a project: KDE PIM. · View Herald TranscriptApr 18 2020, 9:41 AM
Restricted Application added a subscriber: kde-pim. · View Herald Transcript
dfaure requested review of this revision.Apr 18 2020, 9:41 AM
dvratil requested changes to this revision.Apr 18 2020, 10:36 AM
dvratil added inline comments.
resources/dav/resource/davgroupwareresource.cpp
613

If the color is not valid, the job is basically a no-op. Could that potentially cause some issues? Maybe you should just add an else branch that calls changeCommitted() and returns immediately.

This revision now requires changes to proceed.Apr 18 2020, 10:36 AM
dfaure added inline comments.Apr 18 2020, 10:55 AM
resources/dav/resource/davgroupwareresource.cpp
613

That's *exactly* what I had initially. But as soon as this job does more than color -- like handling renamings -- then this approach doesn't work anymore.

The only issue is a job that changes nothing, this doesn't give any errors. And since we can't know here which attributes of the collection have changed, this will happen many times.

But see also my question about whether it actually makes sense to have an invalid color for a calendar, at all. From a user's point of view, I don't see it.

dvratil accepted this revision.Apr 18 2020, 12:11 PM
dvratil added inline comments.
resources/dav/resource/davgroupwareresource.cpp
613

Yeah, I also do not understand the point of "Disable Color" if it just ends up assigning a random one...IMO it can be removed.

Regarding this code, guarding against invalid QColor still makes sense IMO to avoid breaking the DAV job in case there's something wrong stored in the configuration/Akonadi.

This revision is now accepted and ready to land.Apr 18 2020, 12:11 PM
dfaure closed this revision.Apr 18 2020, 12:15 PM