Bug 322578

Summary: Unable to get the Comment property of a Mime Type
Product: [Frameworks and Libraries] kdelibs Reporter: David E. Narvaez <david.narvaez>
Component: kdecoreAssignee: kdelibs bugs <kdelibs-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 4.11

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

http://commits.kde.org/kdelibs/09030c36b2e5da244c41fde9afbc6eb75a21713b