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
This commit is contained in:
Robert Knight
2008-03-30 20:26:34 +00:00
parent 61d1e13da8
commit bd154850e1

View File

@@ -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<QStringList>(Profile::Environment));
{
// add environment variable containing home directory of current profile
// (if specified)
QStringList environment = info->property<QStringList>(Profile::Environment);
environment << QString("PROFILEHOME=%1").arg(info->defaultWorkingDirectory());
session->setEnvironment(environment);
}
if ( apply.shouldApply(Profile::Icon) )
session->setIconName(info->icon());