Add an option to the profile editor to control whether new sessions start in the same directory as the current session.

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=791273
This commit is contained in:
Robert Knight
2008-03-28 22:16:02 +00:00
parent 484a64d055
commit f73cc9c754
6 changed files with 44 additions and 21 deletions

View File

@@ -278,8 +278,12 @@ void Application::createWindow(Profile::Ptr profile , const QString& directory)
Session* Application::createSession(Profile::Ptr profile, const QString& directory , ViewManager* view)
{
if (!profile)
profile = SessionManager::instance()->defaultProfile();
Session* session = SessionManager::instance()->createSession(profile);
if (!directory.isEmpty() && session->initialWorkingDirectory().isEmpty())
if (!directory.isEmpty() && profile->property<bool>(Profile::StartInCurrentSessionDir))
session->setInitialWorkingDirectory(directory);
// create view before starting the session process so that the session doesn't suffer