* familiar.c : familiar plugin for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
- * $Id: familiar.c,v 1.8.2.9 2002/10/29 20:53:30 jpsaman Exp $
+ * $Id: familiar.c,v 1.8.2.10 2002/11/20 21:26:09 jpsaman Exp $
*
* Authors: Jean-Paul Saman <jpsaman@wxs.nl>
*
/* Show the control window */
gtk_widget_show( p_intf->p_sys->p_window );
ReadDirectory(p_intf->p_sys->p_clist, "/mnt");
-// OpenDirectory(p_intf->p_sys->p_clist, "/mnt");
/* Sleep to avoid using all CPU - since some interfaces needs to access
* keyboard events, a 100ms delay is a good compromise */
* familiar_callbacks.c : Callbacks for the Familiar Linux Gtk+ plugin.
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: familiar_callbacks.c,v 1.6.2.12 2002/10/30 22:42:26 jpsaman Exp $
+ * $Id: familiar_callbacks.c,v 1.6.2.13 2002/11/20 21:26:09 jpsaman Exp $
*
* Authors: Jean-Paul Saman <jpsaman@wxs.nl>
*
{
intf_thread_t *p_intf = GtkGetIntf( clist );
struct dirent **namelist;
- int n=-1;
- int status=-1;
+ int n, status;
- printf( "Read directory: %s\n", psz_dir );
+// printf( "Read directory: %s\n", psz_dir );
if (psz_dir)
{
status = chdir(psz_dir);
if (status<0)
intf_ErrMsg("File is not a directory.");
}
- n = scandir(psz_dir, &namelist, 0, NULL);
+ n = scandir(".", &namelist, 0, alphasort);
- printf( "n=%d\n", n);
if (n<0)
perror("scandir");
else
/* This is a list of strings. */
ppsz_text[0] = namelist[i]->d_name;
ppsz_text[1] = get_file_perm(namelist[i]->d_name);
- printf( "Entry: %s, %s\n", namelist[i]->d_name, ppsz_text[1] );
+// printf( "Entry: %s(%d), %s\n", namelist[i]->d_name,strlen(namelist[i]->d_name), ppsz_text[1] );
gtk_clist_insert( p_intf->p_sys->p_clist, i, ppsz_text );
free(namelist[i]);
}
}
}
+#ifdef 0
void OpenDirectory( GtkCList *clist, char *psz_dir )
{
intf_thread_t *p_intf = GtkGetIntf( clist );
gtk_clist_thaw( p_intf->p_sys->p_clist );
}
+#endif
static char* get_file_perm(const char *path)
{
if (p_intf->p_sys->p_clist)
{
ReadDirectory(p_intf->p_sys->p_clist, ".");
-// OpenDirectory(p_intf->p_sys->p_clist, ".");
}
}
{
if (S_ISDIR(st.st_mode))
ReadDirectory(p_intf->p_sys->p_clist, psz_url);
-// OpenDirectory(p_intf->p_sys->p_clist, psz_url);
else if( (S_ISLNK(st.st_mode)) || (S_ISCHR(st.st_mode)) ||
(S_ISBLK(st.st_mode)) || (S_ISFIFO(st.st_mode))||
(S_ISSOCK(st.st_mode))|| (S_ISREG(st.st_mode)) )
{
if (S_ISDIR(st.st_mode))
ReadDirectory(p_intf->p_sys->p_clist, text[0]);
-// OpenDirectory(p_intf->p_sys->p_clist, text[0]);
else if( (S_ISLNK(st.st_mode)) || (S_ISCHR(st.st_mode)) ||
(S_ISBLK(st.st_mode)) || (S_ISFIFO(st.st_mode))||
(S_ISSOCK(st.st_mode))|| (S_ISREG(st.st_mode)) )