From: Alan Knowles Date: Thu, 18 Nov 2010 23:53:51 +0000 (+0800) Subject: Introspect/NameSpace.js X-Git-Url: http://git.roojs.org/?p=gnome.introspection-doc-generator;a=commitdiff_plain;h=4d414f4d8c9e75e89a9ed99edc24d9cb305efcca;hp=fac42b6c9cbdb8e8de18ae28e75bd0d0c61ae949 Introspect/NameSpace.js --- diff --git a/Introspect/NameSpace.js b/Introspect/NameSpace.js index 0d92b75..fa0691d 100644 --- a/Introspect/NameSpace.js +++ b/Introspect/NameSpace.js @@ -27,29 +27,20 @@ NameSpace = { if (!GLib.file_test(dir, GLib.FileTest.EXISTS)) { return; } - File.list(dir) - - while (true) { - - var fn = gdir.read_name ? gdir.read_name () : GLib.dir_read_name(gdir); - // console.log('trying ' + fn); - if (!fn) { - gdir.close ? gdir.close() : GLib.dir_close(gdir); - return;; - } + File.list(dir).forEach(function(fn) + { if (!fn.match(/.typelib$/)) { - continue; + return; } var par = fn.split('-').shift(); //console.log('trying ' + par); if (ret.indexOf(par) > -1) { - continue; + return; } ret.push(par); - - - } + }); } + var gi = GI.Repository.get_default(); var pth = GI.Repository.get_search_path ();