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

Frank Reininghaus frank78ac at googlemail.com
Sat Apr 26 12:16:59 BST 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/117782/
-----------------------------------------------------------

Review request for Dolphin.


Bugs: 333903
    http://bugs.kde.org/show_bug.cgi?id=333903


Repository: kde-baseapps


Description
-------

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.


Diffs
-----

  dolphin/src/dolphinmainwindow.cpp 8473014 

Diff: https://git.reviewboard.kde.org/r/117782/diff/


Testing
-------

Fixes the slowness for me. I haven't found any problems yet - it seems that the paste action is always updated correctly for me.


Thanks,

Frank Reininghaus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20140426/12e05d10/attachment.htm>


More information about the kfm-devel mailing list