From 616294bc805242f29a5b9c8d44ddd1e7466505ec Mon Sep 17 00:00:00 2001 From: Emmanuel Pescosta Date: Tue, 28 May 2013 17:31:14 +0200 Subject: Bug 196035 - middle clicking on archive files in dolphin does not open them in a new tab When 'browse through archives' is enabled, open archive files like folders on middle clicking, context menu -> new tab action and context menu -> new window action. BUG: 196035 REVIEW: 110487 --- src/dolphinviewcontainer.cpp | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) (limited to 'src/dolphinviewcontainer.cpp') diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp index 44d4ee36f..71dc5fd7b 100644 --- a/src/dolphinviewcontainer.cpp +++ b/src/dolphinviewcontainer.cpp @@ -482,37 +482,12 @@ void DolphinViewContainer::slotItemActivated(const KFileItem& item) // results in an active view. m_view->setActive(true); - KUrl url = item.targetUrl(); - - if (item.isDir()) { + const KUrl& url = DolphinView::openItemAsFolderUrl(item, GeneralSettings::browseThroughArchives()); + if (!url.isEmpty()) { m_view->setUrl(url); return; } - if (GeneralSettings::browseThroughArchives() && item.isFile() && url.isLocalFile()) { - // Generic mechanism for redirecting to tar:// when clicking on a tar file, - // zip:// when clicking on a zip file, etc. - // The .protocol file specifies the mimetype that the kioslave handles. - // Note that we don't use mimetype inheritance since we don't want to - // open OpenDocument files as zip folders... - const QString protocol = KProtocolManager::protocolForArchiveMimetype(item.mimetype()); - if (!protocol.isEmpty()) { - url.setProtocol(protocol); - m_view->setUrl(url); - return; - } - } - - if (item.mimetype() == QLatin1String("application/x-desktop")) { - // Redirect to the URL in Type=Link desktop files - KDesktopFile desktopFile(url.toLocalFile()); - if (desktopFile.hasLinkType()) { - url = desktopFile.readUrl(); - m_view->setUrl(url); - return; - } - } - item.run(); } -- cgit v1.3