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:
parent
4696bfbb80
commit
4ca2697271
@ -171,6 +171,19 @@ function unloadExtension(extension) {
|
|||||||
return true;
|
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) {
|
function initExtension(uuid) {
|
||||||
let extension = ExtensionUtils.extensions[uuid];
|
let extension = ExtensionUtils.extensions[uuid];
|
||||||
let dir = extension.dir;
|
let dir = extension.dir;
|
||||||
|
@ -318,8 +318,11 @@ const GnomeShellExtensions = new Lang.Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
ReloadExtension: function(uuid) {
|
ReloadExtension: function(uuid) {
|
||||||
ExtensionSystem.unloadExtension(uuid);
|
let extension = ExtensionUtils.extensions[uuid];
|
||||||
ExtensionSystem.loadExtension(uuid);
|
if (!extension)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ExtensionSystem.reloadExtension(extension);
|
||||||
},
|
},
|
||||||
|
|
||||||
CheckForUpdates: function() {
|
CheckForUpdates: function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user