dolphin/Fix-that-dragging-a-file-can-trigger-inline-rename.patch

57 lines
2.1 KiB
Diff
Raw Normal View History

From ddfc86ab8c207b81ec9ac83167d081b8d01c2750 Mon Sep 17 00:00:00 2001
From: Andreas Krutzler <andreas.krutzler@gmx.net>
Date: Tue, 2 Oct 2018 20:25:57 +0200
Subject: Fix that dragging a file can trigger inline rename.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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 | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp
index 342c226..1db62b8 100644
--- a/src/views/dolphinview.cpp
+++ b/src/views/dolphinview.cpp
@@ -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();
--
cgit v0.11.2