[gnome-shell] Background: don't require a URI scheme for picture-uri



commit 798a0ca240b90d557f42c76d8d9b14c73b1038e1
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Thu Jun 13 21:48:32 2013 +0200

    Background: don't require a URI scheme for picture-uri
    
    Migration from old settings can result in a path instead of URI
    there. This is technically invalid, but can easily recognize it
    and avoid the crash.
    
    Minor changes by Ray Strode
    
    https://bugzilla.gnome.org/show_bug.cgi?id=702121

 js/ui/background.js |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/js/ui/background.js b/js/ui/background.js
index 0e9c3aa..1d9ab7c 100644
--- a/js/ui/background.js
+++ b/js/ui/background.js
@@ -571,7 +571,16 @@ const Background = new Lang.Class({
         }
 
         let uri = this._settings.get_string(PICTURE_URI_KEY);
-        let filename = Gio.File.new_for_uri(uri).get_path();
+        let filename;
+        if (GLib.uri_parse_scheme(uri) != null)
+            filename = Gio.File.new_for_uri(uri).get_path();
+        else
+            filename = uri;
+
+        if (!filename) {
+            this._setLoaded();
+            return;
+        }
 
         this._loadFile(filename);
     },


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