Commit a9b0a416 authored by Jean-Paul Saman's avatar Jean-Paul Saman

Typing file locations in URL combo without "file://" prefix is possible again.

parent 20d79981
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* callbacks.c : Callbacks for the Familiar Linux Gtk+ plugin. * callbacks.c : Callbacks for the Familiar Linux Gtk+ plugin.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: callbacks.c,v 1.18 2002/12/20 21:33:40 jpsaman Exp $ * $Id: callbacks.c,v 1.19 2002/12/22 21:46:50 jpsaman Exp $
* *
* Authors: Jean-Paul Saman <jpsaman@wxs.nl> * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
* *
...@@ -388,9 +388,7 @@ void ...@@ -388,9 +388,7 @@ void
on_comboURL_entry_changed (GtkEditable *editable, on_comboURL_entry_changed (GtkEditable *editable,
gpointer user_data) gpointer user_data)
{ {
#if 0
intf_thread_t * p_intf = GtkGetIntf( GTK_WIDGET(editable) ); intf_thread_t * p_intf = GtkGetIntf( GTK_WIDGET(editable) );
#endif
gchar * psz_url; gchar * psz_url;
struct stat st; struct stat st;
...@@ -411,22 +409,13 @@ on_comboURL_entry_changed (GtkEditable *editable, ...@@ -411,22 +409,13 @@ on_comboURL_entry_changed (GtkEditable *editable,
} }
else if (lstat((char*)psz_url, &st)==0) else if (lstat((char*)psz_url, &st)==0)
{ {
#if 0
// This piece of code crashes in ReadDirectory at gtk_clist_insert()
// I cannot figure out why. So for now it is mandatory to use the
// file:// syntax for opening a file on a known location.
// The strange thing is it only crashes for names beginning with "/" or "."
// The combobox is means as a URL box, so having "file://" in front
// is not that strange ;-)
if (S_ISDIR(st.st_mode)) if (S_ISDIR(st.st_mode))
{ {
if (!p_intf->p_sys->p_clist) if (!p_intf->p_sys->p_clist)
msg_Err(p_intf, "p_clist pointer invalid!!" ); msg_Err(p_intf, "p_clist pointer invalid!!" );
ReadDirectory(p_intf->p_sys->p_clist, psz_url); ReadDirectory(p_intf->p_sys->p_clist, psz_url);
} }
else else if( (S_ISLNK(st.st_mode)) || (S_ISCHR(st.st_mode)) ||
#endif
if( (S_ISLNK(st.st_mode)) || (S_ISCHR(st.st_mode)) ||
(S_ISBLK(st.st_mode)) || (S_ISFIFO(st.st_mode))|| (S_ISBLK(st.st_mode)) || (S_ISFIFO(st.st_mode))||
(S_ISSOCK(st.st_mode))|| (S_ISREG(st.st_mode)) ) (S_ISSOCK(st.st_mode))|| (S_ISREG(st.st_mode)) )
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* familiar.c : familiar plugin for vlc * familiar.c : familiar plugin for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2002 VideoLAN * Copyright (C) 2002 VideoLAN
* $Id: familiar.c,v 1.19 2002/12/22 21:08:36 jpsaman Exp $ * $Id: familiar.c,v 1.20 2002/12/22 21:46:50 jpsaman Exp $
* *
* Authors: Jean-Paul Saman <jpsaman@wxs.nl> * Authors: Jean-Paul Saman <jpsaman@wxs.nl>
* *
...@@ -197,6 +197,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -197,6 +197,7 @@ static void Run( intf_thread_t *p_intf )
ReadDirectory(p_intf->p_sys->p_clist, "/mnt"); ReadDirectory(p_intf->p_sys->p_clist, "/mnt");
#ifdef NEED_GTK_MAIN #ifdef NEED_GTK_MAIN
msg_Dbg( p_intf, "Manage GTK keyboard events using threads" );
while( !p_intf->b_die ) while( !p_intf->b_die )
{ {
Manage( p_intf ); Manage( p_intf );
...@@ -208,6 +209,7 @@ static void Run( intf_thread_t *p_intf ) ...@@ -208,6 +209,7 @@ static void Run( intf_thread_t *p_intf )
gdk_threads_enter(); gdk_threads_enter();
} }
#else #else
msg_Dbg( p_intf, "Manage GTK keyboard events using timeouts" );
/* Sleep to avoid using all CPU - since some interfaces needs to access /* Sleep to avoid using all CPU - since some interfaces needs to access
* keyboard events, a 100ms delay is a good compromise */ * keyboard events, a 100ms delay is a good compromise */
i_dummy = gtk_timeout_add( INTF_IDLE_SLEEP / 1000, (GtkFunction)Manage, i_dummy = gtk_timeout_add( INTF_IDLE_SLEEP / 1000, (GtkFunction)Manage,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment