[Differential] [Changed Subscribers] D2423: Set initial categories for non-cached incidences

knauss (Sandro Knauß) noreply at phabricator.kde.org
Fri Aug 12 15:19:08 BST 2016


knauss added inline comments.

INLINE COMMENTS

> incidencecategories.cpp:116
> +    Akonadi::Tag::List selectedTags;
> +    for (auto const &category : mLoadedIncidence->categories()) {
> +        bool categoryExists = false;

const auto const &

> incidencecategories.cpp:119
> +        foreach (const Akonadi::Tag &tag, fetchJob->tags()) {
> +            auto tagName = tag.name();
> +            if (tagName == category) {

const auto [...]

> incidencecategories.cpp:122
> +                selectedTags << tag;
> +                categoryExists = true;
> +            }

break;
we don't need to search further if we found already the tag

> incidencecategories.cpp:126
> +        if (!categoryExists) {
> +            new Akonadi::TagCreateJob(Akonadi::Tag::genericTag(category), this);
> +        }

you also need to add a connect after the tag is created, for adding the new created tag to mSelectedTags

REPOSITORY
  rINCIDENCEEDITOR PIM: Incidence Editor

REVISION DETAIL
  https://phabricator.kde.org/D2423

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: dkurz, #kde_pim
Cc: knauss, kde-pim, spencerb, dvasin, winterz, smartins, vkrause, mlaurent, dvratil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20160812/f2d7e759/attachment.html>


More information about the kde-pim mailing list