[kmail2] [Bug 355195] date and time are ambiguous when replying to and forwarding messages (no timezone information)

Laurent Montel bugzilla_noreply at kde.org
Wed Jan 11 12:28:27 GMT 2017


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

Laurent Montel <montel at kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Latest Commit|                            |https://commits.kde.org/mes
                   |                            |sagelib/2fafabbf7563c44d75f
                   |                            |9e9b06b5314ef3dce4763
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #6 from Laurent Montel <montel at kde.org> ---
Git commit 2fafabbf7563c44d75f9e9b06b5314ef3dce4763 by Montel Laurent.
Committed on 11/01/2017 at 12:27.
Pushed by mlaurent into branch 'master'.

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 366768

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/2fafabbf7563c44d75f9e9b06b5314ef3dce4763

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


More information about the Kdepim-bugs mailing list