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
This commit is contained in:
Giovanni Campagna 2015-03-20 12:56:52 -07:00
parent 49fe0335ee
commit 018025dada

View File

@ -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();