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

Frank Reininghaus frank78ac at googlemail.com
Wed Apr 30 08:38:26 BST 2014


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

(Updated April 30, 2014, 7:38 a.m.)


Status
------

This change has been marked as submitted.


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/20140430/1d6a3e3b/attachment.htm>


More information about the kfm-devel mailing list