CopyJob: when stat'ing the dest, use StatBasic.
ClosedPublic

Authored by dfaure on Apr 16 2020, 11:47 PM.

Details

Summary

However the StatDetail enum doesn't specify which enum value will get us
UDS_LOCAL_PATH (because kio_file doesn't have that). kio_desktop does,
but doesn't honour StatDetail yet. One approach is to consider it part
of Basic, the other is to add a new enum value for it.

Test Plan

jobtest and testtrash still pass

Diff Detail

Repository
R241 KIO
Branch
2020_use_StatDetails
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 25415
Build 25433: arc lint + arc unit
dfaure created this revision.Apr 16 2020, 11:47 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptApr 16 2020, 11:47 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
dfaure requested review of this revision.Apr 16 2020, 11:47 PM
meven added a comment.Apr 17 2020, 7:54 AM

I believe that's just fine but the comment could be updated :
From udsentry.h

/// A local file path if the ioslave display files sitting
/// on the local filesystem (but in another hierarchy, e.g. settings:/ or remote:/)
UDS_LOCAL_PATH

So the settings:/ , remote:/ should return UDS_LOCAL_PATH for KIO::StatBasic, but file:/ should not .
The code here uses UDS_LOCAL_PATH when present only and does not require it.

meven accepted this revision.Apr 17 2020, 7:54 AM
This revision is now accepted and ready to land.Apr 17 2020, 7:54 AM
dfaure updated this revision to Diff 80462.Apr 18 2020, 11:13 AM

update comment

dfaure closed this revision.Apr 18 2020, 11:13 AM

So the settings:/ , remote:/ should return UDS_LOCAL_PATH for KIO::StatBasic, but file:/ should not .

That's for sure, it's redundant for kio_file.

The code here uses UDS_LOCAL_PATH when present only and does not require it

Of course. Remote ioslaves can't even set it ;)
I have adjusted the comment to avoid sounding like it's required.

meven added a comment.Apr 18 2020, 4:32 PM

D28947 for the StatAcl fix

@dfaure git bisect says this caused https://bugs.kde.org/show_bug.cgi?id=421213.

After fixing, maybe we should get a test for that use case?

meven added a comment.May 15 2020, 5:30 AM

@dfaure git bisect says this caused https://bugs.kde.org/show_bug.cgi?id=421213.

After fixing, maybe we should get a test for that use case?

I see the issue, because we don't resolve the symlink here, we don't figure out dest is a folder and hence copyjob acts as if moving file to dest file, instead of to dest dir.

meven added a comment.May 15 2020, 5:43 AM

Fix and test coming