extensionUtils: Create and load the extension object when scanning

This reduces some duplicate code when loading extensions.

https://bugzilla.gnome.org/show_bug.cgi?id=677586
This commit is contained in:
Jasper St. Pierre
2012-06-04 18:25:51 -04:00
parent 498b023989
commit 86de6f5861
3 changed files with 17 additions and 36 deletions

View File

@ -207,20 +207,9 @@ const Application = new Lang.Class({
finder.scanExtensions();
},
_extensionFound: function(signals, uuid, dir, type) {
if (ExtensionUtils.extensions[uuid] !== undefined)
return;
let extension;
try {
extension = ExtensionUtils.createExtensionObject(uuid, dir, type);
} catch(e) {
logError(e, 'Could not create extensions object');
return;
}
_extensionFound: function(signals, extension) {
let iter = this._model.append();
this._model.set(iter, [0, 1], [uuid, extension.metadata.name]);
this._model.set(iter, [0, 1], [extension.uuid, extension.metadata.name]);
this._extensionIters[uuid] = iter;
},