Bug 455315

Summary: Dolphin fails to sort by sub-second modification time
Product: [Applications] dolphin Reporter: Arne Keller <arne.keller>
Component: view-engine: details modeAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: REPORTED ---    
Severity: normal CC: kfm-devel
Priority: NOR    
Version: 22.04.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Arne Keller 2022-06-15 09:38:40 UTC
SUMMARY
If several files are modified in the same second, Dolphin will sort them by name instead of modification time.

STEPS TO REPRODUCE
1. Open a terminal, navigate to some directory
2. Execute `touch file1; touch file3; touch file2`
3. Check that `stat file*` reports three different timestamps. You may need to repeat step 2 if some are equal.
4. Open Dolphin in that directory
5. Switch to details view, sort by modification time

OBSERVED RESULT
Files are sorted by name

EXPECTED RESULT
Files are sorted by modification time

SOFTWARE/OS VERSIONS
Operating System: NixOS 22.05
KDE Plasma Version: 5.24.5
KDE Frameworks Version: 5.93.0
Qt Version: 5.15.3
Kernel Version: 5.10.118 (64-bit)
Graphics Platform: X11

ADDITIONAL INFORMATION
stat output (abridged):
File: file1
Modify: 2022-06-15 11:30:42.328851880 +0200
File: file2
Modify: 2022-06-15 11:30:42.330851877 +0200
File: file3
Modify: 2022-06-15 11:30:42.329851878 +0200

These code segments may be related:
https://invent.kde.org/system/dolphin/-/blob/698e25d8485b9b82ebd28eb9b1b2641bebb35d77/src/kitemviews/kfileitemmodel.cpp#L2055
https://api.kde.org/frameworks/kio/html/udsentry_8cpp_source.html#l00360