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

Authored by ahmadsamir on Dec 14 2019, 8:59 AM.

Description

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

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.

Reviewers: Frameworks, mpyne, dfaure, mardelle

Reviewed By: dfaure

Subscribers: kde-frameworks-devel

Tags: Frameworks

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