blob: 59a032595d483217b03f65ec1d6eb6fc569baae4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include "settingsmanager.h"
#include <coreplugin/icore.h>
#include <utils/qtcassert.h>
using namespace Utils;
namespace Designer::Internal {
static Key addPrefix(const QString &name)
{
Key result;
if (Core::ICore::settings()->group().isEmpty())
result = "Designer";
return Key(result + name.toUtf8());
}
void SettingsManager::beginGroup(const QString &prefix)
{
Core::ICore::settings()->beginGroup(addPrefix(prefix));
}
void SettingsManager::endGroup()
{
Core::ICore::settings()->endGroup();
}
bool SettingsManager::contains(const QString &key) const
{
return Core::ICore::settings()->contains(addPrefix(key));
}
void SettingsManager::setValue(const QString &key, const QVariant &value)
{
Core::ICore::settings()->setValue(addPrefix(key), value);
}
QVariant SettingsManager::value(const QString &key, const QVariant &defaultValue) const
{
return Core::ICore::settings()->value(addPrefix(key), defaultValue);
}
void SettingsManager::remove(const QString &key)
{
Core::ICore::settings()->remove(addPrefix(key));
}
} // Designer::Internal
|