diff -Naur dolphin-0.8.2-orig/src/dolphinview.cpp dolphin-0.8.2-new/src/dolphinview.cpp --- dolphin-0.8.2-orig/src/dolphinview.cpp 2006-12-09 00:00:24.000000000 +0100 +++ dolphin-0.8.2-new/src/dolphinview.cpp 2007-03-10 23:25:15.000000000 +0100 @@ -705,6 +705,27 @@ setURL(KURL(localPath)); } } + else if (fileItem->isFile()) { + // allow to browse through ZIP and tar files + KMimeType::Ptr mime = fileItem->mimeTypePtr(); + if (mime->is("application/x-zip")) { + KURL url = fileItem->url(); + url.setProtocol("zip"); + setURL(url); + } + 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")) { + KURL url = fileItem->url(); + url.setProtocol("tar"); + setURL(url); + } + else { + fileItem->run(); + } + } else { fileItem->run(); } diff -Naur dolphin-0.8.2-orig/src/urlnavigator.cpp dolphin-0.8.2-new/src/urlnavigator.cpp --- dolphin-0.8.2-orig/src/urlnavigator.cpp 2006-11-01 00:07:08.000000000 +0100 +++ dolphin-0.8.2-new/src/urlnavigator.cpp 2007-03-10 23:25:03.000000000 +0100 @@ -116,6 +116,68 @@ void URLNavigator::setURL(const KURL& url) { QString urlStr(url.prettyURL()); + + if (url.protocol() == "zip") { + bool stillInside = false; + if (KMimeType::findByPath(url.url(-1)) + ->is("application/x-zip")) { + stillInside = true; + } + else { + KURL url1 = url.upURL(); + while (url1 != url1.upURL()) { + if (KMimeType::findByPath(url1.url(-1)) + ->is("application/x-zip")) { + stillInside = true; + break; + } + url1 = url1.upURL(); + } + } + if (!stillInside) + { + // Drop the zip:/ protocol since we are not in the zip anymore + urlStr = url.path(); + } + } + else if (url.protocol() == "tar") + { + bool stillInside = false; + KMimeType::Ptr kmp = + KMimeType::findByPath(url.url(-1)); + 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") + ) { + stillInside = true; + } + else { + KURL url1 = url.upURL(); + while (url1 != url1.upURL()) { + KMimeType::Ptr kmp = + KMimeType::findByPath(url1.url(-1)); + 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") + ) { + stillInside = true; + break; + } + url1 = url1.upURL(); + } + } + if (!stillInside) + { + // Drop the tar:/ protocol since we are not in the tar anymore + urlStr = url.path(); + } + } + + if (urlStr.at(0) == '~') { // replace '~' by the home directory urlStr.remove(0, 1);