attempt to fix clang-format and ubuntu build.

Signed-off-by: cullvox <cullvox@outlook.com>
This commit is contained in:
cullvox 2023-09-11 02:05:05 -04:00
parent fbe4043651
commit b16085f66c

View File

@ -26,6 +26,7 @@
#include <quazip/quazipfile.h> #include <quazip/quazipfile.h>
#include <QCryptographicHash> #include <QCryptographicHash>
#include <QRegularExpression>
namespace ResourcePackUtils { namespace ResourcePackUtils {
@ -263,10 +264,8 @@ bool readFormat(const QJsonObject& obj, TextFormat& format)
} }
} }
return getBoolOrFromText(bold, format.bold) && return getBoolOrFromText(bold, format.bold) && getBoolOrFromText(italic, format.italic) &&
getBoolOrFromText(italic, format.italic) && getBoolOrFromText(underlined, format.underlined) && getBoolOrFromText(strikethrough, format.strikethrough);
getBoolOrFromText(underlined, format.underlined) &&
getBoolOrFromText(strikethrough, format.strikethrough);
} }
void appendBeginFormat(TextFormat& format, QString& toAppend) void appendBeginFormat(TextFormat& format, QString& toAppend)
@ -282,7 +281,8 @@ void appendBeginFormat(TextFormat& format, QString& toAppend)
toAppend.append("<s>"); toAppend.append("<s>");
} }
void appendEndFormat(TextFormat& format, QString& toAppend) { void appendEndFormat(TextFormat& format, QString& toAppend)
{
toAppend.append("</font>"); toAppend.append("</font>");
if (format.bold) if (format.bold)
toAppend.append("</b>"); toAppend.append("</b>");
@ -296,7 +296,8 @@ void appendEndFormat(TextFormat& format, QString& toAppend) {
bool processComponent(const QJsonValue& value, QString& result, TextFormat* parentFormat = nullptr); bool processComponent(const QJsonValue& value, QString& result, TextFormat* parentFormat = nullptr);
bool processComponentList(const QJsonArray& arr, QString& result, TextFormat* parentFormat = nullptr) { bool processComponentList(const QJsonArray& arr, QString& result, TextFormat* parentFormat = nullptr)
{
for (const QJsonValue& val : arr) { for (const QJsonValue& val : arr) {
if (!processComponent(val, result, parentFormat)) if (!processComponent(val, result, parentFormat))
@ -306,7 +307,8 @@ bool processComponentList(const QJsonArray& arr, QString& result, TextFormat* pa
return true; return true;
} }
bool processComponent(const QJsonValue& value, QString& result, TextFormat* parentFormat) { bool processComponent(const QJsonValue& value, QString& result, TextFormat* parentFormat)
{
if (value.isString()) { if (value.isString()) {
result.append(value.toString()); result.append(value.toString());
} else if (value.isObject()) { } else if (value.isObject()) {
@ -340,9 +342,8 @@ bool processComponent(const QJsonValue& value, QString& result, TextFormat* pare
} }
// https://minecraft.fandom.com/wiki/Tutorials/Creating_a_resource_pack#Formatting_pack.mcmeta // https://minecraft.fandom.com/wiki/Tutorials/Creating_a_resource_pack#Formatting_pack.mcmeta
bool processMCMeta(ResourcePack& pack, QByteArray&& raw_data) { bool processMCMeta(ResourcePack& pack, QByteArray&& raw_data)
{
try { try {
auto json_doc = QJsonDocument::fromJson(raw_data); auto json_doc = QJsonDocument::fromJson(raw_data);
auto pack_obj = Json::requireObject(json_doc.object(), "pack", {}); auto pack_obj = Json::requireObject(json_doc.object(), "pack", {});