Bug 240668 - Keyboard Navigation in File Browser Broken
Summary: Keyboard Navigation in File Browser Broken
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: File Browser (show other bugs)
Version: 2.3.1
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
: 242321 242859 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-06-04 00:09 UTC by Hannes Koller
Modified: 2010-06-30 01:00 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.3.2


Attachments
Patch that fixes the return-not-working-in-file-browser issue on my computer. (1.10 KB, patch)
2010-06-07 23:36 UTC, Hannes Koller
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hannes Koller 2010-06-04 00:09:05 UTC
Version:           2.3.1 (using KDE 4.4.3) 
OS:                Linux

I am unable to use keyboard inputs to navigate the directory hierarchy in the Amarok file browser. 

For example I would expect pressing Return on a directory to have the file-browser switch to that directory, however it only shows an empty page. If I open the same directory by a mouse-click it works as expected. 
Likewise using ALT+Up to get to the parent directory does not work.

Reproducible: Always

Steps to Reproduce:
Open the Amarok file browser. Press Return to enter a subdirectory -> empty page. Go back up (using the UI because the ALT+Up shortcut also does not work) and open the same directory via mouse-click -> works. 



OS: Linux (x86_64) release 2.6.32-22-generic
Compiler: cc
Comment 1 Myriam Schweingruber 2010-06-05 01:22:03 UTC
Enter on a directory actually works correctly here, but indeed, Alt+Up doesn't go up a level. Using current Amarok 2.3.1.-git, Kubuntu 10.04
Comment 2 Hannes Koller 2010-06-05 10:09:10 UTC
Interesting :)  I am using the Amarok 2.3.1 build from kubuntu-ppa/backports. When I find the time I will try to build from source and check if Enter works there.
Comment 3 Hannes Koller 2010-06-05 10:11:06 UTC
Interesting :)  I am using the Amarok 2.3.1 build from kubuntu-ppa/backports. When I find the time I will try to build from source and check if Enter works there.
Comment 4 Hannes Koller 2010-06-07 23:36:55 UTC
Created attachment 47797 [details]
Patch that fixes the return-not-working-in-file-browser issue on my computer.
Comment 5 Hannes Koller 2010-06-07 23:37:41 UTC
Ok I found some time to compile the latest git version today, and it had the same odd behaviour  on my computer (enter on directory not working)

I had some time to fiddle around with the source code and I found a fix that seems to solve the problem for me. Mind you I have no clue about KDE development and I am not really sure why this works for my computer, it just does.. maybe it can provide some clue to whats really going on here, or maybe something else is broken on my system and I just dont get what is actually wrong.. anyway I thougth I'd share the fix, so here it goes.
Comment 6 Myriam Schweingruber 2010-06-08 00:27:59 UTC
Could you please make a merge request here: http://gitorious.org/amarok/amarok/merge_requests so the Amarok developers can have a look? Thank you.
Comment 7 Hannes Koller 2010-06-08 20:35:57 UTC
Ok. I also added the missing ALT+Up keyboard shortcut and submitted a merge request  ( http://gitorious.org/amarok/amarok/merge_requests/173 ).. Took me some time to figure that out, I have never used git before.. so if anything is amiss, please tell me :)
Comment 8 Hannes Koller 2010-06-10 05:37:03 UTC
commit 911cd5ccc8a90f42bd124fafdc3bc3a1b3dadad2
Author: hkoller <hannes.koller@gmail.com>
Date:   Tue Jun 8 20:18:01 2010 +0200

    fix keyboard navigation issues in the file browser
    
    BUG: 240668

diff --git a/ChangeLog b/ChangeLog
index 76ebc2a..d4203dd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -28,6 +28,8 @@ VERSION 2.3.2-Beta 1
       Patch by Richard Longland <rlongland@hotmail.com>.
 
   BUGFIXES:
+    * Fixed keyboard navigation in file browser. (BR 240668)
+      Patch thanks to Hannes Koller.
     * Fixed dropping files to playlist from Konqueror. (BR 235722)
     * Fixed keyboard shortcuts of actions from scripts lost after restart.
       Thanks to Martin Blumenstingl <darklight.xdarklight@googlemail.com>.
diff --git a/src/browsers/filebrowser/FileBrowser.cpp b/src/browsers/filebrowser/FileBrowser.cpp
index ab7d786..35ff68c 100644
--- a/src/browsers/filebrowser/FileBrowser.cpp
+++ b/src/browsers/filebrowser/FileBrowser.cpp
@@ -53,6 +53,7 @@ FileBrowser::FileBrowser( const char * name, QWidget *parent )
     m_upAction = new QAction( KIcon( "go-up" ), i18nc( "Go one level up in the directory hierarchy", "Up one level" ), this );
     navigationToolbar->addAction( m_upAction );
     connect( m_upAction, SIGNAL( triggered( bool) ), this, SLOT( up() ) );
+    m_upAction->setShortcut(Qt::ALT + Qt::Key_Up );
 
     m_homeAction = new QAction( KIcon( "user-home" ), i18nc( "Go to the home directory",  "Home" ), this );
     navigationToolbar->addAction( m_homeAction );
@@ -201,12 +202,7 @@ FileBrowser::itemActivated( const QModelIndex &index )
 
         if( file.isDir() ) {
             debug() << "setting root path to: " << filePath.path();
-            m_kdirModel->dirLister()->openUrl( filePath );
-            m_fileView->setRootIndex( index );
-
-            //add this dir to the breadcrumb
-            setupAddItems();
-            activate();
+	    setDir(filePath.path());
         }
         else
         {
Comment 9 Myriam Schweingruber 2010-06-21 10:20:40 UTC
*** Bug 242321 has been marked as a duplicate of this bug. ***
Comment 10 Myriam Schweingruber 2010-06-30 01:00:37 UTC
*** Bug 242859 has been marked as a duplicate of this bug. ***