From 37c5fc08133ff32941c7215c71084d6cdb7c6c6a Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Fri, 12 Dec 2008 19:44:28 +0000 Subject: 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 --- src/dolphinviewcontainer.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/dolphinviewcontainer.cpp') 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" -- cgit v1.3