totem-pl-parser r262 - in trunk: . plparse



Author: hadess
Date: Fri Dec  5 14:46:58 2008
New Revision: 262
URL: http://svn.gnome.org/viewvc/totem-pl-parser?rev=262&view=rev

Log:
2008-12-05  Bastien Nocera  <hadess hadess net>

	* plparse/totem-disc.c (cd_cache_get_dev_from_volumes),
	(cd_cache_has_content_type), (cd_cache_disc_is_cdda):
	Make detecting the type of devices not connected 1-to-1
	to a drive work again, as it did in 2.24



Modified:
   trunk/ChangeLog
   trunk/plparse/totem-disc.c

Modified: trunk/plparse/totem-disc.c
==============================================================================
--- trunk/plparse/totem-disc.c	(original)
+++ trunk/plparse/totem-disc.c	Fri Dec  5 14:46:58 2008
@@ -204,6 +204,38 @@
   g_list_foreach (list, (GFunc) g_object_unref, NULL);
   g_list_free (list);
 
+  if (found != FALSE)
+    return found;
+
+  /* Not in the drives? Look in the volumes themselves */
+  found = FALSE;
+  list = g_volume_monitor_get_volumes (mon);
+  for (l = list; l != NULL; l = l->next) {
+    GVolume *vol;
+    char *ddev, *resolved;
+
+    vol = l->data;
+    ddev = g_volume_get_identifier (vol, G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE);
+    if (ddev == NULL)
+      continue;
+    resolved = totem_resolve_symlink (ddev, NULL);
+    g_free (ddev);
+    if (resolved == NULL)
+      continue;
+
+    if (strcmp (resolved, device) == 0) {
+      found = TRUE;
+      *volume = g_object_ref (vol);
+    }
+
+    g_free (resolved);
+    if (found != FALSE)
+      break;
+  }
+
+  g_list_foreach (list, (GFunc) g_object_unref, NULL);
+  g_list_free (list);
+
   return found;
 }
 
@@ -213,12 +245,10 @@
   guint i;
 
   if (cache->content_types == NULL) {
-    g_message ("no content type");
     return FALSE;
   }
 
   for (i = 0; cache->content_types[i] != NULL; i++) {
-    g_message ("type: %s", cache->content_types[i]);
     if (g_str_equal (cache->content_types[i], content_type) != FALSE)
       return TRUE;
   }
@@ -526,7 +556,6 @@
 {
   /* We can't have audio CDs on disc, yet */
   if (cache->is_media == FALSE) {
-    g_message ("has no media");
     return MEDIA_TYPE_DATA;
   }
   if (!cd_cache_open_device (cache, error))



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