Search
lxdream.org :: lxdream/src/gdlist.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/gdlist.c
changeset 696:3b224db916e3
prev691:ad3356543392
next709:18c39a8e504c
author nkeynes
date Sun Jun 22 03:59:56 2008 +0000 (12 years ago)
permissions -rw-r--r--
last change Add a get_filename method to gdlist
return mount resuls from gdrom_list_set_selection()
file annotate diff log raw
1.1 --- a/src/gdlist.c Thu Jun 19 04:40:37 2008 +0000
1.2 +++ b/src/gdlist.c Sun Jun 22 03:59:56 2008 +0000
1.3 @@ -173,15 +173,13 @@
1.4
1.5 if( posn <= gdrom_device_count ) {
1.6 gchar *entry = g_list_nth_data(gdrom_device_list, posn-1);
1.7 - gdrom_mount_image(entry);
1.8 - return TRUE;
1.9 + return gdrom_mount_image(entry);
1.10 }
1.11
1.12 posn -= FIRST_RECENT_INDEX;
1.13 if( posn >= 0 && posn < gdrom_recent_count ) {
1.14 gchar *entry = g_list_nth_data(gdrom_recent_list, posn);
1.15 - gdrom_mount_image(entry);
1.16 - return TRUE;
1.17 + return gdrom_mount_image(entry);
1.18 }
1.19
1.20 return FALSE;
1.21 @@ -223,3 +221,24 @@
1.22 gchar *entry = g_list_nth_data(gdrom_recent_list, posn-FIRST_RECENT_INDEX);
1.23 return basename(entry);
1.24 }
1.25 +
1.26 +const gchar *gdrom_list_get_filename( int posn )
1.27 +{
1.28 + if( posn == 0 ) {
1.29 + return _("Empty");
1.30 + }
1.31 +
1.32 + if( posn <= gdrom_device_count ) {
1.33 + return g_list_nth_data(gdrom_device_list, posn-1);
1.34 + }
1.35 +
1.36 + if( posn == gdrom_device_count + 1) {
1.37 + return "";
1.38 + }
1.39 +
1.40 + if( posn < 0 || posn > gdrom_list_size() ) {
1.41 + return NULL;
1.42 + }
1.43 +
1.44 + return g_list_nth_data(gdrom_recent_list, posn-FIRST_RECENT_INDEX);
1.45 +}
.