forked from qt-creator/qt-creator
Utils, all: Standardize on QtcSettings
Change-Id: Id222016f15b1c3bfe6710fe5d0297666d4565ef1 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -7,7 +7,9 @@
|
||||
#include "autotesttr.h"
|
||||
#include "testframeworkmanager.h"
|
||||
|
||||
#include <QSettings>
|
||||
#include <utils/qtcsettings.h>
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
namespace Autotest::Internal {
|
||||
|
||||
@@ -109,18 +111,18 @@ void TestSettings::toSettings() const
|
||||
{
|
||||
AspectContainer::writeSettings();
|
||||
|
||||
QSettings *s = Utils::BaseAspect::qtcSettings();
|
||||
QtcSettings *s = BaseAspect::qtcSettings();
|
||||
s->beginGroup(Constants::SETTINGSGROUP);
|
||||
|
||||
// store frameworks and their current active and grouping state
|
||||
for (auto it = frameworks.cbegin(); it != frameworks.cend(); ++it) {
|
||||
const Utils::Id &id = it.key();
|
||||
s->setValue(id.toString(), it.value());
|
||||
s->setValue(id.toString() + groupSuffix, frameworksGrouping.value(id));
|
||||
s->setValue(id.toKey(), it.value());
|
||||
s->setValue(id.toKey() + groupSuffix, frameworksGrouping.value(id));
|
||||
}
|
||||
// ..and the testtools as well
|
||||
for (auto it = tools.cbegin(); it != tools.cend(); ++it)
|
||||
s->setValue(it.key().toString(), it.value());
|
||||
s->setValue(it.key().toKey(), it.value());
|
||||
s->endGroup();
|
||||
}
|
||||
|
||||
@@ -128,7 +130,7 @@ void TestSettings::fromSettings()
|
||||
{
|
||||
AspectContainer::readSettings();
|
||||
|
||||
QSettings *s = Utils::BaseAspect::qtcSettings();
|
||||
QtcSettings *s = BaseAspect::qtcSettings();
|
||||
s->beginGroup(Constants::SETTINGSGROUP);
|
||||
|
||||
// try to get settings for registered frameworks
|
||||
@@ -137,8 +139,8 @@ void TestSettings::fromSettings()
|
||||
frameworksGrouping.clear();
|
||||
for (const ITestFramework *framework : registered) {
|
||||
// get their active state
|
||||
const Utils::Id id = framework->id();
|
||||
const QString key = id.toString();
|
||||
const Id id = framework->id();
|
||||
const Key key = id.toKey();
|
||||
frameworks.insert(id, s->value(key, framework->active()).toBool());
|
||||
// and whether grouping is enabled
|
||||
frameworksGrouping.insert(id, s->value(key + groupSuffix, framework->grouping()).toBool());
|
||||
@@ -148,7 +150,7 @@ void TestSettings::fromSettings()
|
||||
tools.clear();
|
||||
for (const ITestTool *testTool : registeredTools) {
|
||||
const Utils::Id id = testTool->id();
|
||||
tools.insert(id, s->value(id.toString(), testTool->active()).toBool());
|
||||
tools.insert(id, s->value(id.toKey(), testTool->active()).toBool());
|
||||
}
|
||||
s->endGroup();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user