Description: Convert old filenames to an URI, to have migration of GConf
             background to GSettings work correctly. This needs a related
             patch in gsettings-desktop-schemas. It can be removed for next
             LTS, which is the upgrade we maintain.
Author: Rodrigo Moya <rodrigo.moya@canonical.com>

Index: gnome-settings-daemon-3.3.91/plugins/background/gsd-background-manager.c
===================================================================
--- gnome-settings-daemon-3.3.91.orig/plugins/background/gsd-background-manager.c	2012-02-01 20:33:14.000000000 +0100
+++ gnome-settings-daemon-3.3.91/plugins/background/gsd-background-manager.c	2012-03-05 21:04:21.437981478 +0100
@@ -278,8 +278,22 @@
 static void
 setup_bg (GsdBackgroundManager *manager)
 {
+        gchar *bg_uri_orig, *bg_uri_new, *scheme;
+
         g_return_if_fail (manager->priv->bg == NULL);
 
+        /* We first check that picture-uri is indeed a URI */
+        bg_uri_orig = g_settings_get_string (manager->priv->settings, "picture-uri");
+	 if (!(scheme = g_uri_parse_scheme (bg_uri_orig))) {
+                bg_uri_new = g_filename_to_uri (bg_uri_orig, NULL, NULL);
+                g_settings_set_string (manager->priv->settings, "picture-uri", bg_uri_new);
+                g_free (bg_uri_new);
+        }
+
+        g_free (bg_uri_orig);
+        g_free (scheme);
+
+        /* Now really setup the background */
         manager->priv->bg = gnome_bg_new ();
 
         g_signal_connect (manager->priv->bg,
