Bug 405282 - Date in file conflict dialog does not respect regional settings
Summary: Date in file conflict dialog does not respect regional settings
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: Overwrite dialog (show other bugs)
Version: 5.64.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
: 405534 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-03-09 20:43 UTC by Patrick Silva
Modified: 2020-05-25 07:40 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.71


Attachments
screenshot (3.01 MB, image/png)
2019-03-09 20:43 UTC, Patrick Silva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2019-03-09 20:43:31 UTC
Created attachment 118672 [details]
screenshot

SUMMARY
See the screenshot please. Date and hour are mixed, hour appears between day (17) and year (2017). Such "date" is bizarre and has nothing to do with my regional settings.


STEPS TO REPRODUCE
1. open dolphin
2. copy a file and paste it into some folder
3. paste the same file into the same folder

OBSERVED RESULT
bizarre "date" including hour between day and year

EXPECTED RESULT
date respects the regional settings

SOFTWARE/OS VERSIONS
Operating System: KDE neon Developer Edition
KDE Plasma Version: 5.15.80
KDE Frameworks Version: 5.57.0
Qt Version: 5.12.0
Comment 1 Patrick Silva 2019-03-16 20:01:44 UTC
*** Bug 405534 has been marked as a duplicate of this bug. ***
Comment 2 Christoph Feck 2019-03-24 11:14:42 UTC
createDateLabel() uses KFileItem::timeString() which in turn uses QDateTime::toString(). The documentation for this function is a bit vague about how it decides about the format, it seems to suggest that the format is "Wed May 20 03:40:13 1998" but with individual fields translated via current QLocale.

I suggest to use QLocale::toString(dateTime, QLocale::LongFormat) instead, but unsure if it should be changed in KFileItem or in the RenameDialog.

References:
https://cgit.kde.org/kio.git/tree/src/widgets/renamedialog.cpp#n77
https://api.kde.org/frameworks/kio/html/kfileitem_8cpp_source.html#l01280
https://doc.qt.io/Qt-5/qdatetime.html#toString-1
https://doc.qt.io/Qt-5/qlocale.html#toString-16
Comment 3 Méven Car 2020-05-24 08:00:40 UTC
Merge request:
https://invent.kde.org/frameworks/kio/-/merge_requests/10
Comment 4 David Faure 2020-05-25 07:40:28 UTC
Git commit 9d68a216a6d885f140da501e575cabec79fd78ad by David Faure, on behalf of Méven Car.
Committed on 25/05/2020 at 07:40.
Pushed by dfaure into branch 'master'.

KFileItem: localize timeString
FIXED-IN: 5.71

M  +2    -1    src/core/kfileitem.cpp

https://invent.kde.org/frameworks/kio/commit/9d68a216a6d885f140da501e575cabec79fd78ad