[Akonadi/PasteHelper] Add support for items linking
ClosedPublic

Authored by poboiko on Mar 30 2020, 12:31 PM.

Details

Summary

When linking an item to a virtual collection via KAddressBook, canPaste check
fails because it's not aware of the context (i.e. action is Link, not Copy)
and checks only for CanCreateItem (which is not correct if we're linking).

This patch provides Qt::DropAction action parameter to canPaste method so
it is aware of action, and check for correct permissions based on that

Test Plan
  1. Link an item via KAddressBook using Drag'n'Drop to some virtual collection

(e.g. Google Contacts Resource)

  1. The item gets actually linked, instead of silently ignoring

Diff Detail

Repository
R165 Akonadi
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
poboiko created this revision.Mar 30 2020, 12:31 PM
Restricted Application added a project: KDE PIM. Β· View Herald TranscriptMar 30 2020, 12:31 PM
poboiko requested review of this revision.Mar 30 2020, 12:31 PM
dvratil accepted this revision.Mar 30 2020, 1:32 PM

Looking good, thanks πŸ‘

This revision is now accepted and ready to land.Mar 30 2020, 1:32 PM
poboiko updated this revision to Diff 78914.Mar 30 2020, 4:09 PM

Rebase on master. ItemModel and CollectionModel were recently removed :(

This revision was automatically updated to reflect the committed changes.