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
This commit is contained in:
parent
fa0268f35a
commit
6d3434f3a5
@ -11,15 +11,6 @@
|
|||||||
using the Alt-F2 dialog.
|
using the Alt-F2 dialog.
|
||||||
</_description>
|
</_description>
|
||||||
</key>
|
</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">
|
<key name="enabled-extensions" type="as">
|
||||||
<default>[]</default>
|
<default>[]</default>
|
||||||
<_summary>Uuids of extensions to enable</_summary>
|
<_summary>Uuids of extensions to enable</_summary>
|
||||||
|
@ -27,7 +27,6 @@ const extensionMeta = {};
|
|||||||
// Maps uuid -> importer object (extension directory tree)
|
// Maps uuid -> importer object (extension directory tree)
|
||||||
const extensions = {};
|
const extensions = {};
|
||||||
// Arrays of uuids
|
// Arrays of uuids
|
||||||
var disabledExtensions;
|
|
||||||
var enabledExtensions;
|
var enabledExtensions;
|
||||||
// GFile for user extensions
|
// GFile for user extensions
|
||||||
var userExtensionsDir = null;
|
var userExtensionsDir = null;
|
||||||
@ -44,6 +43,8 @@ const disconnect = Lang.bind(_signals, _signals.disconnect);
|
|||||||
// UUID => Array of error messages
|
// UUID => Array of error messages
|
||||||
var errors = {};
|
var errors = {};
|
||||||
|
|
||||||
|
const ENABLED_EXTENSIONS_KEY = 'enabled-extensions';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* versionCheck:
|
* versionCheck:
|
||||||
* @required: an array of versions we're compatible with
|
* @required: an array of versions we're compatible with
|
||||||
@ -201,8 +202,7 @@ function init() {
|
|||||||
global.logError('' + e);
|
global.logError('' + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
disabledExtensions = global.settings.get_strv('disabled-extensions', -1);
|
enabledExtensions = global.settings.get_strv(ENABLED_EXTENSIONS_KEY);
|
||||||
enabledExtensions = global.settings.get_strv('enabled-extensions', -1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function _loadExtensionsIn(dir, type) {
|
function _loadExtensionsIn(dir, type) {
|
||||||
@ -220,11 +220,8 @@ function _loadExtensionsIn(dir, type) {
|
|||||||
if (fileType != Gio.FileType.DIRECTORY)
|
if (fileType != Gio.FileType.DIRECTORY)
|
||||||
continue;
|
continue;
|
||||||
let name = info.get_name();
|
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 child = dir.get_child(name);
|
||||||
|
let enabled = enabledExtensions.indexOf(name) != -1;
|
||||||
loadExtension(child, enabled, type);
|
loadExtension(child, enabled, type);
|
||||||
}
|
}
|
||||||
fileEnum.close(null);
|
fileEnum.close(null);
|
||||||
|
Loading…
Reference in New Issue
Block a user