Bug 327453 - KMimeType seems to ignore sub-class-of information from mime-info db
Summary: KMimeType seems to ignore sub-class-of information from mime-info db
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: kdecore (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-11 14:55 UTC by Friedrich W. H. Kossebau
Modified: 2018-02-19 20:27 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Friedrich W. H. Kossebau 2013-11-11 14:55:11 UTC
Is it possible that KMimeType uses for detection of mimetypes just the data from the db which is directly about the type itself and not also checking e.g. the magic data available for the subtypes?

Example:
call "touch test.xslx" in some directory and browse with Dolphin there, it will be wrongly displayed as "Excel 2007 spreadsheet".

Given the following data from the mime db I would have expected that the magic data for the zip type would also need to work for the subclass of it. Is that a wrong expectation?

/usr/share/mime/packages/freedesktop.org.xml has:
--- 8< ---
[...]
  <mime-type type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">
    <comment>Excel 2007 spreadsheet</comment>
[...]
    <glob pattern="*.xlsx"/>
    <sub-class-of type="application/zip"/>
  </mime-type>
[...]
  <mime-type type="application/zip">
    <comment>Zip archive</comment>
[...]
    <magic priority="40">
      <match value="PK\003\004" type="string" offset="0"/>
    </magic>
    <glob pattern="*.zip"/>
  </mime-type>
--- 8< ---
Comment 1 Friedrich W. H. Kossebau 2013-11-11 14:57:25 UTC
(In reply to comment #0)
> call "touch test.xslx"
bah, typo: should have been
call "touch test.xlsx"
Comment 2 Christoph Feck 2013-11-13 00:10:16 UTC
Which exact KDE version are you using? There were several patches in 4.11.1, 4.11.2, and 4.11.3 that changed the behaviour of KDE mime handling (and it _should_ work now with 4.11.3, but if not, further investigations are needed).
Comment 3 Friedrich W. H. Kossebau 2018-02-19 20:27:57 UTC
Can no longer reproduce with KDE Frameworks 5.43 (or rather QMimeDatabase) ;)
So happily closing as resolved.