From 932a05c3bb06b4072031e5a9e560e9970bb699fa Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Tue, 17 Sep 2024 13:10:56 +0200 Subject: [PATCH] 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 --- src/plugins/coreplugin/dialogs/ioptionspage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/dialogs/ioptionspage.cpp b/src/plugins/coreplugin/dialogs/ioptionspage.cpp index d4bc7276e2d..a1ff5a3c07b 100644 --- a/src/plugins/coreplugin/dialogs/ioptionspage.cpp +++ b/src/plugins/coreplugin/dialogs/ioptionspage.cpp @@ -263,7 +263,7 @@ void IOptionsPage::apply() if (!container->aspects().isEmpty()) { BaseAspect *aspect = container->aspects().first(); QTC_ASSERT(aspect, return); - QTC_ASSERT(!aspect->isAutoApply(), container->setAutoApply(false)); + QTC_ASSERT(!aspect->isAutoApply(), return); } if (container->isDirty()) { container->apply();