From d180bad6f081f1bf2a5eedecb7298281effa8950 Mon Sep 17 00:00:00 2001 From: Thomas Zander Date: Mon, 17 Dec 2007 18:48:26 +0000 Subject: [PATCH] BUG: 152449 This makes sure that if you create a new tab it will always inherit the current dir, unless the profile you use (either the default using 'new tab' or using a profile specifically) has a directory set. In which case it will go to that dir. svn path=/trunk/KDE/kdebase/apps/konsole/; revision=749736 --- src/Application.cpp | 2 +- src/MainWindow.cpp | 2 +- src/Session.cpp | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Application.cpp b/src/Application.cpp index 1c1b28a73..ce178fcee 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -281,7 +281,7 @@ void Application::createWindow(const QString& key , const QString& directory) void Application::createSession(const QString& key , const QString& directory , ViewManager* view) { Session* session = SessionManager::instance()->createSession(key); - if (!directory.isEmpty()) + if (!directory.isEmpty() && session->initialWorkingDirectory().isEmpty()) session->setInitialWorkingDirectory(directory); // create view before starting the session process so that the session doesn't suffer diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index e7053df0d..82f46ff97 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -320,7 +320,7 @@ void MainWindow::showShortcutsDialog() void MainWindow::newFromProfile(const QString& key) { - emit newSessionRequest(key,QString(),_viewManager); + emit newSessionRequest(key, activeSessionDir(), _viewManager); } void MainWindow::showManageProfilesDialog() { diff --git a/src/Session.cpp b/src/Session.cpp index 09c94e996..c925fb441 100644 --- a/src/Session.cpp +++ b/src/Session.cpp @@ -288,6 +288,8 @@ void Session::run() QString cwd_save = QDir::currentPath(); if (!_initialWorkingDir.isEmpty()) _shellProcess->setWorkingDirectory(_initialWorkingDir); + else + _shellProcess->setWorkingDirectory(QDir::homePath()); _shellProcess->setXonXoff(_flowControl); _shellProcess->setErase(_emulation->getErase());