forked from qt-creator/qt-creator
Core: Don't sneakily set auto apply
When a container is set to !autoApply during apply() its already too late since the aspects will have already applied themselves and therefor the following "isDirty()" check will return false. This leads to really aweful to debug issues where the first time you change an aspect its not saved but on the second try it might be saved if its changed again in the meanwhile. Its better to fail here and never save, I would even suggest a Q_ASSERT and crash but thats against our styleguide. Change-Id: I934f5d7e95615b2c6343a0d601fbcfd0a65b274d Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -263,7 +263,7 @@ void IOptionsPage::apply()
|
|||||||
if (!container->aspects().isEmpty()) {
|
if (!container->aspects().isEmpty()) {
|
||||||
BaseAspect *aspect = container->aspects().first();
|
BaseAspect *aspect = container->aspects().first();
|
||||||
QTC_ASSERT(aspect, return);
|
QTC_ASSERT(aspect, return);
|
||||||
QTC_ASSERT(!aspect->isAutoApply(), container->setAutoApply(false));
|
QTC_ASSERT(!aspect->isAutoApply(), return);
|
||||||
}
|
}
|
||||||
if (container->isDirty()) {
|
if (container->isDirty()) {
|
||||||
container->apply();
|
container->apply();
|
||||||
|
Reference in New Issue
Block a user