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

Eike Hein noreply at phabricator.kde.org
Tue Nov 28 10:50:11 UTC 2017


hein created this revision.
hein added reviewers: dfaure, thiago, elvisangelaccio.
Restricted Application added a project: Frameworks.
Restricted Application added a subscriber: Frameworks.

REVISION 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.
  
  https://phabricator.kde.org/R241:2353119aae8f03565bc7779ed1d597d266f5afda in kio.git (https://phabricator.kde.org/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

REPOSITORY
  R241 KIO

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D9029

AFFECTED FILES
  src/core/mkpathjob.cpp
  src/filewidgets/knewfilemenu.cpp

To: hein, dfaure, thiago, elvisangelaccio
Cc: #frameworks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20171128/b4a454c2/attachment.html>


More information about the Kde-frameworks-devel mailing list