changeset 34366:b8a4787f363b

Add /mnt only to the file selector path list if it exists. Additionally, check for /media and add it if it exists.
author ib
date Fri, 23 Dec 2011 13:41:25 +0000
parents 0909b0da0d5b
children b370a9fd85b3
files gui/ui/gtk/fileselect.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/gui/ui/gtk/fileselect.c	Thu Dec 22 17:39:38 2011 +0000
+++ b/gui/ui/gtk/fileselect.c	Fri Dec 23 13:41:25 2011 +0000
@@ -252,6 +252,7 @@
 {
  int i, k, fsMedium;
  char * tmp = NULL, * dir = NULL;
+ struct stat f;
 
  if ( fsFileSelect ) gtkActive( fsFileSelect );
   else fsFileSelect=create_FileSelect();
@@ -321,7 +322,6 @@
 
  if ( tmp && tmp[0] )
   {
-   struct stat f;
    dir = strdup( tmp );
 
    do
@@ -355,7 +355,8 @@
  free( dir );
  if ( getenv( "HOME" ) ) fsTopList_items=g_list_append( fsTopList_items,getenv( "HOME" ) );
  fsTopList_items=g_list_append( fsTopList_items,"/home" );
- fsTopList_items=g_list_append( fsTopList_items,"/mnt" );
+ if (stat( "/mnt",&f ) == 0) fsTopList_items=g_list_append( fsTopList_items,"/mnt" );
+ if (stat( "/media",&f ) == 0) fsTopList_items=g_list_append( fsTopList_items,"/media" );
  fsTopList_items=g_list_append( fsTopList_items,"/" );
  gtk_combo_set_popdown_strings( GTK_COMBO( fsCombo4 ),fsTopList_items );