diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2015-12-06 16:00:18 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2015-12-06 16:00:18 +0100 |
commit | b0ac7d287922e883a2e571222089b680adfe46c6 (patch) | |
tree | 9b252a7b13f1f37f6187911452fc70429b1c79b7 /tdeio | |
parent | 075cf11458a98245a47505b944c5606c1b86afb2 (diff) | |
download | tdelibs-b0ac7d287922e883a2e571222089b680adfe46c6.tar.gz tdelibs-b0ac7d287922e883a2e571222089b680adfe46c6.zip |
Fix mimetype detection using magic library
for mime types not contained in TDE settings
This resolves Bug 2392
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'tdeio')
-rw-r--r-- | tdeio/tdeio/kmimetype.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tdeio/tdeio/kmimetype.cpp b/tdeio/tdeio/kmimetype.cpp index d1bd940eb..197670916 100644 --- a/tdeio/tdeio/kmimetype.cpp +++ b/tdeio/tdeio/kmimetype.cpp @@ -221,8 +221,12 @@ KMimeType::Ptr KMimeType::findByURL( const KURL& _url, mode_t _mode, KMimeMagicResult* result = KMimeMagic::self()->findFileType( path ); - if ( result && result->isValid() && result->accuracy() > 0 ) - return mimeType( result->mimeType() ); + if ( result && result->isValid() && result->accuracy() > 0 ) { + KMimeType::Ptr resultMime = mimeType( result->mimeType() ); + if (resultMime->patternsAccuracy() > 0) { + return resultMime; + } + } } } |