Core: Add some sanity check that settings containers don't auto-apply

We use manual 'Apply' in the dialog.

Also, mark a few pages as non-autoapply that were recently changed
away from PagedSettings again which did that autmatically.

Change-Id: Id78cac2770658b18c420813802a0e77443329f39
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2023-07-12 13:35:15 +02:00
parent 54a6145ae9
commit 4c02bc497c
6 changed files with 13 additions and 0 deletions

View File

@@ -164,6 +164,13 @@ void IOptionsPage::apply()
if (m_settingsProvider) {
AspectContainer *container = m_settingsProvider();
QTC_ASSERT(container, return);
// Sanity check: Aspects in option pages should not autoapply.
if (!container->aspects().isEmpty()) {
BaseAspect *aspect = container->aspects().first();
QTC_ASSERT(aspect, return);
QTC_ASSERT(!aspect->isAutoApply(), container->setAutoApply(false));
}
if (container->isDirty()) {
container->apply();
container->writeSettings();