From: Alan Knowles Date: Wed, 9 May 2018 09:06:59 +0000 (+0800) Subject: src/strip.vala X-Git-Url: http://git.roojs.org/?a=commitdiff_plain;h=f81e1165e05f32c1dd2b4414f2bde7c92ec64b16;p=app.mailtrimmer src/strip.vala --- diff --git a/src/strip.vala b/src/strip.vala index 71351d6..74d1ad1 100644 --- a/src/strip.vala +++ b/src/strip.vala @@ -648,7 +648,7 @@ public class Strip : GLib.Object { this.active_name = name; this.active_message_id = ""; - DateTime mailtime; + DateTime mailtime = new DateTime.local(); if (StripApplication.opt_scan_mailfort) { this.created_dir = this.active_path.substring(this.base_dir.length + 1 ); this.created_date = this.created_dir.replace("/", "-"); @@ -739,10 +739,10 @@ public class Strip : GLib.Object { var oldest = new DateTime.now_local(); oldest.add_months(-1 * StripApplication.opt_min_age); - var tspan = mailtime.difference(oldest) / GLib.TimeSpan.DAY; + var rtspan = mailtime.difference(oldest) / GLib.TimeSpan.DAY; - if (tspan < 0) { - GLib.debug("skip file is %d days older than %d months", (int)tspan, StripApplication.opt_min_age); + if (rtspan < 0) { + GLib.debug("skip file is %d days older than %d months", (int)rtspan, StripApplication.opt_min_age); return; }