From 02b8804b96299862bfe01a53190cb710721f213e Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Sat, 10 Sep 2011 22:35:41 -0400 Subject: [PATCH] extensionSystem: Always enable an extension for a user When the user installs an extension, we always enable it. Change the 'enabled-extensions' key, if necessary, to reflect this. https://bugzilla.gnome.org/show_bug.cgi?id=658612 --- js/ui/extensionSystem.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js index f88307047..d6e399abf 100644 --- a/js/ui/extensionSystem.js +++ b/js/ui/extensionSystem.js @@ -184,6 +184,14 @@ function gotExtensionZipFile(session, message, uuid) { GLib.child_watch_add(GLib.PRIORITY_DEFAULT, pid, function(pid, status) { GLib.spawn_close_pid(pid); + + // Add extension to 'enabled-extensions' for the user, always... + let enabledExtensions = global.settings.get_strv(ENABLED_EXTENSIONS_KEY); + if (enabledExtensions.indexOf(uuid) == -1) { + enabledExtensions.push(uuid); + global.settings.set_strv(ENABLED_EXTENSIONS_KEY, enabledExtensions); + } + loadExtension(dir, true, ExtensionType.PER_USER); }); }