<table><tr><td style="">astippich created this revision.<br />astippich added reviewers: Baloo, bruns.<br />Herald added projects: Frameworks, Baloo.<br />Herald added a subscriber: kde-frameworks-devel.<br />astippich requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D20011">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p><a href="https://phabricator.kde.org/D18819" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: line-through;">D18819</a> changed the mimetype detection to content matching. However,<br />
this has side effects as the content matching algorithm quite often<br />
puts out ancestor mimetypes, in some case even "application/octet-stream".<br />
To solve this, query both extension and content mimetypes, and only<br />
use the file extension mimetype when the mimetype detected by file content<br />
is an ancestor, and use content mimetype when it isn't.<br />
This gives the precise mime type as before the change, but also prevents<br />
false detection only based on extension, which <a href="https://phabricator.kde.org/D18819" style="background-color: #e7e7e7;
border-color: #e7e7e7;
border-radius: 3px;
padding: 0 4px;
font-weight: bold;
color: black;text-decoration: line-through;">D18819</a> tried to fix.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>unfortunately, no unit tests</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R293 Baloo</div></div></div><br /><div><strong>BRANCH</strong><div><div>master</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D20011">https://phabricator.kde.org/D20011</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/file/extractor/app.cpp</div></div></div><br /><div><strong>To: </strong>astippich, Baloo, bruns<br /><strong>Cc: </strong>kde-frameworks-devel, gennad, domson, ashaposhnikov, michaelh, astippich, spoorun, ngraham, bruns, abrahams<br /></div>