Review Request 111852: Ensure MImeType's XML Data is Loaded before Returning Properties

David Faure faure at kde.org
Sat Aug 3 13:32:00 BST 2013


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



kdecore/services/kmimetype.cpp
<http://git.reviewboard.kde.org/r/111852/#comment27334>

    This will load the xml even when calling property("Name"), which is a bit of a waste.
    
    Maybe the best solution is to check for "Comment" in this code rather than delegate it to KServiceTypePrivate::property, and implement it with return comment().



kdecore/services/kmimetype.cpp
<http://git.reviewboard.kde.org/r/111852/#comment27333>

    So this should just be return patterns(); instead.


- David Faure


On Aug. 3, 2013, 11:31 a.m., David Narváez wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/111852/
> -----------------------------------------------------------
> 
> (Updated Aug. 3, 2013, 11:31 a.m.)
> 
> 
> Review request for kdelibs and David Faure.
> 
> 
> Description
> -------
> 
> Comment information is found in the XML data so needs to be loaded before returning property values. The same would apply for the Patterns property if you were to query that from the property name instead of the KMimeType::patterns() method.
> 
> 
> This addresses bug 322578.
>     http://bugs.kde.org/show_bug.cgi?id=322578
> 
> 
> Diffs
> -----
> 
>   kdecore/services/kmimetype.cpp d748523 
> 
> Diff: http://git.reviewboard.kde.org/r/111852/diff/
> 
> 
> Testing
> -------
> 
> Executed the same code posted in the bug report, here's the output:
> 
> ("Name", "Comment", "Patterns", "Icon") 
> QVariant(QString, "PNG image") 
> 
> 
> Thanks,
> 
> David Narváez
> 
>

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


More information about the kde-core-devel mailing list