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
This commit is contained in:
Jasper St. Pierre 2011-09-10 22:35:41 -04:00
parent 7928f90cf6
commit 02b8804b96

View File

@ -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);
});
}