[gnome-shell] dash: use global settings instead of own settings object



commit 018025dada71522255677720deb997cf1a43e629
Author: Giovanni Campagna <gcampagna gnome org>
Date:   Fri Mar 20 12:56:52 2015 -0700

    dash: use global settings instead of own settings object
    
    Makes it easier to reason about change notifications
    
    https://bugzilla.gnome.org/show_bug.cgi?id=746509

 js/ui/dash.js |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/js/ui/dash.js b/js/ui/dash.js
index ba137c7..246bc10 100644
--- a/js/ui/dash.js
+++ b/js/ui/dash.js
@@ -242,8 +242,6 @@ const ShowAppsIcon = new Lang.Class({
     _init: function() {
         this.parent();
 
-        this._settings = new Gio.Settings({ schema_id: 'org.gnome.shell' });
-
         this.toggleButton = new St.Button({ style_class: 'show-apps',
                                             track_hover: true,
                                             can_focus: true,
@@ -272,7 +270,7 @@ const ShowAppsIcon = new Lang.Class({
         if (app == null)
             return false;
 
-        if (!this._settings.is_writable('favorite-apps'))
+        if (!global.settings.is_writable('favorite-apps'))
             return false;
 
         let id = app.get_id();
@@ -430,8 +428,6 @@ const Dash = new Lang.Class({
 
         this._workId = Main.initializeDeferredWork(this._box, Lang.bind(this, this._redisplay));
 
-        this._settings = new Gio.Settings({ schema_id: 'org.gnome.shell' });
-
         this._appSystem = Shell.AppSystem.get_default();
 
         this._appSystem.connect('installed-changed', Lang.bind(this, function() {
@@ -864,7 +860,7 @@ const Dash = new Lang.Class({
         if (app == null || app.is_window_backed())
             return DND.DragMotionResult.NO_DROP;
 
-        if (!this._settings.is_writable('favorite-apps'))
+        if (!global.settings.is_writable('favorite-apps'))
             return DND.DragMotionResult.NO_DROP;
 
         let favorites = AppFavorites.getAppFavorites().getFavorites();
@@ -943,7 +939,7 @@ const Dash = new Lang.Class({
             return false;
         }
 
-        if (!this._settings.is_writable('favorite-apps'))
+        if (!global.settings.is_writable('favorite-apps'))
             return false;
 
         let id = app.get_id();


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