┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinview.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2007-03-10 20:30:17 +0000
committerPeter Penz <[email protected]>2007-03-10 20:30:17 +0000
commit16b56261a8ead7b9862dd3908424b990a419f978 (patch)
treeb986857a74570c8c4c10b6b58f683ba87027898b /src/dolphinview.cpp
parent85a671291b39de21d2d6052120945ae4860c5948 (diff)
Update of the patch from Filip Brcic for browsing through ZIP and TAR files. One part of the patch for the URL navigator has not been committed yet (see notes in URL navigator::setUrl() for details).
svn path=/trunk/KDE/kdebase/apps/; revision=641297
Diffstat (limited to 'src/dolphinview.cpp')
-rw-r--r--src/dolphinview.cpp51
1 files changed, 30 insertions, 21 deletions
diff --git a/src/dolphinview.cpp b/src/dolphinview.cpp
index 6898d059a..3927d9c6d 100644
--- a/src/dolphinview.cpp
+++ b/src/dolphinview.cpp
@@ -638,32 +638,41 @@ void DolphinView::triggerItem(const QModelIndex& index)
return;
}
+ // Prefer the local path over the URL. This assures that the
+ // volume space information is correct. Assuming that the URL is media:/sda1,
+ // and the local path is /windows/C: For the URL the space info is related
+ // to the root partition (and hence wrong) and for the local path the space
+ // info is related to the windows partition (-> correct).
+ const QString localPath(item->localPath());
+ KUrl url;
+ if (localPath.isEmpty()) {
+ url = item->url();
+ }
+ else {
+ url = localPath;
+ }
+
if (item->isDir()) {
- // Prefer the local path over the URL. This assures that the
- // volume space information is correct. Assuming that the URL is media:/sda1,
- // and the local path is /windows/C: For the URL the space info is related
- // to the root partition (and hence wrong) and for the local path the space
- // info is related to the windows partition (-> correct).
- const QString localPath(item->localPath());
- if (localPath.isEmpty()) {
- setUrl(item->url());
- }
- else {
- setUrl(KUrl(localPath));
- }
+ setUrl(url);
}
- else if (item->isFile() && item->mimeTypePtr()->is("application/x-zip")) {
- // allow to browse through ZIP files
- const QString localPath(item->localPath());
- KUrl url;
- if (localPath.isEmpty()) {
- url = item->url();
+ else if (item->isFile()) {
+ // allow to browse through ZIP and tar files
+ KMimeType::Ptr mime = item->mimeTypePtr();
+ if (mime->is("application/x-zip")) {
+ 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")) {
+ url.setProtocol("tar");
+ setUrl(url);
}
else {
- url = localPath;
+ item->run();
}
- url.setProtocol("zip");
- setUrl(url);
}
else {
item->run();