nautilus-cd-burner r2204 - in trunk: . src



Author: mccann
Date: Mon Apr  7 22:40:30 2008
New Revision: 2204
URL: http://svn.gnome.org/viewvc/nautilus-cd-burner?rev=2204&view=rev

Log:
2008-04-07  William Jon McCann  <jmccann redhat com>

	* src/burn-extension.c: (volume_is_blank), (drive_is_cd_device),
	(nautilus_burn_get_file_items),
	(nautilus_burn_get_background_items), (burn_monitor_cb):
	Fix copy disc menu item.
	Fixes #524467



Modified:
   trunk/ChangeLog
   trunk/src/burn-extension.c

Modified: trunk/src/burn-extension.c
==============================================================================
--- trunk/src/burn-extension.c	(original)
+++ trunk/src/burn-extension.c	Mon Apr  7 22:40:30 2008
@@ -328,6 +328,7 @@
         is_blank = FALSE;
 
         udi = g_volume_get_identifier (volume, G_VOLUME_IDENTIFIER_KIND_HAL_UDI);
+        DEBUG_PRINT ("Got udi: %s\n", udi);
         if (udi != NULL) {
                 is_blank = libhal_device_get_property_bool (ctx,
                                                             udi,
@@ -336,6 +337,7 @@
         }
         g_free (udi);
 
+        DEBUG_PRINT ("is-blank: %d\n", is_blank);
         return is_blank;
 }
 
@@ -374,19 +376,24 @@
         is_cd = FALSE;
 
         udi = g_drive_get_identifier (drive, G_VOLUME_IDENTIFIER_KIND_HAL_UDI);
+        DEBUG_PRINT ("Got udi: %s\n", udi);
+
         if (udi != NULL) {
                 char *drive_type;
                 drive_type = libhal_device_get_property_string (ctx,
                                                                 udi,
                                                                 "storage.drive_type",
                                                                 NULL);
-                if (drive_type != NULL && strcmp (drive_type, "cdrom")) {
+                DEBUG_PRINT ("Got drive type: '%s'\n", drive_type);
+                if (drive_type != NULL && strcmp (drive_type, "cdrom") == 0) {
                         is_cd = TRUE;
                 }
                 g_free (drive_type);
         }
         g_free (udi);
 
+        DEBUG_PRINT ("is-cdrom: %d\n", is_cd);
+
         return is_cd;
 }
 
@@ -407,6 +414,8 @@
         gboolean          is_iso;
         gboolean          is_cue;
 
+        DEBUG_PRINT ("Getting file items\n");
+
         if (!selection || selection->next != NULL) {
                 return NULL;
         }
@@ -420,12 +429,15 @@
         file = nautilus_file_info_get_location (file_info);
 
         if (file == NULL) {
+                DEBUG_PRINT ("No file found\n");
+
                 return NULL;
         }
 
         is_local = TRUE;
 
         mime_type = nautilus_file_info_get_mime_type (file_info);
+        DEBUG_PRINT ("Mime type: %s\n", mime_type);
         if (! mime_type) {
                 return NULL;
         }
@@ -469,12 +481,14 @@
         drive = NULL;
         volume = NULL;
 
-        mount = g_file_find_enclosing_mount (file, NULL, NULL);
+        mount = nautilus_file_info_get_mount (file_info);
         if (mount != NULL) {
                 drive = g_mount_get_drive (mount);
                 volume = g_mount_get_volume (mount);
         } else {
-                g_debug ("Mount not found");
+                char *uri = g_file_get_uri (file);
+                DEBUG_PRINT ("Mount not found: %s\n", uri);
+                g_free (uri);
         }
 
         if (drive == NULL && volume != NULL) {
@@ -483,6 +497,9 @@
         } else if (volume == NULL && drive != NULL) {
                 /* case B */
                 volume = drive_get_first_volume (drive);
+                if (volume == NULL) {
+                        DEBUG_PRINT ("Volume not found\n");
+                }
         }
 
         if (drive != NULL
@@ -531,7 +548,7 @@
 
         scheme = nautilus_file_info_get_uri_scheme (current_folder);
 
-        if (!strcmp (scheme, "burn")) {
+        if (strcmp (scheme, "burn") == 0) {
                 NautilusMenuItem *item;
 
                 item = nautilus_menu_item_new ("NautilusBurn::write_menu",
@@ -727,7 +744,7 @@
                  GFileMonitorEvent event_type,
                  NautilusBurn     *burn)
 {
-        DEBUG_PRINT ("Monitor callback type %d: %s: %s\n", event_type, text_uri, info_uri);
+        DEBUG_PRINT ("Monitor callback type %d\n", event_type);
 
         /* only queue the action if it has a chance of changing the state */
         if (event_type == G_FILE_MONITOR_EVENT_CREATED) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]