Identify the "application/vnd.rar" MIME type in order to allow some operations

Authored by asensi on Aug 26 2019, 9:23 PM.



In order to solve Users are not able to browse rar files using Return (although it works for 7z, zip files, etc.), the Internet Media Type "application/vnd.rar" is recognized in KrArcBaseManager::getShortTypeFromMime(const QString &mime).


In the type of rar files is "application/x-rar-compressed", but in the aforementioned page it's also declared that

IANA is the official registry of MIME media types and maintains a [list of all the official MIME types](

and precisely in that place what it's stated is "application/vnd.rar", with a link to

where it's written

  1. Deprecated alias names for this type: application/x-rar-compressed

Note: "application/vnd.rar" is already used in Krusader, in KrServices::generateKrarcArchiveMimetypes().

The text "application/x-rar;application/x-rar-compressed;application/vnd.rar" can be searched in

In Kubuntu 18.04 I executed:

$ xdg-mime query default application/x-rar
$ xdg-mime query default application/x-rar-compressed
$ xdg-mime query default application/vnd.rar
$ xdg-mime query default application/vnd.JUST_TO_CHECK_THAT_IT_CAN_FAIL; echo $?

Several people had a similar problem when using other programs ( ,

Test Plan

Browse several compressed files (rar, zip, 7z, etc.) using:

  • the return key,
  • the right arrow key.

Diff Detail

R167 Krusader
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
asensi requested review of this revision.Aug 26 2019, 9:23 PM
asensi created this revision.

+1 according to shared-mime-info the mime type is indeed application/vnd.rar

nhiga added a subscriber: nhiga.EditedAug 27 2019, 11:55 AM

Should we also add application/vnd.rar to krArc/krarc.protocol?

diff --git a/krArc/krarc.protocol b/krArc/krarc.protocol
index 345f103..b49553b 100644
--- a/krArc/krarc.protocol
+++ b/krArc/krarc.protocol
@@ -1,7 +1,7 @@
diff --git a/krArc/krarcbasemanager.cpp b/krArc/krarcbasemanager.cpp
index 5f5f4b8..06cc048 100644
--- a/krArc/krarcbasemanager.cpp
+++ b/krArc/krarcbasemanager.cpp
@@ -212,7 +212,7 @@ QString KrArcBaseManager::getShortTypeFromMime(const QString &mime)
         return "7z";
     // If it's a rar file but its mimetype isn't "application/x-rar"
-    if (mime == "application/x-rar-compressed")
+    if ((mime == "application/x-rar-compressed") || (mime == "application/vnd.rar"))
         return "rar";
     // The short type that will be returned

Should we also add application/vnd.rar to krArc/krarc.protocol?

Just in case, I incorporated it to the proposal, and two reminders were added. Thanks, N. Higa!

asensi updated this revision to Diff 64776.Aug 27 2019, 9:13 PM

"application/vnd.rar" was incorporated to krArc/krarc.protocol, as suggested by N. Higa. Two reminders were also added.

gengisdave accepted this revision as: gengisdave.Sep 12 2019, 12:25 PM
gengisdave added a subscriber: gengisdave.

The patch works fine, although it requires KIO 5.62 or a reverse patch

This revision is now accepted and ready to land.Sep 12 2019, 12:25 PM

Note: For the tests that I performed under Kubuntu 18.04, executing dpkg -l showed:
kio 5.44.0-0ubuntu1 amd64 Resource and network access abstraction

Thanks, Kai Uwe Broulik, N. Higa, and Davide!

This revision was automatically updated to reflect the committed changes.