extensionUtils: Use signals rather than callbacks for finding extensions

This allows us to move to a file-monitor based approach in the future.

Since we need signals, we convert the current set of functions to an
object we attach signals too, leading to the new ExtensionFinder object.

https://bugzilla.gnome.org/show_bug.cgi?id=677586
This commit is contained in:
Jasper St. Pierre
2012-06-04 17:14:18 -04:00
parent 5265884af9
commit 498b023989
3 changed files with 61 additions and 46 deletions

View File

@ -262,8 +262,10 @@ function init() {
}
function loadExtensions() {
ExtensionUtils.scanExtensions(function(uuid, dir, type) {
let finder = new ExtensionUtils.ExtensionFinder();
finder.connect('extension-found', function(signals, uuid, dir, type) {
let enabled = enabledExtensions.indexOf(uuid) != -1;
loadExtension(dir, type, enabled);
});
finder.scanExtensions();
}