DolphinMainWindow: do not update the "Paste" action every time the selection changes

Review Request #117782 - Created April 26, 2014 and submitted

Frank Reininghaus
DolphinMainWindow has some functions that enable/disable some of its actions:

* updateEditAcions() updates, e.g., rename, copy, cut. These actions should only be enabled if the current location is writable, and at least one file is selected. Therefore, it is called if the selection in the view changes.

* updatePasteAction() updates the paste action. This has to be done if the clipboard contents change, beccause the action text is based on the clipboard contents. Moreover, it needs to be updated if the current URL is changed.

Note that updatePasteAction() can be very expensive if many files are in the clipboard.

The problem is that updatePasteAction() is called by updateEditActions() - this means that the possibly expensive re-parsing of the clipboard contents is done every time the selection changes (e.g., when an arrow key is pressed). This is not necessary at all.

The solution is to not call updatePasteAction() there, but to call it explicitly in all places where it is really needed.
Fixes the slowness for me. I haven't found any problems yet - it seems that the paste action is always updated correctly for me.
Emmanuel Pescosta
Commit Hook
This review has been submitted with commit 25e646e9b638f381f1de6c766c0bf38854df8f5d by Frank Reininghaus to branch KDE/4.13.
Frank Reininghaus
Review request changed

Status: Closed (submitted)