[gnome-shell] extensionSystem: Remove 'disabled-extensions' blacklist
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] extensionSystem: Remove 'disabled-extensions' blacklist
- Date: Wed, 24 Aug 2011 17:59:08 +0000 (UTC)
commit 6d3434f3a51ccf628f598550897db3a911b2cdec
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu Aug 18 07:56:22 2011 -0400
extensionSystem: Remove 'disabled-extensions' blacklist
The two similar keys were hard to manipulate to have specific effects, so just
remove one. Now there is an *explicit* whitelist: all extensions must be in the
'enabled-extensions' for them to be loaded.
https://bugzilla.gnome.org/show_bug.cgi?id=654770
data/org.gnome.shell.gschema.xml.in | 9 ---------
js/ui/extensionSystem.js | 11 ++++-------
2 files changed, 4 insertions(+), 16 deletions(-)
---
diff --git a/data/org.gnome.shell.gschema.xml.in b/data/org.gnome.shell.gschema.xml.in
index 77b0376..924a850 100644
--- a/data/org.gnome.shell.gschema.xml.in
+++ b/data/org.gnome.shell.gschema.xml.in
@@ -11,15 +11,6 @@
using the Alt-F2 dialog.
</_description>
</key>
- <key name="disabled-extensions" type="as">
- <default>[]</default>
- <_summary>Uuids of extensions to disable</_summary>
- <_description>
- GNOME Shell extensions have a uuid property; this key lists extensions
- which should not be loaded. This setting overrides enabled-extensions
- for extensions that appear in both lists.
- </_description>
- </key>
<key name="enabled-extensions" type="as">
<default>[]</default>
<_summary>Uuids of extensions to enable</_summary>
diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js
index 8132902..c4723a0 100644
--- a/js/ui/extensionSystem.js
+++ b/js/ui/extensionSystem.js
@@ -27,7 +27,6 @@ const extensionMeta = {};
// Maps uuid -> importer object (extension directory tree)
const extensions = {};
// Arrays of uuids
-var disabledExtensions;
var enabledExtensions;
// GFile for user extensions
var userExtensionsDir = null;
@@ -44,6 +43,8 @@ const disconnect = Lang.bind(_signals, _signals.disconnect);
// UUID => Array of error messages
var errors = {};
+const ENABLED_EXTENSIONS_KEY = 'enabled-extensions';
+
/**
* versionCheck:
* @required: an array of versions we're compatible with
@@ -201,8 +202,7 @@ function init() {
global.logError('' + e);
}
- disabledExtensions = global.settings.get_strv('disabled-extensions', -1);
- enabledExtensions = global.settings.get_strv('enabled-extensions', -1);
+ enabledExtensions = global.settings.get_strv(ENABLED_EXTENSIONS_KEY);
}
function _loadExtensionsIn(dir, type) {
@@ -220,11 +220,8 @@ function _loadExtensionsIn(dir, type) {
if (fileType != Gio.FileType.DIRECTORY)
continue;
let name = info.get_name();
- // Enable all but disabled extensions if enabledExtensions is not set.
- // If it is set, enable one those, except they are disabled as well.
- let enabled = (enabledExtensions.length == 0 || enabledExtensions.indexOf(name) >= 0)
- && disabledExtensions.indexOf(name) < 0;
let child = dir.get_child(name);
+ let enabled = enabledExtensions.indexOf(name) != -1;
loadExtension(child, enabled, type);
}
fileEnum.close(null);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]