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.