D10085: Faster drag&drop in directories with thousands of files
Mark Gaiser
noreply at phabricator.kde.org
Fri Feb 2 23:05:32 GMT 2018
markg added a comment.
@jtamate how about this patch: https://p.sc2.nl/HyrIiwfIG
The rationale behind it is as follows. If a paste is allowed is checked upon drag enter and upon hovering a different folder within the drag. That value is stored in a bool.
Upon drag leave the value is always reset to false.
I just hacked this together, it seems to work for my simple test case but i don't know if it works in all cases.
Feel free to give it a spin and continue from there on :) You have full permission to use it as you please.
Then for callgrind (i also use that), the calls to DragAndDropHelper::urlListMatchesUrl are now down to 2 with "just" 15.002 calls to QUrl::matches. Still smells spiffy, but much better imho :)
Note, one call from DragAndDropHelper::urlListMatchesUrl comes from DragAndDropHelper::dropUrls which internally again verifies that it can drop. If you guarantee that that function is _only_ being called when a drop is allowed then there is no need for that function to check that again. Thus there you could remove the:
if (urlListMatchesUrl(event->mimeData()->urls(), destUrl)) {
return nullptr;
}
Another option (to be more conservative) would be to "let that function know" that things are safe and it can ignore the check. That can be done by using the QDropEvent more smartly by checking if it's accpeted. Using that would be nice imho anyhow :)
REPOSITORY
R318 Dolphin
REVISION DETAIL
https://phabricator.kde.org/D10085
To: jtamate, #dolphin, elvisangelaccio, markg
Cc: markg, anthonyfieroni, michaelh, elvisangelaccio, ngraham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20180202/c5ada5ab/attachment.htm>
More information about the kfm-devel
mailing list