diff options
| author | Frank Reininghaus <[email protected]> | 2009-05-17 19:57:07 +0000 |
|---|---|---|
| committer | Frank Reininghaus <[email protected]> | 2009-05-17 19:57:07 +0000 |
| commit | 07ad9b3726d8d16041cd8bc6b394eaa784c063b1 (patch) | |
| tree | 9303cbfd6851073c67eebf71ef41fa9141f0387e /src/dolphinmainwindow.cpp | |
| parent | 85a86ee2f0a8b55576f7a7a4f015a22349a53b09 (diff) | |
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
Diffstat (limited to 'src/dolphinmainwindow.cpp')
| -rw-r--r-- | src/dolphinmainwindow.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
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() |
