rhythmbox r5992 - in trunk: . plugins/generic-player



Author: jmatthew
Date: Thu Oct 23 11:50:40 2008
New Revision: 5992
URL: http://svn.gnome.org/viewvc/rhythmbox?rev=5992&view=rev

Log:
2008-10-23  Jonathan Matthew  <jonathan d14n org>

	* plugins/generic-player/rb-generic-player-source.c:
	(rb_generic_player_is_mount_player):
	Check portable_audio_player.access_method.protocols first, then
	portable_audio_player.access_method.


Modified:
   trunk/ChangeLog
   trunk/plugins/generic-player/rb-generic-player-source.c

Modified: trunk/plugins/generic-player/rb-generic-player-source.c
==============================================================================
--- trunk/plugins/generic-player/rb-generic-player-source.c	(original)
+++ trunk/plugins/generic-player/rb-generic-player-source.c	Thu Oct 23 11:50:40 2008
@@ -824,21 +824,43 @@
 		char *udi = get_hal_udi_for_player (ctx, mount);
 		if (udi != NULL) {
 			DBusError error;
+			char **proplist;
 			char *prop;
 
 			rb_debug ("Checking udi %s", udi);
 			/* check that it can be accessed as mass-storage */
 			dbus_error_init (&error);
-			prop = libhal_device_get_property_string (ctx, udi, "portable_audio_player.access_method", &error);
-			if (prop != NULL && strcmp (prop, "storage") == 0 && !dbus_error_is_set (&error)) {
-				/* the device has passed all tests, so it should be a usable player */
-				result = TRUE;
-			} else {
+			proplist = libhal_device_get_property_strlist (ctx, udi, "portable_audio_player.access_method.protocols", &error);
+			if (proplist != NULL && !dbus_error_is_set (&error)) {
+				int i;
+				for (i = 0; proplist[i] != NULL; i++) {
+					rb_debug ("device access method: %s", proplist[i]);
+					if (strcmp (proplist[i], "storage") == 0) {
+						result = TRUE;
+						break;
+					}
+				}
+
+				libhal_free_string_array (proplist);
+			}
+			free_dbus_error ("checking device access method", &error);
+
+			if (result == FALSE) {
+				dbus_error_init (&error);
+				prop = libhal_device_get_property_string (ctx, udi, "portable_audio_player.access_method", &error);
+				if (prop != NULL && strcmp (prop, "storage") == 0 && !dbus_error_is_set (&error)) {
+					/* the device has passed all tests, so it should be a usable player */
+					result = TRUE;
+				}
+
+				libhal_free_string (prop);
+				free_dbus_error ("checking device access method", &error);
+			}
+
+			if (result == FALSE) {
 				rb_debug ("device cannot be accessed via storage");
 			}
-			libhal_free_string (prop);
 
-			free_dbus_error ("checking device access method", &error);
 		} else {
 			rb_debug ("device is not an audio player");
 		}



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