AutoTest: Simplify settings handling

There is no need to check complete settings whether something has
changed before setting them.
Limit the check to what is needed and remove unneeded functionality.

Change-Id: Icdf99d89d795edc20338a774ca7e90b1e4f1e417
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2016-09-16 07:46:05 +02:00
parent f1a85e1441
commit fde344fff3
3 changed files with 10 additions and 33 deletions

View File

@@ -197,18 +197,16 @@ void TestSettingsPage::apply()
if (!m_widget) // page was not shown at all
return;
const TestSettings newSettings = m_widget->settings();
if (newSettings != *m_settings) {
bool frameworkSyncNecessary = newSettings.frameworks != m_settings->frameworks;
*m_settings = newSettings;
m_settings->toSettings(Core::ICore::settings());
if (m_settings->alwaysParse)
TestTreeModel::instance()->enableParsingFromSettings();
else
TestTreeModel::instance()->disableParsingFromSettings();
TestFrameworkManager::instance()->activateFrameworksFromSettings(m_settings);
if (frameworkSyncNecessary)
TestTreeModel::instance()->syncTestFrameworks();
}
bool frameworkSyncNecessary = newSettings.frameworks != m_settings->frameworks;
*m_settings = newSettings;
m_settings->toSettings(Core::ICore::settings());
if (m_settings->alwaysParse)
TestTreeModel::instance()->enableParsingFromSettings();
else
TestTreeModel::instance()->disableParsingFromSettings();
TestFrameworkManager::instance()->activateFrameworksFromSettings(m_settings);
if (frameworkSyncNecessary)
TestTreeModel::instance()->syncTestFrameworks();
}
} // namespace Internal