From: Kai Uwe Broulik Date: Mon, 24 Jan 2022 16:44:03 +0000 (+0100) Subject: [Places Panel] Stop drag activation timer when dropping X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/7c5af3f88ed2fc13d089fc3584e9445af9fa4e9b?ds=inline [Places Panel] Stop drag activation timer when dropping Avoids switching folders after a drop while interacting with the Copy/Move/Link menu. --- diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp index 8fc81bb32..5b2f040d1 100644 --- a/src/panels/places/placespanel.cpp +++ b/src/panels/places/placespanel.cpp @@ -165,6 +165,16 @@ void PlacesPanel::dragLeaveEvent(QDragLeaveEvent *event) } } +void PlacesPanel::dropEvent(QDropEvent *event) +{ + KFilePlacesView::dropEvent(event); + + if (m_dragActivationTimer) { + m_dragActivationTimer->stop(); + m_pendingDragActivation = QPersistentModelIndex(); + } +} + void PlacesPanel::slotConfigureTrash() { const QUrl url = currentIndex().data(KFilePlacesModel::UrlRole).toUrl(); diff --git a/src/panels/places/placespanel.h b/src/panels/places/placespanel.h index fd6661c76..570fc43be 100644 --- a/src/panels/places/placespanel.h +++ b/src/panels/places/placespanel.h @@ -56,6 +56,7 @@ protected: void showEvent(QShowEvent* event) override; void dragMoveEvent(QDragMoveEvent *event) override; void dragLeaveEvent(QDragLeaveEvent *event) override; + void dropEvent(QDropEvent *event) override; private Q_SLOTS: void slotConfigureTrash();