GpgFrontend Project
A Free, Powerful, Easy-to-Use, Compact, Cross-Platform, and Installation-Free OpenPGP(pgp) Crypto Tool.
ModuleSO.h
1
29
#pragma once
30
31
namespace
GpgFrontend
{
32
33
struct
ModuleSO
{
34
QString module_id;
35
QString module_version;
36
QString module_hash;
37
bool
auto_activate;
38
bool
set_by_user;
39
40
ModuleSO
() =
default
;
41
42
explicit
ModuleSO
(
const
QJsonObject& j) {
43
if
(
const
auto
v = j[
"module_id"
]; v.isString()) {
44
module_id = v.toString();
45
}
46
47
if
(
const
auto
v = j[
"module_version"
]; v.isString()) {
48
module_version = v.toString();
49
}
50
51
if
(
const
auto
v = j[
"module_hash"
]; v.isString()) {
52
module_hash = v.toString();
53
}
54
55
if
(
const
auto
v = j[
"auto_activate"
]; v.isBool()) {
56
auto_activate = v.toBool();
57
}
58
59
if
(
const
auto
v = j[
"set_by_user"
]; v.isBool()) {
60
set_by_user = v.toBool();
61
}
62
}
63
64
[[nodiscard]]
auto
ToJson()
const
-> QJsonObject {
65
QJsonObject j;
66
j[
"module_id"
] = module_id;
67
j[
"module_version"
] = module_version;
68
j[
"module_hash"
] = module_hash;
69
j[
"auto_activate"
] = auto_activate;
70
j[
"set_by_user"
] = set_by_user;
71
return
j;
72
}
73
};
74
}
// namespace GpgFrontend
GpgFrontend
Definition:
app.cpp:39
GpgFrontend::ModuleSO
Definition:
ModuleSO.h:33
src
core
struct
settings_object
ModuleSO.h
Generated by
1.9.1