From 4d64bbcf7d3ead8c658e16db5742c03d590c61eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 6 Sep 2014 16:30:59 +0200 Subject: [PATCH] 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 --- js/ui/extensionSystem.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js index 3f0e1709c..11a75c65e 100644 --- a/js/ui/extensionSystem.js +++ b/js/ui/extensionSystem.js @@ -271,10 +271,17 @@ function onEnabledExtensionsChanged() { } 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) { enabledExtensions.forEach(function(uuid) { - if (ExtensionUtils.extensions[uuid]) - reloadExtension(ExtensionUtils.extensions[uuid]); + enableExtension(uuid); }); } }