rhythmbox r6004 - in trunk: . sources



Author: jmatthew
Date: Tue Oct 28 12:27:53 2008
New Revision: 6004
URL: http://svn.gnome.org/viewvc/rhythmbox?rev=6004&view=rev

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

	* sources/rb-library-source.c: (rb_library_source_constructor):
	Convert library location paths to URIs on startup.  Fixes #556711.


Modified:
   trunk/ChangeLog
   trunk/sources/rb-library-source.c

Modified: trunk/sources/rb-library-source.c
==============================================================================
--- trunk/sources/rb-library-source.c	(original)
+++ trunk/sources/rb-library-source.c	Tue Oct 28 12:27:53 2008
@@ -335,6 +335,28 @@
 			list = g_slist_prepend (list, music_dir_uri);
 			eel_gconf_set_string_list (CONF_LIBRARY_LOCATION, list);
 		}
+	} else {
+		/* ensure all library locations are URIs and not file paths */
+		GSList *t;
+		gboolean update = FALSE;
+		for (t = list; t != NULL; t = t->next) {
+			char *location;
+
+			location = (char *)t->data;
+			if (location[0] == '/') {
+				char *uri = g_filename_to_uri (location, NULL, NULL);
+				if (uri != NULL) {
+					rb_debug ("converting library location path %s to URI %s", location, uri);
+					g_free (location);
+					t->data = uri;
+					update = TRUE;
+				}
+			}
+		}
+
+		if (update) {
+			eel_gconf_set_string_list (CONF_LIBRARY_LOCATION, list);
+		}
 	}
 	rb_slist_deep_free (list);
 



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