[gnome-shell] extensionSystem: Fix reloading on version-validation changes



commit 4d64bbcf7d3ead8c658e16db5742c03d590c61eb
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Sep 6 16:30:59 2014 +0200

    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 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js
index 3f0e170..11a75c6 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);
         });
     }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]