src/strip.vala
authorAlan Knowles <alan@roojs.com>
Mon, 7 May 2018 05:38:06 +0000 (13:38 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 7 May 2018 05:38:06 +0000 (13:38 +0800)
src/strip.vala

index 7d22182..ce70473 100644 (file)
@@ -648,14 +648,28 @@ public class Strip : GLib.Object {
        this.active_name = name;
        this.active_message_id = "";
 
-        this.created_dir = this.active_path.substring(this.base_dir.length + 1 );
-               this.created_date = this.created_dir.replace("/", "-");
+
+       
+       
        
                var fileinfo = File.new_for_path(path +"/" + name)
                                        .query_info(GLib.FileAttribute.STANDARD_SIZE+","+GLib.FileAttribute.TIME_MODIFIED
                                                ,GLib.FileQueryInfoFlags.NONE,null);
        var file_size = (int) fileinfo.get_size();
-               var mod_time = fileinfo.get_modification_time();                                       
+               var mod_time = fileinfo.get_modification_time();
+               
+               
+               if (StripApplication.opt_scan_mailfort) {
+                   this.created_dir = this.active_path.substring(this.base_dir.length + 1 );
+                       this.created_date = this.created_dir.replace("/", "-");
+       } else {
+               // it's a mail directory...
+               // use the last modification time? as the default...
+                var dts = new DateTime.from_timeval_utc(mod_time);
+                this.created_dir = dts.format("/%Y/%m/%d");;
+       }
+               
+               
                
        this.used_space_before += file_size;