aboutsummaryrefslogtreecommitdiff
path: root/launcher/minecraft/Rule.cpp
diff options
context:
space:
mode:
authorTrial97 <alexandru.tripon97@gmail.com>2023-08-05 18:21:09 +0300
committerTrial97 <alexandru.tripon97@gmail.com>2023-08-05 18:21:09 +0300
commit939a2d67ed75be714e9f3b1b918250d006b3860a (patch)
treec5700ba93652e26fc1f86235b1a278d90fd0ce91 /launcher/minecraft/Rule.cpp
parent6f7d901a1f5c02e0629e4bae9172c04bb81ce0d9 (diff)
parentae793f6cf11658c9abc5111e82d5ba7b3e6af127 (diff)
downloadPrismLauncher-939a2d67ed75be714e9f3b1b918250d006b3860a.tar.gz
PrismLauncher-939a2d67ed75be714e9f3b1b918250d006b3860a.tar.bz2
PrismLauncher-939a2d67ed75be714e9f3b1b918250d006b3860a.zip
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into develop12
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Diffstat (limited to 'launcher/minecraft/Rule.cpp')
-rw-r--r--launcher/minecraft/Rule.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/launcher/minecraft/Rule.cpp b/launcher/minecraft/Rule.cpp
index ff3d75f2..d80aab84 100644
--- a/launcher/minecraft/Rule.cpp
+++ b/launcher/minecraft/Rule.cpp
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-only
/*
- * PolyMC - Minecraft Launcher
+ * Prism Launcher - Minecraft Launcher
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
*
* This program is free software: you can redistribute it and/or modify
@@ -33,8 +33,8 @@
* limitations under the License.
*/
-#include <QJsonObject>
#include <QJsonArray>
+#include <QJsonObject>
#include "Rule.h"
@@ -47,7 +47,7 @@ RuleAction RuleAction_fromString(QString name)
return Defer;
}
-QList<std::shared_ptr<Rule>> rulesFromJsonV4(const QJsonObject &objectWithRules)
+QList<std::shared_ptr<Rule>> rulesFromJsonV4(const QJsonObject& objectWithRules)
{
QList<std::shared_ptr<Rule>> rules;
auto rulesVal = objectWithRules.value("rules");
@@ -55,8 +55,7 @@ QList<std::shared_ptr<Rule>> rulesFromJsonV4(const QJsonObject &objectWithRules)
return rules;
QJsonArray ruleList = rulesVal.toArray();
- for (auto ruleVal : ruleList)
- {
+ for (auto ruleVal : ruleList) {
std::shared_ptr<Rule> rule;
if (!ruleVal.isObject())
continue;
@@ -69,8 +68,7 @@ QList<std::shared_ptr<Rule>> rulesFromJsonV4(const QJsonObject &objectWithRules)
continue;
auto osVal = ruleObj.value("os");
- if (!osVal.isObject())
- {
+ if (!osVal.isObject()) {
// add a new implicit action rule
rules.append(ImplicitRule::create(action));
continue;
@@ -102,12 +100,10 @@ QJsonObject OsRule::toJson()
QJsonObject osObj;
{
osObj.insert("name", m_system);
- if(!m_version_regexp.isEmpty())
- {
+ if (!m_version_regexp.isEmpty()) {
osObj.insert("version", m_version_regexp);
}
}
ruleObj.insert("os", osObj);
return ruleObj;
}
-