┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinviewcontainer.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-12-12 19:44:28 +0000
committerPeter Penz <[email protected]>2008-12-12 19:44:28 +0000
commit37c5fc08133ff32941c7215c71084d6cdb7c6c6a (patch)
treedefaa3691951450e77c99227fece8e16352d4ff4 /src/dolphinviewcontainer.cpp
parent03407356cac7e07147b22077c5e6218bb8d53063 (diff)
If the users enters an URL that represents a file, open the file by the corresponding application instead of showing an error message.
BUG: 165877 svn path=/trunk/KDE/kdebase/apps/; revision=896189
Diffstat (limited to 'src/dolphinviewcontainer.cpp')
-rw-r--r--src/dolphinviewcontainer.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp
index c75553c4b..371eef654 100644
--- a/src/dolphinviewcontainer.cpp
+++ b/src/dolphinviewcontainer.cpp
@@ -117,6 +117,8 @@ DolphinViewContainer::DolphinViewContainer(DolphinMainWindow* mainWindow,
this, SLOT(showInfoMessage(const QString&)));
connect(m_dirLister, SIGNAL(errorMessage(const QString&)),
this, SLOT(showErrorMessage(const QString&)));
+ connect(m_dirLister, SIGNAL(urlIsFileError(const KUrl&)),
+ this, SLOT(openFile(const KUrl&)));
m_view = new DolphinView(this,
url,
@@ -425,4 +427,13 @@ void DolphinViewContainer::slotItemTriggered(const KFileItem& item)
item.run();
}
+void DolphinViewContainer::openFile(const KUrl& url)
+{
+ // Using m_dolphinModel for getting the file item instance is not possible
+ // here: openFile() is triggered by an error of the directory lister
+ // job, so the file item must be received "manually".
+ const KFileItem item(KFileItem::Unknown, KFileItem::Unknown, url);
+ slotItemTriggered(item);
+}
+
#include "dolphinviewcontainer.moc"