extensionSystem: Fix reloading on version-validation changes

The current code only works for enabled extensions, which means
that extensions that were marked OUT_OF_DATE cannot be enabled
without a restart when disabling the version check.
Fix this by reloading all extensions while making sure to only
enable any extensions when we're supposed to.

https://bugzilla.gnome.org/show_bug.cgi?id=736185
This commit is contained in:
Florian Müllner 2014-09-06 16:30:59 +02:00
parent 5bd4329b11
commit 4d64bbcf7d

View File

@ -271,10 +271,17 @@ function onEnabledExtensionsChanged() {
} }
function _onVersionValidationChanged() { function _onVersionValidationChanged() {
// we want to reload all extensions, but only enable
// extensions when allowed by the sessionMode, so
// temporarily disable them all
enabledExtensions = [];
for (let uuid in ExtensionUtils.extensions)
reloadExtension(ExtensionUtils.extensions[uuid]);
enabledExtensions = getEnabledExtensions();
if (Main.sessionMode.allowExtensions) { if (Main.sessionMode.allowExtensions) {
enabledExtensions.forEach(function(uuid) { enabledExtensions.forEach(function(uuid) {
if (ExtensionUtils.extensions[uuid]) enableExtension(uuid);
reloadExtension(ExtensionUtils.extensions[uuid]);
}); });
} }
} }