Members of the KDE Community are recommended to subscribe to the kde-community mailing list at to allow them to participate in important discussions and receive other important announcements

Commit 5504bf75 authored by Kurt Hindenburg's avatar Kurt Hindenburg

Fix 2 issues with Profile->Edit Environment dialog

1. Correctly handle when user removes all lines
2. Correctly handle when user OKs Edit Env dialog and then reopens
   same dialog before closing Edit Profile dialog.

Thanks to ahmadsamir for patch.

Differential Revision:

(cherry picked from commit eaccb7dc)
parent d6ca6c92
......@@ -328,7 +328,17 @@ void EditProfileDialog::showEnvironmentEditor()
bool ok;
const Profile::Ptr profile = lookupProfile();
QStringList currentEnvironment = profile->environment();
QStringList currentEnvironment;
// the user could re-open the environment editor before clicking OK/Apply
// in the parent edit profile dialog, so we make sure to show the the new
// environment vars
if (_tempProfile->isPropertySet(Profile::Environment)) {
currentEnvironment = _tempProfile->environment();
} else {
currentEnvironment = profile->environment();
QString text = QInputDialog::getMultiLineText(this,
i18n("Edit Environment"),
......@@ -336,9 +346,16 @@ void EditProfileDialog::showEnvironmentEditor()
if (ok && !text.isEmpty()) {
QStringList newEnvironment = text.split(QLatin1Char('\n'));
updateTempProfileProperty(Profile::Environment, newEnvironment);
QStringList newEnvironment;
if (ok) {
if(!text.isEmpty()) {
newEnvironment = text.split(QLatin1Char('\n'));
updateTempProfileProperty(Profile::Environment, newEnvironment);
} else {
// the user could have removed all entries so we return an empty list
updateTempProfileProperty(Profile::Environment, newEnvironment);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment