┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2010-01-06 18:40:55 +0000
committerPeter Penz <[email protected]>2010-01-06 18:40:55 +0000
commitb93b305d2ea75a1dd5c5953fb16374038d64f498 (patch)
tree58d9253658ee302c22937e5b6f2972400a717adb /src
parent923a47290f4a8472199733a85fa1f19ef130e9aa (diff)
It is possible that the selection of an inactive column gets changed (e. g. by the selection markers). In this case the column should get active.
BUG: 188979 svn path=/trunk/KDE/kdebase/apps/; revision=1070789
Diffstat (limited to 'src')
-rw-r--r--src/dolphincolumnview.cpp16
-rw-r--r--src/dolphincolumnview.h2
2 files changed, 18 insertions, 0 deletions
diff --git a/src/dolphincolumnview.cpp b/src/dolphincolumnview.cpp
index ac131497e..361ddf696 100644
--- a/src/dolphincolumnview.cpp
+++ b/src/dolphincolumnview.cpp
@@ -192,6 +192,22 @@ KFileItem DolphinColumnView::itemAt(const QPoint& pos) const
return item;
}
+void DolphinColumnView::setSelectionModel(QItemSelectionModel* model)
+{
+ // If a change of the selection is done although the view is not active
+ // (e. g. by the selection markers), the column must be activated. This
+ // is done by listening to the current selectionChanged() signal.
+ if (selectionModel() != 0) {
+ disconnect(selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)),
+ this, SLOT(requestActivation()));
+ }
+
+ QListView::setSelectionModel(model);
+
+ connect(selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)),
+ this, SLOT(requestActivation()));
+}
+
QStyleOptionViewItem DolphinColumnView::viewOptions() const
{
QStyleOptionViewItem viewOptions = QListView::viewOptions();
diff --git a/src/dolphincolumnview.h b/src/dolphincolumnview.h
index c73ffc094..d4da86657 100644
--- a/src/dolphincolumnview.h
+++ b/src/dolphincolumnview.h
@@ -85,6 +85,8 @@ public:
*/
KFileItem itemAt(const QPoint& pos) const;
+ virtual void setSelectionModel(QItemSelectionModel* model);
+
protected:
virtual QStyleOptionViewItem viewOptions() const;
virtual void startDrag(Qt::DropActions supportedActions);