[vlc-devel] commit: ncurses: make file browser open files ( Rafaël Carré )

git version control git at videolan.org
Wed Aug 19 00:55:51 CEST 2009


vlc | branch: master | Rafaël Carré <rafael.carre at gmail.com> | Wed Aug 19 00:54:41 2009 +0200| [9b1ce0e8f3ba760e3453084933c3bf9a3f8c62b2] | committer: Rafaël Carré 

ncurses: make file browser open files

all files would be opened as directories

Pointed-out-by: cachereturn on #videolan

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9b1ce0e8f3ba760e3453084933c3bf9a3f8c62b2
---

 modules/gui/ncurses.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/modules/gui/ncurses.c b/modules/gui/ncurses.c
index 8bf7d8f..d23f2a5 100644
--- a/modules/gui/ncurses.c
+++ b/modules/gui/ncurses.c
@@ -747,8 +747,15 @@ static int HandleKey( intf_thread_t *p_intf, int i_key )
                 if( p_sys->pp_dir_entries[p_sys->i_box_bidx]->b_file || i_key == ' ' )
                 {
                     char* psz_uri;
-                    if( asprintf( &psz_uri, "directory://%s/%s", p_sys->psz_current_dir, p_sys->pp_dir_entries[p_sys->i_box_bidx]->psz_path ) == -1 )
+                    if( asprintf( &psz_uri, "%s://%s/%s",
+                        p_sys->pp_dir_entries[p_sys->i_box_bidx]->b_file ?
+                            "file" : "directory",
+                        p_sys->psz_current_dir,
+                        p_sys->pp_dir_entries[p_sys->i_box_bidx]->psz_path
+                        ) == -1 )
+                    {
                         psz_uri = NULL;
+                    }
 
                     playlist_item_t *p_parent = p_sys->p_node;
                     if( !p_parent )




More information about the vlc-devel mailing list