Bug 322578 - Unable to get the Comment property of a Mime Type
Summary: Unable to get the Comment property of a Mime Type
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: kdecore (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: kdelibs bugs
Depends on:
Reported: 2013-07-19 16:02 UTC by David E. Narvaez
Modified: 2013-08-05 15:26 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 4.11


Note You need to log in before you can comment on or make changes to this bug.
Description David E. Narvaez 2013-07-19 16:02:16 UTC
The following code sample shows that KMimeType advertises Comment as a property name, but returns nothing

Reproducible: Always

Steps to Reproduce:
KMimeType::Ptr mimeType = KMimeType::mimeType("image/png");
qDebug() << mimeType->propertyNames();
qDebug() << mimeType->property("Comment");
Actual Results:  
("Name", "Comment", "Patterns", "Icon") 
QVariant(QString, "") 

Expected Results:  
Should return the comment for that mime type.
Comment 1 David E. Narvaez 2013-08-05 15:26:30 UTC
Git commit 09030c36b2e5da244c41fde9afbc6eb75a21713b by David E. Narváez.
Committed on 05/08/2013 at 15:23.
Pushed by narvaez into branch 'KDE/4.11'.

Ensure MimeType's XML Data is Loaded before Returning Properties

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.
FIXED-IN: 4.11
REVIEW: 111852

M  +4    -3    kdecore/services/kmimetype.cpp
M  +6    -0    kdecore/services/kmimetype_p.h
M  +10   -0    kdecore/tests/kmimetypetest.cpp
M  +1    -1    kdecore/tests/kmimetypetest.h