forked from qt-creator/qt-creator
CMakePM: Fix "Reset" on changed values in Settings
Previously the reset button would only work on new items being removed. User changes on existing items would not be reverted. Change-Id: I8d9bde058487c9568bfb802f131a29ec32fc1f8c Reviewed-by: Alessandro Portale <alessandro.portale@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -298,6 +298,13 @@ void ConfigModel::setConfiguration(const QList<ConfigModel::InternalDataItem> &c
|
|||||||
// merge old/new entry:
|
// merge old/new entry:
|
||||||
InternalDataItem item(*newIt);
|
InternalDataItem item(*newIt);
|
||||||
item.newValue = (newIt->value != oldIt->newValue) ? oldIt->newValue : QString();
|
item.newValue = (newIt->value != oldIt->newValue) ? oldIt->newValue : QString();
|
||||||
|
|
||||||
|
// Do not mark as user changed when we have a reset
|
||||||
|
if (oldIt->isUserChanged && !oldIt->newValue.isEmpty() &&
|
||||||
|
!newIt->isUserChanged && newIt->newValue.isEmpty() &&
|
||||||
|
oldIt->value == newIt->value)
|
||||||
|
item.newValue.clear();
|
||||||
|
|
||||||
item.isUserChanged = !item.newValue.isEmpty() && (item.newValue != item.value);
|
item.isUserChanged = !item.newValue.isEmpty() && (item.newValue != item.value);
|
||||||
result << item;
|
result << item;
|
||||||
++newIt;
|
++newIt;
|
||||||
|
Reference in New Issue
Block a user