Package: kbiff
Version: 3.8-1.1
Severity: normal
Tags: patch

First of all, thank you Kurt for writing KBiff; it's one of those nice
little tools that makes one's life a bit easier.

Now, the whole messing-with-utime chunk in KBiffMonitor::checkMbox
doesn't work for me, and ends up being off by one hour (probably due to
DST).  Instead of trying to understand its voodoo, I just ripped it out
in favor of a simple call to toTime_t().  (This was introduced in QT
3.1, which I assume postdates the birth of KBiff.)


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (1001, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.26 (SMP w/1 CPU core)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
commit 10b7763683ee4dbf62e542d1f0b6bd405745cd95
Author: Frédéric Brière <[EMAIL PROTECTED]>
Date:   Wed Aug 6 12:32:05 2008 -0400

    Replaced complicated date-time calculations with toTime_t()

diff --git a/kbiff/kbiffmonitor.cpp b/kbiff/kbiffmonitor.cpp
index edd8bc2..8dc031d 100644
--- a/kbiff/kbiffmonitor.cpp
+++ b/kbiff/kbiffmonitor.cpp
@@ -492,22 +492,9 @@ void KBiffMonitor::checkMbox()
         // read.
         {
             utimbuf buf;
-            // we use 'setTime_t' since it takes timezone into account
-            QDateTime unixEpoch;
-            unixEpoch.setTime_t(0);
-            // do a simple test for those systems with hosed timezones.  if
-            // the lastRead and calculated lastRead aren't the same, then
-            // something is wrong with the system
-            QDateTime calc;
-            calc.setTime_t(-mbox.lastRead().secsTo(unixEpoch));
-            if (mbox.lastRead() == calc)
-            {
-              // QDateTime::secsTo returns a negative value if the argument
-              // is before the time the object refers to.
-              buf.actime = -mbox.lastRead().secsTo(unixEpoch);
-              buf.modtime = -mbox.lastModified().secsTo(unixEpoch);
-              utime(QFile::encodeName(mailbox), &buf);
-            }
+            buf.actime = mbox.lastRead().toTime_t();
+            buf.modtime = mbox.lastModified().toTime_t();
+            utime(QFile::encodeName(mailbox), &buf);
         }
 
         // if there are any new messages, consider the state New

Reply via email to