feat: add hide support for group
Change-Id: I08ca41f4298cc3fdbe1fff1194b239d81c51f3d8
This commit is contained in:
parent
d8682485a6
commit
e7e4fb6692
Notes:
gerrit
2018-02-28 07:36:56 +00:00
Verified+1: Anonymous Coward #1000004 Code-Review+2: Iceyer <me@iceyer.net> Submitted-by: Iceyer <me@iceyer.net> Submitted-at: Wed, 28 Feb 2018 07:36:56 +0000 Reviewed-on: https://cr.deepin.io/32069 Project: dtkcore Branch: refs/heads/master
|
|
@ -30,6 +30,7 @@ public:
|
|||
|
||||
QString key;
|
||||
QString name;
|
||||
bool hide = false;
|
||||
|
||||
QMap<QString, OptionPtr> options;
|
||||
|
||||
|
|
@ -81,6 +82,12 @@ QString DSettingsGroup::name() const
|
|||
return d->name;
|
||||
}
|
||||
|
||||
bool DSettingsGroup::isHidden() const
|
||||
{
|
||||
Q_D(const DSettingsGroup);
|
||||
return d->hide;
|
||||
}
|
||||
|
||||
QPointer<DSettingsGroup> DSettingsGroup::childGroup(const QString &groupKey) const
|
||||
{
|
||||
Q_D(const DSettingsGroup);
|
||||
|
|
@ -139,6 +146,7 @@ void DSettingsGroupPrivate::parseJson(const QString &prefixKey, const QJsonObjec
|
|||
Q_ASSERT(!key.isEmpty());
|
||||
key = prefixKey.isEmpty() ? key : prefixKey + "." + key;
|
||||
name = group.value("name").toString();
|
||||
hide = group.value("hide").toBool();
|
||||
|
||||
for (auto optionJson : group.value("options").toArray()) {
|
||||
auto optionObject = optionJson.toObject();
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ public:
|
|||
|
||||
QString key() const;
|
||||
QString name() const;
|
||||
bool isHidden() const;
|
||||
|
||||
QPointer<DSettingsGroup> childGroup(const QString &groupKey) const;
|
||||
QPointer<DSettingsOption> option(const QString &key) const;
|
||||
|
|
|
|||
Loading…
Reference in New Issue