[kmail2] [Bug 366768] Reply quote header uses UTC timestamp instead of local time zone

Laurent Montel bugzilla_noreply at kde.org
Wed Jan 11 12:29:23 GMT 2017


https://bugs.kde.org/show_bug.cgi?id=366768

Laurent Montel <montel at kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Latest Commit|https://commits.kde.org/mes |https://commits.kde.org/mes
                   |sagelib/2fafabbf7563c44d75f |sagelib/48ecc0d629cb55e2c45
                   |9e9b06b5314ef3dce4763       |d4facd62b9012db385cff

--- Comment #5 from Laurent Montel <montel at kde.org> ---
Git commit 48ecc0d629cb55e2c45d4facd62b9012db385cff by Montel Laurent.
Committed on 11/01/2017 at 12:29.
Pushed by mlaurent into branch 'Applications/16.12'.

Apply patch from  Matt Whitlock + add autotest to validate it

QDateTime::time() returns a QTime, which conveys no time zone information.
QLocale::toString(const QTime &, QLocale::FormatType) then assumes that the
passed QTime is a local time. This causes a problem when processing a template
in that the time zone information of the Date header in the original message is
ignored, and the time part is then reinterpreted as a local time, which is
incorrect.

Example illustrating the problem:

        Original message header:
        Date: Sun, 1 Jan 2017 13:31:25 -0600

        %OTIMELONG in reply template expands to:
        1:31:25 PM EST

QLocale apparently offers no method to format a QTime with a specific
QTimeZone, so the best that can be done is to convert the QDateTime of the
original message into a local time by calling QDateTime::toLocalTime().

After applying this fix, the above example becomes:

        Original message header:
        Date: Sun, 1 Jan 2017 13:31:25 -0600

        %OTIMELONG in reply template expands to:
        2:31:25 PM EST
Related: bug 308444, bug 355195
(cherry picked from commit 2fafabbf7563c44d75f9e9b06b5314ef3dce4763)

M  +52   -14   templateparser/autotests/templateparsertest.cpp
M  +3    -0    templateparser/autotests/templateparsertest.h
M  +8    -8    templateparser/src/templateparser.cpp

https://commits.kde.org/messagelib/48ecc0d629cb55e2c45d4facd62b9012db385cff

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Kdepim-bugs mailing list