refactor: introduce RuntimeContext
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
@ -60,10 +60,10 @@ QList<std::shared_ptr<Rule>> rulesFromJsonV4(const QJsonObject &objectWithRules)
|
||||
auto osNameVal = osObj.value("name");
|
||||
if (!osNameVal.isString())
|
||||
continue;
|
||||
OpSys requiredOs = OpSys_fromString(osNameVal.toString());
|
||||
QString osName = osNameVal.toString();
|
||||
QString versionRegex = osObj.value("version").toString();
|
||||
// add a new OS rule
|
||||
rules.append(OsRule::create(action, requiredOs, versionRegex));
|
||||
rules.append(OsRule::create(action, osName, versionRegex));
|
||||
}
|
||||
return rules;
|
||||
}
|
||||
@ -81,7 +81,7 @@ QJsonObject OsRule::toJson()
|
||||
ruleObj.insert("action", m_result == Allow ? QString("allow") : QString("disallow"));
|
||||
QJsonObject osObj;
|
||||
{
|
||||
osObj.insert("name", OpSys_toString(m_system));
|
||||
osObj.insert("name", m_system);
|
||||
if(!m_version_regexp.isEmpty())
|
||||
{
|
||||
osObj.insert("version", m_version_regexp);
|
||||
|
Reference in New Issue
Block a user