From 6e2fcc9e1102d3955a509c3346b8df15ce52a6a1 Mon Sep 17 00:00:00 2001 From: TheKodeToad Date: Sun, 9 Jul 2023 12:08:15 +0100 Subject: [PATCH] Replace string manipulation in favour of QFileInfo Signed-off-by: TheKodeToad --- launcher/modplatform/modrinth/ModrinthPackExportTask.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/launcher/modplatform/modrinth/ModrinthPackExportTask.cpp b/launcher/modplatform/modrinth/ModrinthPackExportTask.cpp index cbdfd04f0..50f6a33c6 100644 --- a/launcher/modplatform/modrinth/ModrinthPackExportTask.cpp +++ b/launcher/modplatform/modrinth/ModrinthPackExportTask.cpp @@ -301,10 +301,10 @@ QByteArray ModrinthPackExportTask::generateIndex() const ResolvedFile& value = iterator.value(); // detect disabled mod - QString disabledSuffix = ".disabled"; - if (path.endsWith(disabledSuffix)) { + const QFileInfo pathInfo(path); + if (pathInfo.suffix() == "disabled") { // rename it - path = path.left(path.length() - disabledSuffix.length()); + path = pathInfo.dir().filePath(pathInfo.completeBaseName()); // ...and make it optional QJsonObject env; env["client"] = "optional";