Diffusion KIO 298c0e734efd

Fix creating a directory via KNewFileMenu+KIO::mkpath on Qt 5.9.3+

Authored by hein on Nov 28 2017, 10:42 AM.

Description

Fix creating a directory via KNewFileMenu+KIO::mkpath on Qt 5.9.3+

Summary:
f62768d04652 in qtbase.git introduced a behavior change in QUrl
causing it to reject URLs with a path of "//foo" (note the double
slash) as invalid.

Both KNewFileMenu and KIO::mkpath contained code following this
pattern:

url.path() + '/' + name

This is a bad mix with forwarding slaves like kio_desktop, which
translate a top-level path of / to some other URL:

(desktop:)/ + / + foo = //foo

This patch addresses the two instances of this by wrapping the
string building in QDir::cleanPath, which I think is the shortest
and most readable way to go.

2353119aae8f in kio.git (D8836) was another commit fixing fallout
from this Qt change. Is unlikely this patch will be the last one.
I suspect many other variations of this problem lurk about the
codebase.

BUG:387073

Reviewers: dfaure, thiago, elvisangelaccio

Subscribers: Frameworks

Tags: Frameworks

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

Details

Committed
heinNov 28 2017, 10:50 AM
Differential Revision
D9029: Fix creating a directory via KNewFileMenu+KIO::mkpath on Qt 5.9.3+
Parents
R241:95d11df88d61: Don't repeat constant values in comments
Branches
Unknown
Tags
Unknown