From 9fbf7a0b624aee6b116efdf69462e73f0275fab6 Mon Sep 17 00:00:00 2001 From: Jaime Torres Date: Sun, 4 Feb 2018 21:19:33 +0100 Subject: Faster drag&drop in directories with thousands of files Summary: The check is called when the mouse is moved in a drag&drop operation. Dragging all files in a directory with 3000 files under callgrind, moving the mouse to the other panel and then canceling, doing it twice, callgrind shows that the method urlListMatchesUrl is called around 200 times, spending around 9,30% of the cpu in those calls. Applying the patch, callgrind tells it uses now 0.31% of the cpu in 1208 calls. CCBUG: 342056 Reviewers: #dolphin, elvisangelaccio, markg Reviewed By: #dolphin, elvisangelaccio, markg Subscribers: markg, anthonyfieroni, michaelh, elvisangelaccio, ngraham Differential Revision: https://phabricator.kde.org/D10085 --- src/kitemviews/kitemlistcontroller.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/kitemviews/kitemlistcontroller.cpp') diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp index 130936488..7af8781b4 100644 --- a/src/kitemviews/kitemlistcontroller.cpp +++ b/src/kitemviews/kitemlistcontroller.cpp @@ -849,6 +849,9 @@ bool KItemListController::dragEnterEvent(QGraphicsSceneDragDropEvent* event, con { Q_UNUSED(event); Q_UNUSED(transform); + + DragAndDropHelper::clearUrlListMatchesUrlCache(); + return false; } -- cgit v1.3