summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgregory guy <g-gregory@gmx.fr>2019-02-20 16:36:48 +0100
committergregory guy <g-gregory@gmx.fr>2019-02-20 16:39:21 +0100
commit1cc8bb41d393acca39fbb986d81a01493c11e231 (patch)
tree419f2c6fb70d35fa911eb88593f73702d64356a8
parent6d8cea2284aaf3633801ae65f4da669c67d0486d (diff)
downloaddolphin-1cc8bb41.tar.gz
dolphin-1cc8bb41.zip
add jar, txz and lzma mimetype, this relates to issue #4
Signed-off-by: gregory guy <g-gregory@gmx.fr>
-rw-r--r--src/dolphinview.cpp12
-rw-r--r--src/urlnavigator.cpp28
2 files changed, 23 insertions, 17 deletions
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp
index cad473a..5b0a310 100644
--- a/src/dolphinview.cpp
+++ b/src/dolphinview.cpp
@@ -708,16 +708,18 @@ void DolphinView::updateURL()
else if (fileItem->isFile()) {
// allow to browse through ZIP and tar files
KMimeType::Ptr mime = fileItem->mimeTypePtr();
- if (mime->is("application/x-zip")) {
+ if( mime->is("application/x-zip") || mime->is("application/x-jar") ) {
KURL url = fileItem->url();
url.setProtocol("zip");
setURL(url);
}
- else if (mime->is("application/x-tar") ||
+ else if( mime->is("application/x-tar") ||
mime->is("application/x-tarz") ||
- mime->is("application/x-tbz") ||
- mime->is("application/x-tgz") ||
- mime->is("application/x-tzo")) {
+ mime->is("application/x-tbz") ||
+ mime->is("application/x-tgz") ||
+ mime->is("application/x-tzo") ||
+ mime->is("application/x-txz") ||
+ mime->is("application/x-tlzma") ) {
KURL url = fileItem->url();
url.setProtocol("tar");
setURL(url);
diff --git a/src/urlnavigator.cpp b/src/urlnavigator.cpp
index 6a3688c..47eab75 100644
--- a/src/urlnavigator.cpp
+++ b/src/urlnavigator.cpp
@@ -119,15 +119,15 @@ void URLNavigator::setURL(const KURL& url)
if (url.protocol() == "zip") {
bool stillInside = false;
- if (KMimeType::findByPath(url.url(-1))
- ->is("application/x-zip")) {
+ if( KMimeType::findByPath( url.url(-1) )->is("application/x-zip") ||
+ KMimeType::findByPath( url.url(-1) )->is("application/x-jar") ) {
stillInside = true;
}
else {
KURL url1 = url.upURL();
while (url1 != url1.upURL()) {
- if (KMimeType::findByPath(url1.url(-1))
- ->is("application/x-zip")) {
+ if( KMimeType::findByPath( url1.url(-1) )->is("application/x-zip") ||
+ KMimeType::findByPath( url1.url(-1) )->is("application/x-jar") ) {
stillInside = true;
break;
}
@@ -145,11 +145,13 @@ void URLNavigator::setURL(const KURL& url)
bool stillInside = false;
KMimeType::Ptr kmp =
KMimeType::findByPath(url.url(-1));
- if (kmp->is("application/x-tar") ||
+ if( kmp->is("application/x-tar") ||
kmp->is("application/x-tarz") ||
- kmp->is("application/x-tbz") ||
- kmp->is("application/x-tgz") ||
- kmp->is("application/x-tzo")
+ kmp->is("application/x-tbz") ||
+ kmp->is("application/x-tgz") ||
+ kmp->is("application/x-tzo") ||
+ kmp->is("application/x-txz") ||
+ kmp->is("application/x-tlzma")
) {
stillInside = true;
}
@@ -158,11 +160,13 @@ void URLNavigator::setURL(const KURL& url)
while (url1 != url1.upURL()) {
KMimeType::Ptr kmp =
KMimeType::findByPath(url1.url(-1));
- if (kmp->is("application/x-tar") ||
+ if( kmp->is("application/x-tar") ||
kmp->is("application/x-tarz") ||
- kmp->is("application/x-tbz") ||
- kmp->is("application/x-tgz") ||
- kmp->is("application/x-tzo")
+ kmp->is("application/x-tbz") ||
+ kmp->is("application/x-tgz") ||
+ kmp->is("application/x-tzo") ||
+ kmp->is("application/x-txz") ||
+ kmp->is("application/x-tlzma")
) {
stillInside = true;
break;