Diffusion KIO f2984ff28e72

[StatJob] Make mostLocalUrl ignore remote (ftp, http...etc) URLs

Authored by ahmadsamir on May 13 2020, 6:26 PM.

Description

[StatJob] Make mostLocalUrl ignore remote (ftp, http...etc) URLs

Summary:
Previously mostLocalUrl would check that !url.isLocalFile(), that meant
a statjob would be fired for remote urls (ftp, http... etc), such urls
will never have a mostLocalUrl. Instead check for protocols with Class=:local.

Also if the statjob is created via KIO::mostLocalUrl, the job was, correctly,
cancelled if the url isLocalFile(), extend it to also cancel the job if the
protocol Class isn't ":local".

For a list of such protocols: grep :local /usr/share/kservices5/*.protocol

Thanks to sitter for figuring it out in the bug report.

BUG: 420985
FIXED-IN: 5.71

Test Plan: the jobtest unit test still passes

Reviewers: Frameworks, dfaure, sitter

Subscribers: kde-frameworks-devel

Tags: Frameworks

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