Summary: | Misleading ‘Created’ date in file properties | ||
---|---|---|---|
Product: | [Applications] krusader | Reporter: | Karl Ove Hufthammer <karl> |
Component: | general | Assignee: | Alex Bikadorov <alex.bikadorov> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | alex.bikadorov, bugseforuns, kde, kdelibs-bugs, krusader-bugs-null, meven29, nate |
Priority: | NOR | ||
Version: | 2.7.1 | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | https://commits.kde.org/krusader/951ab660d7336c96a7e7a834f8499c6baa379dcd | Version Fixed In: | |
Sentry Crash Report: | |||
Attachments: | Screenshot showing properties window launched from Krusader |
Description
Karl Ove Hufthammer
2018-08-12 11:30:11 UTC
I believe the *real* creation time (if available) can be found using QFileInfo::birthTime() available in Qt 5.10+ https://doc.qt.io/qt-5/qfileinfo.html#birthTime Technically, that file was "Created" on that given date. However, I can see your point. From what I can tell there's UDS_CREATION_TIME in UDSEntry which might be set to birth time depending on platform/fs. *Real* creation time support on Linux is on my to-do list and is being tracked in Bug 381367. Sadly it's not trivial to simply use QFileInfo::birthTime() because the entire way we populate this information is different. There's a glibc API in 2.28+, but that's generally newer than what most distros are shipping. Using the raw syscall for the next year or two is an option until we can make glibc 2.28 a dependency. *** This bug has been marked as a duplicate of bug 381367 *** The bug is a krusader bug. Due to: https://github.com/KDE/krusader/blob/a7ebda9a8054448f46feb044935236c86021bc29/krusader/FileSystem/fileitem.cpp#L207 More precisely here : https://github.com/KDE/krusader/blob/a7ebda9a8054448f46feb044935236c86021bc29/krusader/FileSystem/filesystem.cpp#L238 It uses stat ctime as creation time, but it is the change status time. To get the creation time, also called birth time, of files, there is a new syscall statx more complete than stat available since glib 2.28. Thanks for the information Méven! Supporting statx with ifdef logic may be too costly. But we should at least fix the mix-up of creation time and ctime. Proposed fix: https://phabricator.kde.org/D20741 Git commit 0920b04b4a841c69cd482e34cfe3e2949d79b9c1 by Alexander Bikadorov. Committed on 05/05/2019 at 19:20. Pushed by abikadorov into branch 'master'. FileSystem: Fix using creation time from KIO as changed time (ctime) Added new field to FileItem instead. And do not show dummy value in UI for missing file times - also for other time types. FIXED: [ 397398 ] Misleading ‘Created’ date in file properties Differential Revision: https://phabricator.kde.org/D20741 M +2 -2 krusader/DiskUsage/diskusage.cpp M +11 -8 krusader/FileSystem/fileitem.cpp M +12 -5 krusader/FileSystem/fileitem.h M +7 -3 krusader/FileSystem/filesystem.cpp M +1 -1 krusader/FileSystem/krquery.cpp M +2 -2 krusader/Panel/PanelView/krsort.cpp M +8 -4 krusader/Panel/PanelView/listmodel.cpp M +1 -1 krusader/Panel/listpanel.cpp M +10 -10 krusader/Synchronizer/synchronizer.cpp https://commits.kde.org/krusader/0920b04b4a841c69cd482e34cfe3e2949d79b9c1 Git commit 951ab660d7336c96a7e7a834f8499c6baa379dcd by Nikita Melnichenko. Committed on 01/07/2019 at 07:16. Pushed by melnichenko into branch 'stable'. FileSystem: Fix using creation time from KIO as changed time (ctime) Added new field to FileItem instead. And do not show dummy value in UI for missing file times - also for other time types. FIXED: [ 397398 ] Misleading ‘Created’ date in file properties Differential Revision: https://phabricator.kde.org/D20741 (cherry picked from commit 0920b04b4a841c69cd482e34cfe3e2949d79b9c1) M +2 -2 krusader/DiskUsage/diskusage.cpp M +11 -8 krusader/FileSystem/fileitem.cpp M +12 -5 krusader/FileSystem/fileitem.h M +7 -3 krusader/FileSystem/filesystem.cpp M +1 -1 krusader/FileSystem/krquery.cpp M +2 -2 krusader/Panel/PanelView/krsort.cpp M +8 -4 krusader/Panel/PanelView/listmodel.cpp M +1 -1 krusader/Panel/listpanel.cpp M +10 -10 krusader/Synchronizer/synchronizer.cpp https://commits.kde.org/krusader/951ab660d7336c96a7e7a834f8499c6baa379dcd |