Skip to content
Commit c32d82e4 authored by Denis Kurz's avatar Denis Kurz Committed by Daniel Vrátil
Browse files

Set initial categories for non-cached incidences correctly

The old implementation tried to match loaded and existing tags on the
akonadi server side. A new CreateTag job was sent to the server, with
the name of the new tag and the hint to first check if this tag already
exists. The server, however, does not know about any tag names, and
tried to match the new tag by global id, which is completely random in
the TagCreate job.

Now, the matching is done on the client side, where the concept of tag
names is located. We fetch all tags from the server and check if the
categories of the loaded category match the names of these tags. For
every category that was not found in the tag list returned from the
server, we send a TagCreate job.

As a side benefit, we now also keep track of tags that failed to be
created on the server. We now report all tags that were selected,
as well as all categories that were set when the editor was opened
and for which no corresponding tag could be created. This reduces
the risk of losing categories.

Test Plan:
Opening the incidenceeditor from korganizer's eventviews for variuos
cached and non-cached items did not produce a single tag duplicate.
Also, the TagWidget's content is set correctly after the incidenceeditor
is created. Without the patch, everything reported in Bug 352645
happened here, too.

BUG: 352645
BUG: 357236
FIXED-IN: 16.08.1

Differential Revision: https://phabricator.kde.org/D2423
parent 0f6d582a
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment