]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fix that dragging a file can trigger inline rename.
authorAndreas Krutzler <andreas.krutzler@gmx.net>
Tue, 2 Oct 2018 18:25:57 +0000 (20:25 +0200)
committerAndreas Krutzler <andreas.krutzler@gmx.net>
Wed, 3 Oct 2018 18:08:09 +0000 (20:08 +0200)
Summary:
Inline renaming is aborted as soon as an item is dragged. Previously, ’m_dragging' was used to determine if an item was being dragged. However, inline renaming is triggered after a certain amount of
time, during which time the user may have stopped dragging items.

BUG: 398375
FIXED-IN: 18.08.2

Test Plan: When dragging an selected item, inline renaming should never be started, regardless of where you drag it (Places panel, other split-view window, out of the Dolphin window, ...).

Reviewers: wbauer, elvisangelaccio, #dolphin, ngraham

Reviewed By: wbauer, elvisangelaccio, #dolphin, ngraham

Subscribers: kfm-devel

Tags: #dolphin

Differential Revision: https://phabricator.kde.org/D15904

src/views/dolphinview.cpp

index 342c226382ae561fef05fd1af3e14f619bc82ed7..1db62b8003040ab582c1a7d4e97a42fa735f5cb1 100644 (file)
@@ -755,6 +755,7 @@ bool DolphinView::eventFilter(QObject* watched, QEvent* event)
     case QEvent::GraphicsSceneDragEnter:
         if (watched == m_view) {
             m_dragging = true;
+            abortTwoClicksRenaming();
         }
         break;
 
@@ -1432,8 +1433,8 @@ void DolphinView::slotTwoClicksRenamingTimerTimeout()
 {
     const KItemListSelectionManager* selectionManager = m_container->controller()->selectionManager();
 
-    // verify that only one item is selected and that no item is dragged
-    if (selectionManager->selectedItems().count() == 1 && !m_dragging) {
+    // verify that only one item is selected
+    if (selectionManager->selectedItems().count() == 1) {
         const int index = selectionManager->currentItem();
         const QUrl fileItemUrl = m_model->fileItem(index).url();