┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2009-02-01 14:08:40 +0000
committerPeter Penz <[email protected]>2009-02-01 14:08:40 +0000
commit8e13b80d5f3b9820a4db37ba1de7070cc5743e80 (patch)
treeadc6ad1689cff3e7c808949e3b4b94687bd166bb /src
parentd56646dd0fc350f91bcfc1f1223aa1ac1ff32e97 (diff)
Replace patch for bug 181226 by a different approach, as the previous patch resulted in a changed behavior when using the double-click mode (-> a treeview item had to be pressed twice to show it in the main view).
CCBUG: 172360 CCBUG: 181226 svn path=/trunk/KDE/kdebase/apps/; revision=919648
Diffstat (limited to 'src')
-rw-r--r--src/panels/folders/folderspanel.cpp13
-rw-r--r--src/panels/folders/folderspanel.h3
2 files changed, 15 insertions, 1 deletions
diff --git a/src/panels/folders/folderspanel.cpp b/src/panels/folders/folderspanel.cpp
index e20da9175..eb957f7b9 100644
--- a/src/panels/folders/folderspanel.cpp
+++ b/src/panels/folders/folderspanel.cpp
@@ -159,7 +159,7 @@ void FoldersPanel::showEvent(QShowEvent* event)
new FolderExpander(m_treeView, m_proxyModel);
- connect(m_treeView, SIGNAL(activated(const QModelIndex&)),
+ connect(m_treeView, SIGNAL(clicked(const QModelIndex&)),
this, SLOT(updateActiveView(const QModelIndex&)));
connect(m_treeView, SIGNAL(urlsDropped(const QModelIndex&, QDropEvent*)),
this, SLOT(dropUrls(const QModelIndex&, QDropEvent*)));
@@ -191,6 +191,17 @@ void FoldersPanel::contextMenuEvent(QContextMenuEvent* event)
contextMenu.open();
}
+void FoldersPanel::keyPressEvent(QKeyEvent* event)
+{
+ const int key = event->key();
+ if ((key == Qt::Key_Enter) || (key == Qt::Key_Return)) {
+ event->accept();
+ updateActiveView(m_treeView->currentIndex());
+ } else {
+ Panel::keyPressEvent(event);
+ }
+}
+
void FoldersPanel::updateActiveView(const QModelIndex& index)
{
const QModelIndex dirIndex = m_proxyModel->mapToSource(index);
diff --git a/src/panels/folders/folderspanel.h b/src/panels/folders/folderspanel.h
index 90f506fd0..1822d17e0 100644
--- a/src/panels/folders/folderspanel.h
+++ b/src/panels/folders/folderspanel.h
@@ -81,6 +81,9 @@ protected:
/** @see QWidget::contextMenuEvent() */
virtual void contextMenuEvent(QContextMenuEvent* event);
+ /** @see QWidget::keyPressEvent() */
+ virtual void keyPressEvent(QKeyEvent* event);
+
private slots:
/**
* Updates the active view to the URL