aboutsummaryrefslogtreecommitdiff
path: root/launcher/modplatform/packwiz/Packwiz.cpp
diff options
context:
space:
mode:
authorTheKodeToad <TheKodeToad@proton.me>2023-08-13 13:10:58 +0100
committerGitHub <noreply@github.com>2023-08-13 13:10:58 +0100
commita44cb6430eac81e6e89283c50b57142ca7f05747 (patch)
treef51678d129432b0a68d22de0178ccb8fd4f9a927 /launcher/modplatform/packwiz/Packwiz.cpp
parent44153a28e369943ea16545146fec81f7a62e44dd (diff)
parent35358f8180468af1572c35425b1f60c899d6b07d (diff)
downloadPrismLauncher-a44cb6430eac81e6e89283c50b57142ca7f05747.tar.gz
PrismLauncher-a44cb6430eac81e6e89283c50b57142ca7f05747.tar.bz2
PrismLauncher-a44cb6430eac81e6e89283c50b57142ca7f05747.zip
Merge pull request #1107 from Ryex/chore/add-compiler-warnings
Introduce more strict compiler warnings and fix them
Diffstat (limited to 'launcher/modplatform/packwiz/Packwiz.cpp')
-rw-r--r--launcher/modplatform/packwiz/Packwiz.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/launcher/modplatform/packwiz/Packwiz.cpp b/launcher/modplatform/packwiz/Packwiz.cpp
index 510c7309..82deef8b 100644
--- a/launcher/modplatform/packwiz/Packwiz.cpp
+++ b/launcher/modplatform/packwiz/Packwiz.cpp
@@ -89,7 +89,8 @@ auto intEntry(toml::table table, QString entry_name) -> int
return node.value_or(0);
}
-auto V1::createModFormat(QDir& index_dir, ModPlatform::IndexedPack& mod_pack, ModPlatform::IndexedVersion& mod_version) -> Mod
+auto V1::createModFormat([[maybe_unused]] QDir& index_dir, ModPlatform::IndexedPack& mod_pack, ModPlatform::IndexedVersion& mod_version)
+ -> Mod
{
Mod mod;
@@ -114,7 +115,7 @@ auto V1::createModFormat(QDir& index_dir, ModPlatform::IndexedPack& mod_pack, Mo
return mod;
}
-auto V1::createModFormat(QDir& index_dir, ::Mod& internal_mod, QString slug) -> Mod
+auto V1::createModFormat(QDir& index_dir, [[maybe_unused]] ::Mod& internal_mod, QString slug) -> Mod
{
// Try getting metadata if it exists
Mod mod{ getIndexForMod(index_dir, slug) };
@@ -241,12 +242,13 @@ auto V1::getIndexForMod(QDir& index_dir, QString slug) -> Mod
return {};
}
#else
- table = toml::parse_file(StringUtils::toStdString(index_dir.absoluteFilePath(real_fname)));
- if (!table) {
+ toml::parse_result result = toml::parse_file(StringUtils::toStdString(index_dir.absoluteFilePath(real_fname)));
+ if (!result) {
qWarning() << QString("Could not open file %1!").arg(normalized_fname);
- qWarning() << "Reason: " << QString(table.error().what());
+ qWarning() << "Reason: " << result.error().description();
return {};
}
+ table = result.table();
#endif
// index_file.close();