]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Replace patch for bug 181226 by a different approach, as the previous patch resulted...
authorPeter Penz <peter.penz19@gmail.com>
Sun, 1 Feb 2009 14:08:40 +0000 (14:08 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Sun, 1 Feb 2009 14:08:40 +0000 (14:08 +0000)
CCBUG: 172360
CCBUG: 181226

svn path=/trunk/KDE/kdebase/apps/; revision=919648

src/panels/folders/folderspanel.cpp
src/panels/folders/folderspanel.h

index e20da9175e3716ae281379edd3c92ba06b60b3ce..eb957f7b9663718322eaed5c79fbb660a7653a5c 100644 (file)
@@ -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);
index 90f506fd0c572c6d70ce496f18d60c8bc4ce994d..1822d17e0a86cc8378bb9bfd9467b6ca20507979 100644 (file)
@@ -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