[KAutoSaveFile] Use QUrl::path() instead of toLocalFile()
ClosedPublic

Authored by ahmadsamir on Dec 14 2019, 9:07 AM.

Details

Summary

In staleMatchesManaged() using toLocalFile() means that it'll fail
for remote files, e.g. fish://user@example.com/home/remote/test.txt .
Use path() instead.

This fixes kautosavefiletest.

Note that running that unit test gives:
KAutoSaveFileTest::test_locking() org.kde.kcoreaddons: Could not lock file: "/home/ahmad/.local/share/stalefiles/qttest/test.txtEQofish_%2Fhome%2FremotexOzeiEQo"

But the same happens when building from commit 88d1909, so it's not related
to the recent changes AFAICS.

Test Plan

The code compiles and the unit tests pass.

Diff Detail

Repository
R244 KCoreAddons
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ahmadsamir created this revision.Dec 14 2019, 9:07 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptDec 14 2019, 9:07 AM
ahmadsamir requested review of this revision.Dec 14 2019, 9:07 AM
dfaure accepted this revision.Dec 18 2019, 9:19 PM

Yes. This matches the path() on line 77.

This revision is now accepted and ready to land.Dec 18 2019, 9:19 PM
This revision was automatically updated to reflect the committed changes.

Yes. This matches the path() on line 77.

Thanks for the pointer.