shellDBus: Fix reloadExtension

We need to recreate and reimport the extension here, not just reimport
the same exact code.

https://bugzilla.gnome.org/show_bug.cgi?id=682578
This commit is contained in:
Jasper St. Pierre 2012-08-23 22:37:50 -03:00
parent 4696bfbb80
commit 4ca2697271
2 changed files with 18 additions and 2 deletions

View File

@ -171,6 +171,19 @@ function unloadExtension(extension) {
return true;
}
function reloadExtension(oldExtension) {
// Grab the things we'll need to pass to createExtensionObject
// to reload it.
let { uuid: uuid, dir: dir, type: type } = oldExtension;
// Then unload the old extension.
unloadExtension(oldExtension);
// Now, recreate the extension and load it.
let newExtension = ExtensionUtils.createExtensionObject(uuid, dir, type);
loadExtension(newExtension);
}
function initExtension(uuid) {
let extension = ExtensionUtils.extensions[uuid];
let dir = extension.dir;

View File

@ -318,8 +318,11 @@ const GnomeShellExtensions = new Lang.Class({
},
ReloadExtension: function(uuid) {
ExtensionSystem.unloadExtension(uuid);
ExtensionSystem.loadExtension(uuid);
let extension = ExtensionUtils.extensions[uuid];
if (!extension)
return;
ExtensionSystem.reloadExtension(extension);
},
CheckForUpdates: function() {