From bd154850e12fb9c839442ebc6e82fa810c3d8e62 Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Sun, 30 Mar 2008 20:26:34 +0000 Subject: [PATCH] Define environment variable in new sessions which is set to the initial working directory of the profile used for the session. svn path=/trunk/KDE/kdebase/apps/konsole/; revision=791952 --- src/SessionManager.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/SessionManager.cpp b/src/SessionManager.cpp index 11199c3a9..0b26c5cdb 100644 --- a/src/SessionManager.cpp +++ b/src/SessionManager.cpp @@ -382,7 +382,14 @@ void SessionManager::applyProfile(Session* session, const Profile::Ptr info , bo session->setInitialWorkingDirectory(info->defaultWorkingDirectory()); if ( apply.shouldApply(Profile::Environment) ) - session->setEnvironment(info->property(Profile::Environment)); + { + // add environment variable containing home directory of current profile + // (if specified) + QStringList environment = info->property(Profile::Environment); + environment << QString("PROFILEHOME=%1").arg(info->defaultWorkingDirectory()); + + session->setEnvironment(environment); + } if ( apply.shouldApply(Profile::Icon) ) session->setIconName(info->icon());