Update paste action on current directory and selection changes

Authored by muhlenpfordt on May 15 2018, 3:48 PM.

Description

Update paste action on current directory and selection changes

Summary:
The paste action is disabled on Gwenview start. This is caused by
initializing the action state before setting the current directory
url in ContextManager. The state updates only on clipboard changes
and does not reflect the current permissions to paste into a folder.
This patch updates the paste action state on changing the directory
and the selection, which both affect the paste destination.

BUG: 276255
FIXED-IN: 18.04.2

Test Plan:

  1. Copy url(s) to clipboard (e.g. from Dolphin)
  2. Open Gwenview in Browse Mode
  3. Check if EditPaste... is enabled on startup
  4. Check if EditPaste... is disabled in non-writable folders

Reviewers: Gwenview, rkflx

Reviewed By: Gwenview, rkflx

Subscribers: rkflx, huoni

Differential Revision: https://phabricator.kde.org/D12902

Details