src/strip.vala
authorAlan Knowles <alan@roojs.com>
Thu, 24 May 2018 08:50:12 +0000 (16:50 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 24 May 2018 08:50:12 +0000 (16:50 +0800)
src/strip.vala

index 59a69b8..e472d6b 100644 (file)
@@ -230,7 +230,7 @@ public class StripApplication : GLib.Application {
                return 0;
         }
 
-               strip.scan_dir(opt_path);
+               strip.scan_dir(opt_path, "");
         
 
         
@@ -862,9 +862,9 @@ public class Strip : GLib.Object {
     }
     
     
-    public void scan_dir(string path)
+    public void scan_dir(string basepath, string subpath)
     {
-        var f = File.new_for_path(path);
+        var f = File.new_for_path(basepath + subpath);
                FileEnumerator file_enum;
         var cancellable = new Cancellable ();
         try {      
@@ -906,9 +906,9 @@ public class Strip : GLib.Object {
                }
                // other files to ignore?
                 
-                this.scan_file(path , next_file.get_display_name());
+                this.scan_file(basepath + subpath , next_file.get_display_name());
                                if(this.has_replaced) {
-                                this.report_state("After scanning %s/%s".printf(path , next_file.get_display_name()));
+                                this.report_state("After scanning %s/%s".printf(basepath + subpath , next_file.get_display_name()));
                        }
                 continue;
             }
@@ -930,14 +930,14 @@ public class Strip : GLib.Object {
                }
             
             
-            var sp = path+"/"+next_file.get_display_name();
+            var sp = subpath+"/"+next_file.get_display_name();
             // skip modules.
             //print("got a file : " + sp);
          
             next_file = null;
             
             
-            this.scan_dir(sp);
+            this.scan_dir(basepath,sp);
             
         }