From 1940be118c1799ed8b68e3b85f23c31e4688b4dc Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Tue, 26 May 2015 13:48:55 +0800 Subject: [PATCH] src/Project/Gtk.vala --- src/Project/Gtk.vala | 85 +------------------------------------------- 1 file changed, 1 insertion(+), 84 deletions(-) diff --git a/src/Project/Gtk.vala b/src/Project/Gtk.vala index 4fbba4415..b2c5dbaab 100644 --- a/src/Project/Gtk.vala +++ b/src/Project/Gtk.vala @@ -316,90 +316,7 @@ namespace Project { } - - - public Gee.ArrayList files(string in_path) - { - var ret = new Gee.ArrayList(); - var cfiles = new Gee.ArrayList(); - - var dirname = this.resolve_path( - this.resolve_path_combine_path(this.firstPath(),in_path)); - - GLib.debug("SCAN %s\n", dirname); - // scan the directory for files -- ending with vala || c - - - var dir = File.new_for_path(dirname); - if (!dir.query_exists()) { - GLib.debug("SCAN %s - skip - does not exist\n", dirname); - return ret; - } - - - try { - var file_enum = dir.enumerate_children( - GLib.FileAttribute.STANDARD_DISPLAY_NAME, - GLib.FileQueryInfoFlags.NONE, - null - ); - - - FileInfo next_file; - while ((next_file = file_enum.next_file(null)) != null) { - var fn = next_file.get_display_name(); - - GLib.debug("SCAN %s - checking %s\n", dirname, fn); - if (Regex.match_simple("\\.vala$", fn)) { - ret.add(in_path + "/" + fn); - continue; - } - - if (Regex.match_simple("\\.vala\\.c$", fn)) { - continue; - } - if (Regex.match_simple("\\.c$", fn)) { - - // if we have a vala file with the same name - // then do not add it... - - cfiles.add(in_path + "/" + fn); - continue; - } - // any other valid types??? - - } - - } catch(Error e) { - GLib.warning("oops - something went wrong scanning the projects\n"); - } - - - // add the cfiles to ret - if they do not have a vala... - for (var i = 0; i < cfiles.size; i ++) { - - var fn = cfiles.get(i); - vv = fn; - try { - vv = (new Regex("\\.c$")).replace( fn, fn, 0, ".vala"); - } catch (Error e) { - continue; - } - - - if (ret.index_of( vv) > -1) { - continue; - } - ret.add(fn); - } - - - GLib.debug("SCAN %s = returning %d", dirname, ret.size); - - return ret; - - - } + public string resolve_path_combine_path(string first, string second) -- 2.39.2