From 07ad9b3726d8d16041cd8bc6b394eaa784c063b1 Mon Sep 17 00:00:00 2001 From: Frank Reininghaus Date: Sun, 17 May 2009 19:57:07 +0000 Subject: Update the directory of the Terminal Panel if the current URL is not a "file:" URL, but is nevertheless local (e.g., "desktop:"). This fix is also applied to the new "Open external Terminal" action which will be in KDE 4.3. BUG: 167810 svn path=/trunk/KDE/kdebase/apps/; revision=969265 --- src/dolphinmainwindow.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/dolphinmainwindow.cpp') diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index 3ce1e9f2d..f5d175482 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -813,7 +813,18 @@ void DolphinMainWindow::toggleShowMenuBar() void DolphinMainWindow::openTerminal() { - KToolInvocation::invokeTerminal(QString(), m_activeViewContainer->url().path()); + QString dir(QDir::homePath()); + + // If the given directory is not local, it can still be the URL of an + // ioslave using UDS_LOCAL_PATH which to be converted first. + KUrl url = KIO::NetAccess::mostLocalUrl(m_activeViewContainer->url(), this); + + //If the URL is local after the above conversion, set the directory. + if (url.isLocalFile()) { + dir = url.toLocalFile(); + } + + KToolInvocation::invokeTerminal(QString(), dir); } void DolphinMainWindow::editSettings() -- cgit v1.3