Review Request: make KFileWidget keep current extension if possible

David Faure faure at kde.org
Wed Nov 2 18:20:36 GMT 2011


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/102986/#review7882
-----------------------------------------------------------



kfile/kfilewidget.cpp
<http://git.reviewboard.kde.org/r/102986/#comment6813>

    This will fail with .tar.bz2.
    
    I suggest using KMimeType::extractKnownExtension instead... but that won't tell if that's the same as the chosen mimetype, so how about just 
    KMimeType::findByPath( ... fastmode=true) and checking if that mimetype matches the chosen one?


- David Faure


On Oct. 29, 2011, 11:32 a.m., Martin Koller wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/102986/
> -----------------------------------------------------------
> 
> (Updated Oct. 29, 2011, 11:32 a.m.)
> 
> 
> Review request for kdelibs.
> 
> 
> Description
> -------
> 
> In trying to fix mentioned bug, I found out the original problem lies in KFileWidget:
> If I'm editing a JPEG file which has the non-mainExtension ".jpg" and KFileWidget was told to auto-select an extension,
> then it did not check if the already given extension is one which is also allowed and simply removed
> ".jpg" and added ".jpeg", which is not what a user would expect.
> 
> This patch now checks the current extension against all allowed extensions and if there's a match, it
> keeps the current extension. Only otherwise will it add the default extension.
> 
> 
> This addresses bug 229547.
>     http://bugs.kde.org/show_bug.cgi?id=229547
> 
> 
> Diffs
> -----
> 
>   kfile/kfilewidget.cpp 09b86d4 
> 
> Diff: http://git.reviewboard.kde.org/r/102986/diff/diff
> 
> 
> Testing
> -------
> 
> Used kolourpaint with "name.jpg", "name.jpeg", "name.", "name", "name.tif", "name.tiff"
> 
> 
> Thanks,
> 
> Martin Koller
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20111102/c224a7d4/attachment.htm>


More information about the kde-core-devel mailing list