aboutsummaryrefslogtreecommitdiff
path: root/launcher/modplatform/flame/FlamePackExportTask.cpp
diff options
context:
space:
mode:
authorTrial97 <alexandru.tripon97@gmail.com>2023-06-24 20:43:45 +0300
committerTrial97 <alexandru.tripon97@gmail.com>2023-06-24 20:43:45 +0300
commitf0e4e07c05bdf68994c9d6a460f4ec4c03a2e627 (patch)
tree1de77f59550709a8757ac9012c75fd9e9dd0c925 /launcher/modplatform/flame/FlamePackExportTask.cpp
parentdf932c65875a20fd95a47c3394a802d131e93993 (diff)
downloadPrismLauncher-f0e4e07c05bdf68994c9d6a460f4ec4c03a2e627.tar.gz
PrismLauncher-f0e4e07c05bdf68994c9d6a460f4ec4c03a2e627.tar.bz2
PrismLauncher-f0e4e07c05bdf68994c9d6a460f4ec4c03a2e627.zip
Updated url function
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Diffstat (limited to 'launcher/modplatform/flame/FlamePackExportTask.cpp')
-rw-r--r--launcher/modplatform/flame/FlamePackExportTask.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/launcher/modplatform/flame/FlamePackExportTask.cpp b/launcher/modplatform/flame/FlamePackExportTask.cpp
index 54294d7b..d729e977 100644
--- a/launcher/modplatform/flame/FlamePackExportTask.cpp
+++ b/launcher/modplatform/flame/FlamePackExportTask.cpp
@@ -36,7 +36,7 @@
#include "modplatform/helpers/HashUtils.h"
#include "tasks/Task.h"
-const QString FlamePackExportTask::TEMPLATE = "<li><a href={url}>{name}{authors}</a></li>";
+const QString FlamePackExportTask::TEMPLATE = "<li><a href={url}>{name}{authors}</a></li>\n";
FlamePackExportTask::FlamePackExportTask(const QString& name,
const QString& version,
@@ -338,12 +338,10 @@ void FlamePackExportTask::buildZip()
QString content = "";
for (auto mod : resolvedFiles) {
if (mod.isMod) {
- auto line = QString(TEMPLATE)
- .replace("{name}", mod.name)
- .replace("{url}", ModPlatform::getMetaURL(ModPlatform::ResourceProvider::FLAME, mod.slug));
- if (!mod.authors.isEmpty())
- line = line.replace("{authors}", QString(" (by {%1})").arg(mod.authors));
- content += line + "\n";
+ content += QString(TEMPLATE)
+ .replace("{name}", mod.name)
+ .replace("{url}", ModPlatform::getMetaURL(ModPlatform::ResourceProvider::FLAME, mod.addonId))
+ .replace("{authors}", !mod.authors.isEmpty() ? QString(" (by {%1})").arg(mod.authors) : "");
}
}
content = "<ul>" + content + "</ul>";