[Goodies-commits] r4886 - xfburn/trunk/xfburn

David Mohr squisher at xfce.org
Thu Jun 5 07:20:13 CEST 2008


Author: squisher
Date: 2008-06-05 05:20:13 +0000 (Thu, 05 Jun 2008)
New Revision: 4886

Modified:
   xfburn/trunk/xfburn/xfburn-device-list.c
Log:
Adding additional output while scanning for drives

Modified: xfburn/trunk/xfburn/xfburn-device-list.c
===================================================================
--- xfburn/trunk/xfburn/xfburn-device-list.c	2008-06-03 20:07:44 UTC (rev 4885)
+++ xfburn/trunk/xfburn/xfburn-device-list.c	2008-06-05 05:20:13 UTC (rev 4886)
@@ -257,9 +257,10 @@
 xfburn_device_list_init ()
 {
   struct burn_drive_info *drives;
-  gint i; 
+  gint i, ret; 
   gboolean can_burn;
   guint n_drives = 0;
+  guint n_burners = 0;
 
   *profile_name = '\0';
 
@@ -274,9 +275,15 @@
     devices = NULL;
   }
 
-  while (!burn_drive_scan (&drives, &n_drives))
+  while ((ret = burn_drive_scan (&drives, &n_drives)) == 0)
     usleep (1002);
 
+  if (ret < 0)
+    g_warning ("An error occurred while scanning for available drives!");
+
+  if (n_drives < 1)
+    g_warning ("No drives were found!");
+
   for (i = 0; i < n_drives; i++) {
     XfburnDevice *device = g_new0 (XfburnDevice, 1);
     gint ret = 0;
@@ -316,14 +323,19 @@
       g_warning ("Failed to grab drive %s, did not refresh speed list", device->name);
     */
     
-    if (can_burn)
+    if (can_burn) {
       devices = g_list_append (devices, device);
+      n_burners++;
+    }
   }
 
   burn_drive_info_free (drives);
   burn_finish ();
+
+  if (n_drives > 0 && n_burners < 1)
+    g_warning ("There are %d drives in your system, but none are capable of burning!", n_drives);
   
-  return n_drives;
+  return n_burners;
 }
 
 gboolean




More information about the Goodies-commits mailing list