src/strip.vala
authorAlan Knowles <alan@roojs.com>
Wed, 9 May 2018 09:05:45 +0000 (17:05 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 9 May 2018 09:05:45 +0000 (17:05 +0800)
src/strip.vala

index 0e5149e..1b43755 100644 (file)
@@ -648,8 +648,13 @@ public class Strip : GLib.Object {
        this.active_name = name;
        this.active_message_id = "";
 
-
-       
+               DateTime mailtime;
+               if (StripApplication.opt_scan_mailfort) {
+                   this.created_dir = this.active_path.substring(this.base_dir.length + 1 );
+                       this.created_date = this.created_dir.replace("/", "-");
+                       var bits = this.created_date.split("-");
+                       mailtime = new DateTime.local(int.parse(bits[0]),int.parse(bits[1]),int.parse(bits[2]),0,0,0);
+               }
        
        
                var fileinfo = File.new_for_path(path +"/" + name)
@@ -658,14 +663,10 @@ public class Strip : GLib.Object {
        var file_size = (int) fileinfo.get_size();
                var mod_time = fileinfo.get_modification_time();
                
-               DateTime mailtime;
                
-               if (StripApplication.opt_scan_mailfort) {
-                   this.created_dir = this.active_path.substring(this.base_dir.length + 1 );
-                       this.created_date = this.created_dir.replace("/", "-");
-                       var bits = this.created_date.split("-");
-                       mailtime = new DateTime.local(int.parse(bits[0]),int.parse(bits[1]),int.parse(bits[2]),0,0,0);
-       } else {
+               
+               if (!StripApplication.opt_scan_mailfort) {
+                  
                // it's a mail directory...
                // use the last modification time? as the default...
                 mailtime = new DateTime.from_timeval_utc(mod_time);