Review Request 118604: Fix wrong escaping in kfilewidget when selecting multiple files
Mark Gaiser
markg85 at gmail.com
Sat Jun 14 19:37:29 BST 2014
> On June 14, 2014, 8:54 a.m., David Faure wrote:
> > What if the file isn't local?
> >
> > Sounds to me like the bug is elsewhere.
> >
> > Of course for local files, showing a local path looks better than a file:/// URL, so this could be improved, but in a way that doesn't break remote files.
> >
> > The use of KUrl::relativeUrl and putting that into a url looks quite suspicious to me, actually.
> > KUrl didn't work well with relative urls.
> >
> > Maybe locationEditCurrentTextList should be changed into a qstringlist rather than a url list...
> >
> > It would also be interesting to check if this works in the KIO framework (Qt5), where I ported it to QUrl...
>
> Mark Gaiser wrote:
> Just tried it out on KF5. The issue as described on 335922 is partly present.
>
> Input files:
> f#1.png
> f%1.png
> f#2.png
> f%2.png
>
> Command used:
> kdialog --multiple --getopenfilename ~ "*.png|PNG images"
>
> kdialog output when selecting those four files:
> /home/kde-devel/335922/f#1.png /home/kde-devel/335922/f#2.png /home/kde-devel/335922/f%251.png /home/kde-devel/335922/f%252.png
>
> The files with a "#" in them seem to be parsed just fine in KF5. Those with a percent sign still get replaced by "%25".
>
>
> Mark Gaiser wrote:
> Note: Something is fuzzy in that slotOk. When i add one debug line to see the output of locationEditCurrentTextList i get two results (as if slotOk is called twice). The output i get (in a readable way):
> -- First "Orig QUrl list:"
> - QUrl("file:///home/kde-devel/335922/f%231.png")
> - QUrl( "file:///home/kde-devel/335922/f%232.png" )
> - QUrl( "file:///home/kde-devel/335922/f%251.png" )
> - QUrl( "file:///home/kde-devel/335922/f%252.png" )
>
> -- Second "Orig QUrl list:"
> - QUrl("file:///home/kde-devel/335922/f%231.png")
> - QUrl( "file:///home/kde-devel/335922/f%232.png" )
> - QUrl( "file:///home/kde-devel/335922/f%25251.png" ) <-- What happened here?
> - QUrl( "file:///home/kde-devel/335922/f%25252.png" ) <-- What happened here?
"when i add one debug line" : http://p.sc2.nl/pn8jjrqmx :) Sorry for the extra noise.
- Mark
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/118604/#review60070
-----------------------------------------------------------
On June 7, 2014, 4:43 p.m., Victor Dodon wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/118604/
> -----------------------------------------------------------
>
> (Updated June 7, 2014, 4:43 p.m.)
>
>
> Review request for kdelibs, Albert Vaca Cintora and Aaron J. Seigo.
>
>
> Bugs: 335922
> http://bugs.kde.org/show_bug.cgi?id=335922
>
>
> Repository: kdelibs
>
>
> Description
> -------
>
> Only when selecting multiple files in KFileDialog, if a file contains in the name the characters '#' or '%', it is (wrongly) escaped.
>
> The only modification needed is in kfilewidget.cpp, in slotOk, instead of appending to the stringList the pretty url, append the url.toLocalFile, to prevent the double escaping.
>
>
> Diffs
> -----
>
> kfile/kfilewidget.cpp fc9b169
>
> Diff: https://git.reviewboard.kde.org/r/118604/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Victor Dodon
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20140614/7de0226a/attachment.htm>
More information about the kde-core-devel
mailing list