┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews/kitemlistcontroller.cpp
diff options
context:
space:
mode:
authorEmmanuel Pescosta <[email protected]>2012-09-19 19:00:52 +0200
committerEmmanuel Pescosta <[email protected]>2012-09-19 19:00:52 +0200
commit580bcae62c1b0de6b7c6be42f68ead5c6d6c9d19 (patch)
treed90f18c4e16841e1e00f57bdb174aaa65a2c42fb /src/kitemviews/kitemlistcontroller.cpp
parent40c513d4774fca0ecfe5141ece642874e2664f89 (diff)
Fixes Bug 293200 - Drag&drop files in dolphin doesnt preserve origin
Patch 106381 Comment #3: When "Open folders during drag operations" is enabled, two things happen, both in the DolphinView and in the Folders Panel: 1) When hovering a folder that can be expanded (this is the case for folders with sub-folders in the Folders Panel and in the DolphinView if in Details View mode), toggle its "expanded" state. 2) When hovering a folder that can not be expanded (i.e., a folder without sub-folders or any folder in Icons or Compact View), open this folder in the DolphinView via the KItemListController's itemActivated(int) signal. The bug described in bug 293200 comment 3 is that 1) is always wanted, but 2) is not wanted for the Folders Panel. BUG: 293200 FIXED-IN: 4.9.2
Diffstat (limited to 'src/kitemviews/kitemlistcontroller.cpp')
-rw-r--r--src/kitemviews/kitemlistcontroller.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp
index 88f5d9f7c..52f8e0078 100644
--- a/src/kitemviews/kitemlistcontroller.cpp
+++ b/src/kitemviews/kitemlistcontroller.cpp
@@ -47,6 +47,7 @@ KItemListController::KItemListController(KItemModelBase* model, KItemListView* v
m_selectionTogglePressed(false),
m_clearSelectionIfItemsAreNotDragged(false),
m_selectionBehavior(NoSelection),
+ m_autoActivationBehavior(ActivationAndExpansion),
m_model(0),
m_view(0),
m_selectionManager(new KItemListSelectionManager(this)),
@@ -157,6 +158,16 @@ KItemListController::SelectionBehavior KItemListController::selectionBehavior()
return m_selectionBehavior;
}
+void KItemListController::setAutoActivationBehavior(AutoActivationBehavior behavior)
+{
+ m_autoActivationBehavior = behavior;
+}
+
+KItemListController::AutoActivationBehavior KItemListController::autoActivationBehavior() const
+{
+ return m_autoActivationBehavior;
+}
+
void KItemListController::setAutoActivationDelay(int delay)
{
m_autoActivationTimer->setInterval(delay);
@@ -471,7 +482,7 @@ void KItemListController::slotAutoActivationTimeout()
if (m_view->supportsItemExpanding() && m_model->isExpandable(index)) {
const bool expanded = m_model->isExpanded(index);
m_model->setExpanded(index, !expanded);
- } else {
+ } else if (m_autoActivationBehavior != ExpansionOnly) {
emit itemActivated(index);
}
}