Search
lxdream.org :: lxdream :: r696:3b224db916e3
lxdream 0.9.1
released Jun 29
Download Now
changeset696:3b224db916e3
parent695:2bb59940ff35
child697:479b8c213f61
authornkeynes
dateSun Jun 22 03:59:56 2008 +0000 (11 years ago)
Add a get_filename method to gdlist
return mount resuls from gdrom_list_set_selection()
src/gdlist.c
src/gdlist.h
1.1 --- a/src/gdlist.c Sun Jun 22 03:58:24 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 +}
2.1 --- a/src/gdlist.h Sun Jun 22 03:58:24 2008 +0000
2.2 +++ b/src/gdlist.h Sun Jun 22 03:59:56 2008 +0000
2.3 @@ -55,6 +55,8 @@
2.4 */
2.5 const gchar *gdrom_list_get_display_name(int index);
2.6
2.7 +const gchar *gdrom_list_get_filename(int index);
2.8 +
2.9 /**
2.10 * Change the current gdrom selection to the selected index. This will mount the
2.11 * appropriate drive/image where necessary.
.