aboutsummaryrefslogtreecommitdiff
path: root/launcher/modplatform/modrinth
diff options
context:
space:
mode:
authorTheKodeToad <TheKodeToad@proton.me>2023-07-09 12:08:15 +0100
committerTheKodeToad <TheKodeToad@proton.me>2023-07-09 12:08:15 +0100
commit6e2fcc9e1102d3955a509c3346b8df15ce52a6a1 (patch)
tree2e267edf3a7f02e9f341fe77da9b684aafef586c /launcher/modplatform/modrinth
parent8ae67b84dbf154bef957bfba1342eac27cd4837e (diff)
downloadPrismLauncher-6e2fcc9e1102d3955a509c3346b8df15ce52a6a1.tar.gz
PrismLauncher-6e2fcc9e1102d3955a509c3346b8df15ce52a6a1.tar.bz2
PrismLauncher-6e2fcc9e1102d3955a509c3346b8df15ce52a6a1.zip
Replace string manipulation in favour of QFileInfo
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
Diffstat (limited to 'launcher/modplatform/modrinth')
-rw-r--r--launcher/modplatform/modrinth/ModrinthPackExportTask.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/launcher/modplatform/modrinth/ModrinthPackExportTask.cpp b/launcher/modplatform/modrinth/ModrinthPackExportTask.cpp
index cbdfd04f..50f6a33c 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";