forked from qt-creator/qt-creator
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user