Browse Source

add jar, txz and lzma mimetype, this relates to issue #4

Signed-off-by: gregory guy <g-gregory@gmx.fr>
pull/6/head
Gregory Guy 3 months ago
parent
commit
1cc8bb41d3
Signed by: gregory guy <g-gregory@gmx.fr> GPG Key ID: 6EFE0EF249A874C0
2 changed files with 23 additions and 17 deletions
  1. 7
    5
      src/dolphinview.cpp
  2. 16
    12
      src/urlnavigator.cpp

+ 7
- 5
src/dolphinview.cpp View File

@@ -708,16 +708,18 @@ void DolphinView::updateURL()
708 708
     else if (fileItem->isFile()) {
709 709
        // allow to browse through ZIP and tar files
710 710
        KMimeType::Ptr mime = fileItem->mimeTypePtr();
711
-       if (mime->is("application/x-zip")) {
711
+       if( mime->is("application/x-zip") || mime->is("application/x-jar") ) {
712 712
            KURL url = fileItem->url();
713 713
            url.setProtocol("zip");
714 714
            setURL(url);
715 715
        }
716
-       else if (mime->is("application/x-tar") ||
716
+       else if( mime->is("application/x-tar")  ||
717 717
                 mime->is("application/x-tarz") ||
718
-                mime->is("application/x-tbz") ||
719
-                mime->is("application/x-tgz") ||
720
-                mime->is("application/x-tzo")) {
718
+                mime->is("application/x-tbz")  ||
719
+                mime->is("application/x-tgz")  ||
720
+                mime->is("application/x-tzo")  ||
721
+                mime->is("application/x-txz")  ||
722
+                mime->is("application/x-tlzma") ) {
721 723
            KURL url = fileItem->url();
722 724
            url.setProtocol("tar");
723 725
            setURL(url);

+ 16
- 12
src/urlnavigator.cpp View File

@@ -119,15 +119,15 @@ void URLNavigator::setURL(const KURL& url)
119 119
 
120 120
     if (url.protocol() == "zip") {
121 121
        bool stillInside = false;
122
-       if (KMimeType::findByPath(url.url(-1))
123
-           ->is("application/x-zip")) {
122
+       if( KMimeType::findByPath( url.url(-1) )->is("application/x-zip") ||
123
+           KMimeType::findByPath( url.url(-1) )->is("application/x-jar") ) {
124 124
            stillInside = true;
125 125
        }
126 126
        else {
127 127
            KURL url1 = url.upURL();
128 128
            while (url1 != url1.upURL()) {
129
-               if (KMimeType::findByPath(url1.url(-1))
130
-                   ->is("application/x-zip")) {
129
+               if( KMimeType::findByPath( url1.url(-1) )->is("application/x-zip") ||
130
+                   KMimeType::findByPath( url1.url(-1) )->is("application/x-jar") ) {
131 131
                    stillInside = true;
132 132
                    break;
133 133
                }
@@ -145,11 +145,13 @@ void URLNavigator::setURL(const KURL& url)
145 145
        bool stillInside = false;
146 146
        KMimeType::Ptr kmp = 
147 147
            KMimeType::findByPath(url.url(-1));
148
-       if (kmp->is("application/x-tar") ||
148
+       if( kmp->is("application/x-tar")  ||
149 149
            kmp->is("application/x-tarz") ||
150
-           kmp->is("application/x-tbz") || 
151
-           kmp->is("application/x-tgz") || 
152
-           kmp->is("application/x-tzo")
150
+           kmp->is("application/x-tbz")  || 
151
+           kmp->is("application/x-tgz")  || 
152
+           kmp->is("application/x-tzo")  ||
153
+           kmp->is("application/x-txz")  ||
154
+           kmp->is("application/x-tlzma")
153 155
            ) {
154 156
            stillInside = true;
155 157
        }
@@ -158,11 +160,13 @@ void URLNavigator::setURL(const KURL& url)
158 160
            while (url1 != url1.upURL()) {
159 161
                KMimeType::Ptr kmp =
160 162
                    KMimeType::findByPath(url1.url(-1));
161
-               if (kmp->is("application/x-tar") ||
163
+               if( kmp->is("application/x-tar")  ||
162 164
                    kmp->is("application/x-tarz") ||
163
-                   kmp->is("application/x-tbz") || 
164
-                   kmp->is("application/x-tgz") || 
165
-                   kmp->is("application/x-tzo")
165
+                   kmp->is("application/x-tbz")  || 
166
+                   kmp->is("application/x-tgz")  || 
167
+                   kmp->is("application/x-tzo")  ||
168
+                   kmp->is("application/x-txz")  ||
169
+                   kmp->is("application/x-tlzma")
166 170
                    ) {
167 171
                    stillInside = true;
168 172
                    break;

Loading…
Cancel
Save