Review Request 123224: KIO::suggestName suggests wrong name for some filenames

David Faure faure at kde.org
Sat Apr 25 19:42:51 UTC 2015


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/123224/#review79509
-----------------------------------------------------------



src/core/global.cpp (line 396)
<https://git.reviewboard.kde.org/r/123224/#comment54323>

    Why do you assemble a list, and then only look at the last element? You just need an int and a QMimeType, if only the last element matters.
    
    Also, why loop over every character? Is the goal to handle .foo.txt vs .tar.gz? There's API for that in QMimeDatabase, it can return the mimetype and even the known suffix without any iteration needed, see QMimeDatabase::suffixForFileName.


- David Faure


On April 4, 2015, 1:15 p.m., Ashish Bansal wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/123224/
> -----------------------------------------------------------
> 
> (Updated April 4, 2015, 1:15 p.m.)
> 
> 
> Review request for KDE Frameworks, Plasma and Aleix Pol Gonzalez.
> 
> 
> Repository: kio
> 
> 
> Description
> -------
> 
> For filenames like filename-1.6.tar.gz, KIO::suggestName suggests wrong name(something like filename-1 2.6.tar.gz).
> Expected name: filename-1.6 (1).tar.gz
> 
> 
> Diffs
> -----
> 
>   autotests/globaltest.cpp ff8725d 
>   src/core/global.cpp f18ac10 
> 
> Diff: https://git.reviewboard.kde.org/r/123224/diff/
> 
> 
> Testing
> -------
> 
> Works fine!
> 
> 
> Thanks,
> 
> Ashish Bansal
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20150425/9c625846/attachment.html>


More information about the Plasma-devel mailing list