Skip to content
Commit 25087bb6 authored by David Faure's avatar David Faure
Browse files

Fix tag name/type/gid missing in notifications about tags.

Summary:
The logic in AggregatedFetchScope was wrong, it led to fetchIdOnly()
being always true.

The mechanism in Aggregated* is all based on default_value || A || B || C
where A, B, C are the boolean request from every subscriber.
This works well for fetchRemoteId(), where the default_value is false.

For fetchIdOnly(), what we really want is "(A && B && C)" ("everyone
wants fetchIdOnly) which was implemented as "!(A || B || C)"
(the '!' in front is the == 0 instead of > 0 in Aggregated*FetchScope::fetchIdOnly()).

The flaw in this logic is the default value. With no subscribers,
we want fetchIdOnly() == false, while it currently returns true.

A default_value of true in the default_value || A || B || C logic,
can't work: the result was always true.

The solution I implemented is to compare the number of subscribers that
called setFetchIdOnly(true) with the total number of subscribers.
This directly implements A && B && C, with a default value of false.

Test Plan: 1) extended tagstest. 2) this fixes the remaining failures in zanshin's akonadi tests.

Reviewers: ervin, dvratil

Reviewed By: dvratil

Subscribers: kde-pim

Tags: #kde_pim

Differential Revision: https://phabricator.kde.org/D18556
parent 807e6125
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