Bug 410624

Summary: File copied from a Samba share to local file system has wrong "Accessed" date
Product: [Frameworks and Libraries] kio-extras Reporter: Patrick Silva <bugseforuns>
Component: SambaAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: nate
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 19.12.3
Sentry Crash Report:
Attachments: screenshot

Description Patrick Silva 2019-08-05 19:37:01 UTC
Created attachment 121948 [details]
screenshot

SUMMARY
kio-extras 19.07.90 on Arch Linux...

STEPS TO REPRODUCE
1. copy a file from a Samba share to your Home
2. right click on the just copied file, select "Properties"
3. 

OBSERVED RESULT
As we can see in the attached screenshot, "Accessed" date  is wrong, year is "2106"

EXPECTED RESULT
correct "Accessed" date

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.16.4
KDE Frameworks Version: 5.60.0
Qt Version: 5.13.0
Comment 1 Nate Graham 2019-08-06 04:05:08 UTC
Was the accessed date for the file wrong before it had been copied?
Comment 2 Patrick Silva 2019-08-06 15:03:00 UTC
(In reply to Nate Graham from comment #1)
> Was the accessed date for the file wrong before it had been copied?

The file located in Samba share has correct "Accessed" date,
the file copied to Home has wrong date.
Comment 3 Nate Graham 2020-02-12 16:28:10 UTC
Patch: https://phabricator.kde.org/D27352
Comment 4 Harald Sitter 2020-02-13 11:27:24 UTC
Git commit 7f47119b22d526fd2ffd9451a9513dfb260a6706 by Harald Sitter.
Committed on 13/02/2020 at 11:16.
Pushed by sitter into branch 'master'.

smb: retain atime properly

Summary:
this was broken since forever I guess. when the .part resume tech was
added it didn't correctly retain the access time. it was trying to
get the atime of 'file', but 'file' when resuming refers to the .part which
was deleted prior to the mtime adjustment so the QFileInfo(file).lastRead
would produce an Invalid QDateTime which then results in us setting random
nonesense as access time on the file.
instead simply use dstFile. it is the path of the actual final destination
file of which the atime is **actually** the one we want to preserve here
considering we've literally just accessed that file by copying it ^^
FIXED-IN: 19.12.3

Test Plan: copy file form smb to local has sound atime

Reviewers: ngraham, meven

Reviewed By: meven

Subscribers: kde-frameworks-devel, kfm-devel

Tags: #dolphin, #frameworks

Differential Revision: https://phabricator.kde.org/D27352

M  +1    -1    smb/kio_smb_dir.cpp

https://commits.kde.org/kio-extras/7f47119b22d526fd2ffd9451a9513dfb260a6706