forked from qt-creator/qt-creator
Utils: Allow multiple edits of an environment variable
There is no reason to limit the environment modifications to unique variables. The environment modifications are processed sequentially from top to bottom and there may modifications that are done on the same variable (e.g. once a prepend, once an append,..) Change-Id: I8a187737be1108e537a926239088c6352dc92957 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -21,8 +21,7 @@ namespace Internal {
|
||||
|
||||
static EnvironmentItems cleanUp(const EnvironmentItems &items)
|
||||
{
|
||||
EnvironmentItems uniqueItems;
|
||||
QSet<QString> uniqueSet;
|
||||
EnvironmentItems cleanedItems;
|
||||
for (int i = items.count() - 1; i >= 0; i--) {
|
||||
EnvironmentItem item = items.at(i);
|
||||
if (HostOsInfo::isWindowsHost())
|
||||
@@ -30,10 +29,10 @@ static EnvironmentItems cleanUp(const EnvironmentItems &items)
|
||||
const QString &itemName = item.name;
|
||||
QString emptyName = itemName;
|
||||
emptyName.remove(QLatin1Char(' '));
|
||||
if (!emptyName.isEmpty() && Utils::insert(uniqueSet, itemName))
|
||||
uniqueItems.prepend(item);
|
||||
if (!emptyName.isEmpty())
|
||||
cleanedItems.prepend(item);
|
||||
}
|
||||
return uniqueItems;
|
||||
return cleanedItems;
|
||||
}
|
||||
|
||||
class TextEditHelper : public QPlainTextEdit
|
||||
|
Reference in New Issue
Block a user