extensionSystem: Store extensions in a Map

After making the extensions map private to the ExtensionManager, we can
switch it to a proper hash table which is more appropriate.

https://bugzilla.gnome.org/show_bug.cgi?id=789852
This commit is contained in:
Florian Müllner
2019-07-08 00:01:11 +02:00
committed by Florian Müllner
parent 1d6ddf060b
commit 43cb3754d9
5 changed files with 37 additions and 30 deletions

View File

@ -624,15 +624,16 @@ var Extensions = class Extensions {
this._extensionsList.add(this._noExtensions);
this.actor.add(this._extensionsList);
for (let uuid in Main.extensionManager.extensions)
Main.extensionManager.getUuids().forEach(uuid => {
this._loadExtension(null, uuid);
});
Main.extensionManager.connect('extension-loaded',
this._loadExtension.bind(this));
}
_loadExtension(o, uuid) {
let extension = Main.extensionManager.extensions[uuid];
let extension = Main.extensionManager.lookup(uuid);
// There can be cases where we create dummy extension metadata
// that's not really a proper extension. Don't bother with these.
if (!extension.metadata.name)