From 20bfa4ecea2b52924c0ba6bf5af8bbd7ecdce8a7 Mon Sep 17 00:00:00 2001 From: craig Date: Thu, 22 Dec 2011 00:29:42 +0000 Subject: [PATCH] Hmmm, for single-click we need to connec to QTreeView::activated --- widgets/itemview.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/widgets/itemview.cpp b/widgets/itemview.cpp index 0057d725a..79f8ea4b5 100644 --- a/widgets/itemview.cpp +++ b/widgets/itemview.cpp @@ -32,6 +32,9 @@ #include #include #include +#ifdef ENABLE_KDE_SUPPORT +#include +#endif static QPainterPath buildPath(const QRectF &r, double radius) { @@ -327,7 +330,11 @@ void ItemView::init(QAction *a1, QAction *a2) connect(listSearch, SIGNAL(returnPressed()), this, SIGNAL(searchItems())); connect(listSearch, SIGNAL(textChanged(const QString)), this, SIGNAL(searchItems())); connect(treeView, SIGNAL(itemsSelected(bool)), this, SIGNAL(itemsSelected(bool))); -// connect(treeView, SIGNAL(activated(const QModelIndex &)), this, SLOT(itemActivated(const QModelIndex &))); +#ifdef ENABLE_KDE_SUPPORT + if (KGlobalSettings::singleClick()) { + connect(treeView, SIGNAL(activated(const QModelIndex &)), this, SLOT(itemActivated(const QModelIndex &))); + } +#endif connect(treeView, SIGNAL(doubleClicked(const QModelIndex &)), this, SIGNAL(doubleClicked(const QModelIndex &))); connect(treeView, SIGNAL(clicked(const QModelIndex &)), this, SLOT(itemClicked(const QModelIndex &))); connect(listView, SIGNAL(itemsSelected(bool)), this, SIGNAL(itemsSelected(bool)));