From 40ea45498fb22e892474cc877c870572c16c5e1b Mon Sep 17 00:00:00 2001 From: nordsoft Date: Thu, 7 Sep 2023 19:57:57 +0200 Subject: [PATCH] Rename --- config/schemas/mod.json | 2 +- launcher/modManager/cmodlist.cpp | 6 +++--- launcher/modManager/cmodlistview_moc.cpp | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/config/schemas/mod.json b/config/schemas/mod.json index e4dd19ab3..5415d0275 100644 --- a/config/schemas/mod.json +++ b/config/schemas/mod.json @@ -22,7 +22,7 @@ "type" : "string", "description" : "Author of the mod. Can be nickname, real name or name of team" }, - "size": { + "downloadSize": { "type" : "number", "description" : "Approximate size of mod, compressed by zip algorithm, in Mb" }, diff --git a/launcher/modManager/cmodlist.cpp b/launcher/modManager/cmodlist.cpp index f2700e759..f3b59d81e 100644 --- a/launcher/modManager/cmodlist.cpp +++ b/launcher/modManager/cmodlist.cpp @@ -327,7 +327,7 @@ CModEntry CModList::getMod(QString modname) const //take valid download link, screenshots and mod size before assignment auto download = repo.value("download"); auto screenshots = repo.value("screenshots"); - auto size = repo.value("size"); + auto size = repo.value("downloadSize"); repo = repoValMap; if(repo.value("download").isNull()) { @@ -335,8 +335,8 @@ CModEntry CModList::getMod(QString modname) const if(repo.value("screenshots").isNull()) //taking screenshot from the downloadable version repo["screenshots"] = screenshots; } - if(repo.value("size").isNull()) - repo["size"] = size; + if(repo.value("downloadSize").isNull()) + repo["downloadSize"] = size; } } } diff --git a/launcher/modManager/cmodlistview_moc.cpp b/launcher/modManager/cmodlistview_moc.cpp index dc960f435..c61a99ecf 100644 --- a/launcher/modManager/cmodlistview_moc.cpp +++ b/launcher/modManager/cmodlistview_moc.cpp @@ -249,9 +249,9 @@ QString CModListView::genModInfoText(CModEntry & mod) result += replaceIfNotEmpty(mod.getValue("latestVersion"), lineTemplate.arg(tr("Latest version"))); if(mod.getValue("localSizeBytes").isValid()) - result += replaceIfNotEmpty(CModEntry::sizeToString(mod.getValue("localSizeBytes").toDouble()), lineTemplate.arg(tr("Size"))); - if((mod.isAvailable() || mod.isUpdateable()) && mod.getValue("size").isValid()) - result += replaceIfNotEmpty(CModEntry::sizeToString(mbToBytes(mod.getValue("size").toDouble())), lineTemplate.arg(tr("Download size"))); + result += replaceIfNotEmpty(CModEntry::sizeToString(mod.getValue("localSizeBytes").toDouble()), lineTemplate.arg(tr("downloadSize"))); + if((mod.isAvailable() || mod.isUpdateable()) && mod.getValue("downloadSize").isValid()) + result += replaceIfNotEmpty(CModEntry::sizeToString(mbToBytes(mod.getValue("downloadSize").toDouble())), lineTemplate.arg(tr("Download size"))); result += replaceIfNotEmpty(mod.getValue("author"), lineTemplate.arg(tr("Authors"))); @@ -543,7 +543,7 @@ void CModListView::on_updateButton_clicked() auto mod = modModel->getMod(name); // update required mod, install missing (can be new dependency) if(mod.isUpdateable() || !mod.isInstalled()) - downloadFile(name + ".zip", mod.getValue("download").toString(), "mods", mbToBytes(mod.getValue("size").toDouble())); + downloadFile(name + ".zip", mod.getValue("download").toString(), "mods", mbToBytes(mod.getValue("downloadSize").toDouble())); } } @@ -573,7 +573,7 @@ void CModListView::on_installButton_clicked() { auto mod = modModel->getMod(name); if(!mod.isInstalled()) - downloadFile(name + ".zip", mod.getValue("download").toString(), "mods", mbToBytes(mod.getValue("size").toDouble())); + downloadFile(name + ".zip", mod.getValue("download").toString(), "mods", mbToBytes(mod.getValue("downloadSize").toDouble())); } } @@ -863,7 +863,7 @@ void CModListView::doInstallMod(const QString & modName) { auto mod = modModel->getMod(name); if(!mod.isInstalled()) - downloadFile(name + ".zip", mod.getValue("download").toString(), "mods", mbToBytes(mod.getValue("size").toDouble())); + downloadFile(name + ".zip", mod.getValue("download").toString(), "mods", mbToBytes(mod.getValue("downloadSize").toDouble())); } }