[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [ark/Applications/15.12] kerfuffle: Fix opening of archives whose mimetype cannot be detected-by-con
From:       Elvis Angelaccio <elvis.angelaccio () kdemail ! net>
Date:       2015-12-08 21:26:48
Message-ID: E1a6Pma-0002js-Js () scm ! kde ! org
[Download RAW message or body]

Git commit 3906648d1edcd56edee092ecd992d1366dadc31d by Elvis Angelaccio.
Committed on 08/12/2015 at 21:03.
Pushed by elvisangelaccio into branch 'Applications/15.12'.

Fix opening of archives whose mimetype cannot be detected-by-content

shared-mime-info 1.5 (and thus QMimeDatabase) cannot
detect-by-content tar archives created with the --format=v7 flag.
Instead of adding another exception (like we did for ISO files), let's just use
the mimetype detected from the extension if the one from content could not be
determined.

BUG: 355955
FIXED-IN: 15.12.0

M  +3    -2    kerfuffle/archive_kerfuffle.cpp

http://commits.kde.org/ark/3906648d1edcd56edee092ecd992d1366dadc31d

diff --git a/kerfuffle/archive_kerfuffle.cpp b/kerfuffle/archive_kerfuffle.cpp
index e3397c3..11c8911 100644
--- a/kerfuffle/archive_kerfuffle.cpp
+++ b/kerfuffle/archive_kerfuffle.cpp
@@ -87,8 +87,9 @@ QString Archive::determineMimeType(const QString& filename)
 
     if (mimeFromExtension != mimeFromContent) {
 
-        // #354344: ISO files are currently not detected-by-content.
-        if (mimeFromExtension.inherits(QStringLiteral("application/x-cd-image"))) {
+        if (mimeFromContent == db.mimeTypeForName(QStringLiteral("application/octet-stream"))) {
+            qCWarning(ARK) << "Could not detect mimetype from content."
+                           << "Using extension-based mimetype:" << mimeFromExtension.name();
             return mimeFromExtension.name();
         }
 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic