[gnome-shell/gnome-3-8] Background: don't require a URI scheme for	picture-uri
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [gnome-shell/gnome-3-8] Background: don't require a URI scheme for	picture-uri
- Date: Wed, 31 Jul 2013 01:18:11 +0000 (UTC)
commit 35abf39971f236c9e56150055eda914786aff812
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 f2ffce8..13343c6 100644
--- a/js/ui/background.js
+++ b/js/ui/background.js
@@ -590,7 +590,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]