aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrial97 <alexandru.tripon97@gmail.com>2023-06-28 13:35:42 +0300
committerTrial97 <alexandru.tripon97@gmail.com>2023-06-28 13:35:42 +0300
commit5f1074471d254ff82af1980e15a53b71ae121186 (patch)
tree42fb621f6ca1831554e225e3d7414f235d3b13d4
parentc04cee7ff75730df2c859ecae4567abb4e98dcd4 (diff)
downloadPrismLauncher-5f1074471d254ff82af1980e15a53b71ae121186.tar.gz
PrismLauncher-5f1074471d254ff82af1980e15a53b71ae121186.tar.bz2
PrismLauncher-5f1074471d254ff82af1980e15a53b71ae121186.zip
Corected variable name
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
-rw-r--r--launcher/minecraft/auth/steps/XboxUserStep.cpp2
-rw-r--r--launcher/modplatform/CheckUpdateTask.h4
-rw-r--r--launcher/modplatform/ModIndex.h2
-rw-r--r--launcher/modplatform/flame/FlameAPI.cpp2
-rw-r--r--launcher/modplatform/flame/FlameCheckUpdate.cpp2
-rw-r--r--launcher/modplatform/flame/FlameModIndex.cpp4
-rw-r--r--launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp2
-rw-r--r--launcher/modplatform/modrinth/ModrinthPackIndex.cpp4
-rw-r--r--launcher/ui/dialogs/ModUpdateDialog.cpp20
-rw-r--r--launcher/ui/pages/modplatform/ModPage.cpp2
-rw-r--r--launcher/ui/pages/modplatform/ResourcePage.cpp4
-rw-r--r--launcher/ui/pages/modplatform/flame/FlamePage.cpp11
-rw-r--r--launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp5
13 files changed, 32 insertions, 32 deletions
diff --git a/launcher/minecraft/auth/steps/XboxUserStep.cpp b/launcher/minecraft/auth/steps/XboxUserStep.cpp
index 842eb60f..06b67e81 100644
--- a/launcher/minecraft/auth/steps/XboxUserStep.cpp
+++ b/launcher/minecraft/auth/steps/XboxUserStep.cpp
@@ -38,7 +38,7 @@ void XboxUserStep::perform() {
QNetworkRequest request = QNetworkRequest(QUrl("https://user.auth.xboxlive.com/user/authenticate"));
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
request.setRawHeader("Accept", "application/json");
- // set contract-verison header (prevent err 400 bad-request?)
+ // set contract-version header (prevent err 400 bad-request?)
// https://learn.microsoft.com/en-us/gaming/gdk/_content/gc/reference/live/rest/additional/httpstandardheaders
request.setRawHeader("x-xbl-contract-version", "1");
diff --git a/launcher/modplatform/CheckUpdateTask.h b/launcher/modplatform/CheckUpdateTask.h
index fbafedd7..65c80d26 100644
--- a/launcher/modplatform/CheckUpdateTask.h
+++ b/launcher/modplatform/CheckUpdateTask.h
@@ -23,7 +23,7 @@ class CheckUpdateTask : public Task {
QString old_hash;
QString old_version;
QString new_version;
- std::optional<ModPlatform::IndexedVersionType> new_verison_type;
+ std::optional<ModPlatform::IndexedVersionType> new_version_type;
QString changelog;
ModPlatform::ResourceProvider provider;
shared_qobject_ptr<ResourceDownloadTask> download;
@@ -41,7 +41,7 @@ class CheckUpdateTask : public Task {
, old_hash(old_h)
, old_version(old_v)
, new_version(new_v)
- , new_verison_type(new_v_type)
+ , new_version_type(new_v_type)
, changelog(changelog)
, provider(p)
, download(t)
diff --git a/launcher/modplatform/ModIndex.h b/launcher/modplatform/ModIndex.h
index b47d0948..4ed9e7eb 100644
--- a/launcher/modplatform/ModIndex.h
+++ b/launcher/modplatform/ModIndex.h
@@ -96,7 +96,7 @@ struct IndexedVersion {
QVariant fileId;
QString version;
QString version_number = {};
- IndexedVersionType verison_type;
+ IndexedVersionType version_type;
QStringList mcVersion;
QString downloadUrl;
QString date;
diff --git a/launcher/modplatform/flame/FlameAPI.cpp b/launcher/modplatform/flame/FlameAPI.cpp
index 43470300..885c4687 100644
--- a/launcher/modplatform/flame/FlameAPI.cpp
+++ b/launcher/modplatform/flame/FlameAPI.cpp
@@ -135,7 +135,7 @@ auto FlameAPI::getLatestVersion(VersionSearchArgs&& args) -> ModPlatform::Indexe
for (auto file : arr) {
auto file_obj = Json::requireObject(file);
auto file_tmp = FlameMod::loadIndexedPackVersion(file_obj);
- bool better_release = file_tmp.verison_type <= ver_tmp.verison_type;
+ bool better_release = file_tmp.version_type <= ver_tmp.version_type;
if (file_tmp.date > ver_tmp.date && better_release) {
ver_tmp = file_tmp;
latest_file_obj = file_obj;
diff --git a/launcher/modplatform/flame/FlameCheckUpdate.cpp b/launcher/modplatform/flame/FlameCheckUpdate.cpp
index cf159cad..5ff833cf 100644
--- a/launcher/modplatform/flame/FlameCheckUpdate.cpp
+++ b/launcher/modplatform/flame/FlameCheckUpdate.cpp
@@ -173,7 +173,7 @@ void FlameCheckUpdate::executeTask()
}
auto download_task = makeShared<ResourceDownloadTask>(pack, latest_ver, m_mods_folder);
- m_updatable.emplace_back(pack->name, mod->metadata()->hash, old_version, latest_ver.version, latest_ver.verison_type,
+ m_updatable.emplace_back(pack->name, mod->metadata()->hash, old_version, latest_ver.version, latest_ver.version_type,
api.getModFileChangelog(latest_ver.addonId.toInt(), latest_ver.fileId.toInt()),
ModPlatform::ResourceProvider::FLAME, download_task);
}
diff --git a/launcher/modplatform/flame/FlameModIndex.cpp b/launcher/modplatform/flame/FlameModIndex.cpp
index 108d8b37..5a44d4db 100644
--- a/launcher/modplatform/flame/FlameModIndex.cpp
+++ b/launcher/modplatform/flame/FlameModIndex.cpp
@@ -94,7 +94,7 @@ void FlameMod::loadIndexedPackVersions(ModPlatform::IndexedPack& pack,
}
auto orderSortPredicate = [](const ModPlatform::IndexedVersion& a, const ModPlatform::IndexedVersion& b) -> bool {
- bool a_better_release = a.verison_type <= b.verison_type;
+ bool a_better_release = a.version_type <= b.version_type;
// dates are in RFC 3339 format
return a.date > b.date && a_better_release;
};
@@ -124,7 +124,7 @@ auto FlameMod::loadIndexedPackVersion(QJsonObject& obj, bool load_changelog) ->
file.version = Json::requireString(obj, "displayName");
file.downloadUrl = Json::ensureString(obj, "downloadUrl");
file.fileName = Json::requireString(obj, "fileName");
- file.verison_type = ModPlatform::IndexedVersionType(Json::requireInteger(obj, "releaseType"));
+ file.version_type = ModPlatform::IndexedVersionType(Json::requireInteger(obj, "releaseType"));
auto hash_list = Json::ensureArray(obj, "hashes");
for (auto h : hash_list) {
diff --git a/launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp b/launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp
index 3ee22818..845e0c61 100644
--- a/launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp
+++ b/launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp
@@ -162,7 +162,7 @@ void ModrinthCheckUpdate::executeTask()
auto download_task = makeShared<ResourceDownloadTask>(pack, project_ver, m_mods_folder);
- m_updatable.emplace_back(pack->name, hash, mod->version(), project_ver.version_number, project_ver.verison_type,
+ m_updatable.emplace_back(pack->name, hash, mod->version(), project_ver.version_number, project_ver.version_type,
project_ver.changelog, ModPlatform::ResourceProvider::MODRINTH, download_task);
}
}
diff --git a/launcher/modplatform/modrinth/ModrinthPackIndex.cpp b/launcher/modplatform/modrinth/ModrinthPackIndex.cpp
index 4d0882f6..d93d870c 100644
--- a/launcher/modplatform/modrinth/ModrinthPackIndex.cpp
+++ b/launcher/modplatform/modrinth/ModrinthPackIndex.cpp
@@ -109,7 +109,7 @@ void Modrinth::loadIndexedPackVersions(ModPlatform::IndexedPack& pack,
unsortedVersions.append(file);
}
auto orderSortPredicate = [](const ModPlatform::IndexedVersion& a, const ModPlatform::IndexedVersion& b) -> bool {
- bool a_better_release = a.verison_type <= b.verison_type;
+ bool a_better_release = a.version_type <= b.version_type;
// dates are in RFC 3339 format
return a.date > b.date && a_better_release;
};
@@ -139,7 +139,7 @@ auto Modrinth::loadIndexedPackVersion(QJsonObject& obj, QString preferred_hash_t
}
file.version = Json::requireString(obj, "name");
file.version_number = Json::requireString(obj, "version_number");
- file.verison_type = ModPlatform::IndexedVersionType(Json::requireString(obj, "version_type"));
+ file.version_type = ModPlatform::IndexedVersionType(Json::requireString(obj, "version_type"));
file.changelog = Json::requireString(obj, "changelog");
diff --git a/launcher/ui/dialogs/ModUpdateDialog.cpp b/launcher/ui/dialogs/ModUpdateDialog.cpp
index 9e010444..79622ff7 100644
--- a/launcher/ui/dialogs/ModUpdateDialog.cpp
+++ b/launcher/ui/dialogs/ModUpdateDialog.cpp
@@ -89,15 +89,17 @@ void ModUpdateDialog::checkCandidates()
if (!m_modrinth_to_update.empty()) {
m_modrinth_check_task.reset(new ModrinthCheckUpdate(m_modrinth_to_update, versions, loaders, m_mod_model));
- connect(m_modrinth_check_task.get(), &CheckUpdateTask::checkFailed, this,
- [this](Mod* mod, QString reason, QUrl recover_url) { m_failed_check_update.append({mod, reason, recover_url}); });
+ connect(m_modrinth_check_task.get(), &CheckUpdateTask::checkFailed, this, [this](Mod* mod, QString reason, QUrl recover_url) {
+ m_failed_check_update.append({ mod, reason, recover_url });
+ });
check_task.addTask(m_modrinth_check_task);
}
if (!m_flame_to_update.empty()) {
m_flame_check_task.reset(new FlameCheckUpdate(m_flame_to_update, versions, loaders, m_mod_model));
- connect(m_flame_check_task.get(), &CheckUpdateTask::checkFailed, this,
- [this](Mod* mod, QString reason, QUrl recover_url) { m_failed_check_update.append({mod, reason, recover_url}); });
+ connect(m_flame_check_task.get(), &CheckUpdateTask::checkFailed, this, [this](Mod* mod, QString reason, QUrl recover_url) {
+ m_failed_check_update.append({ mod, reason, recover_url });
+ });
check_task.addTask(m_flame_check_task);
}
@@ -162,7 +164,7 @@ void ModUpdateDialog::checkCandidates()
if (!recover_url.isEmpty())
//: %1 is the link to download it manually
text += tr("Possible solution: Getting the latest version manually:<br>%1<br>")
- .arg(QString("<a href='%1'>%1</a>").arg(recover_url.toString()));
+ .arg(QString("<a href='%1'>%1</a>").arg(recover_url.toString()));
text += "<br>";
}
@@ -342,7 +344,7 @@ void ModUpdateDialog::onMetadataFailed(Mod* mod, bool try_others, ModPlatform::R
} else {
QString reason{ tr("Couldn't find a valid version on the selected mod provider(s)") };
- m_failed_metadata.append({mod, reason});
+ m_failed_metadata.append({ mod, reason });
}
}
@@ -362,11 +364,11 @@ void ModUpdateDialog::appendMod(CheckUpdateTask::UpdatableMod const& info)
auto new_version_item = new QTreeWidgetItem(item_top);
new_version_item->setText(0, tr("New version: %1").arg(info.new_version));
- if (info.new_verison_type.has_value()) {
+ if (info.new_version_type.has_value()) {
auto new_version_type_itme = new QTreeWidgetItem(item_top);
- new_version_type_itme->setText(0, tr("New Version Type: %1").arg(info.new_verison_type.value().toString()));
+ new_version_type_itme->setText(0, tr("New Version Type: %1").arg(info.new_version_type.value().toString()));
}
-
+
auto changelog_item = new QTreeWidgetItem(item_top);
changelog_item->setText(0, tr("Changelog of the latest version"));
diff --git a/launcher/ui/pages/modplatform/ModPage.cpp b/launcher/ui/pages/modplatform/ModPage.cpp
index 9c9954a4..9b178048 100644
--- a/launcher/ui/pages/modplatform/ModPage.cpp
+++ b/launcher/ui/pages/modplatform/ModPage.cpp
@@ -133,7 +133,7 @@ void ModPage::updateVersionList()
// Only add the version if it's valid or using the 'Any' filter, but never if the version is opted out
if ((valid || m_filter->versions.empty()) && !optedOut(version)) {
- auto release_type = version.verison_type.isValid() ? QString(" : %1").arg(version.verison_type.toString()) : "";
+ auto release_type = version.version_type.isValid() ? QString(" [%1]").arg(version.version_type.toString()) : "";
m_ui->versionSelectionBox->addItem(QString("%1%2").arg(version.version, release_type), QVariant(i));
}
}
diff --git a/launcher/ui/pages/modplatform/ResourcePage.cpp b/launcher/ui/pages/modplatform/ResourcePage.cpp
index 5c8f23d2..3619c51a 100644
--- a/launcher/ui/pages/modplatform/ResourcePage.cpp
+++ b/launcher/ui/pages/modplatform/ResourcePage.cpp
@@ -268,8 +268,8 @@ void ResourcePage::updateVersionList()
if (optedOut(version))
continue;
- auto release_type = current_pack->versions[i].verison_type.isValid()
- ? QString(" : %1").arg(current_pack->versions[i].verison_type.toString())
+ auto release_type = current_pack->versions[i].version_type.isValid()
+ ? QString(" [%1]").arg(current_pack->versions[i].version_type.toString())
: "";
m_ui->versionSelectionBox->addItem(current_pack->versions[i].version, QVariant(i));
}
diff --git a/launcher/ui/pages/modplatform/flame/FlamePage.cpp b/launcher/ui/pages/modplatform/flame/FlamePage.cpp
index 57521151..aad37694 100644
--- a/launcher/ui/pages/modplatform/flame/FlamePage.cpp
+++ b/launcher/ui/pages/modplatform/flame/FlamePage.cpp
@@ -42,9 +42,9 @@
#include "FlameModel.h"
#include "InstanceImportTask.h"
#include "Json.h"
+#include "modplatform/flame/FlameAPI.h"
#include "ui/dialogs/NewInstanceDialog.h"
#include "ui/widgets/ProjectItem.h"
-#include "modplatform/flame/FlameAPI.h"
static FlameAPI api;
@@ -155,7 +155,7 @@ void FlamePage::onSelectionChanged(QModelIndex curr, QModelIndex prev)
}
for (auto version : current.versions) {
- auto release_type = version.version_type.isValid() ? QString(" : %1").arg(version.version_type.toString()) : "";
+ auto release_type = version.version_type.isValid() ? QString(" [%1]").arg(version.version_type.toString()) : "";
ui->versionSelectionBox->addItem(QString("%1%2").arg(version.version, release_type), QVariant(version.downloadUrl));
}
@@ -253,10 +253,8 @@ void FlamePage::updateUi()
text += "<br>" + tr(" by ") + authorStrs.join(", ");
}
- if(current.extraInfoLoaded) {
- if (!current.extra.issuesUrl.isEmpty()
- || !current.extra.sourceUrl.isEmpty()
- || !current.extra.wikiUrl.isEmpty()) {
+ if (current.extraInfoLoaded) {
+ if (!current.extra.issuesUrl.isEmpty() || !current.extra.sourceUrl.isEmpty() || !current.extra.wikiUrl.isEmpty()) {
text += "<br><br>" + tr("External links:") + "<br>";
}
@@ -268,7 +266,6 @@ void FlamePage::updateUi()
text += "- " + tr("Source code: <a href=%1>%1</a>").arg(current.extra.sourceUrl) + "<br>";
}
-
text += "<hr>";
text += api.getModDescription(current.addonId).toUtf8();
diff --git a/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp b/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp
index 9ca26ea9..c41f118a 100644
--- a/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp
+++ b/launcher/ui/pages/modplatform/modrinth/ModrinthPage.cpp
@@ -199,9 +199,10 @@ void ModrinthPage::onSelectionChanged(QModelIndex curr, QModelIndex prev)
qWarning() << "Error while reading modrinth modpack version: " << e.cause();
}
for (auto version : current.versions) {
- auto release_type = version.version_type.isValid() ? QString(" : %1").arg(version.version_type.toString()) : "";
+ auto release_type = version.version_type.isValid() ? QString(" [%1]").arg(version.version_type.toString()) : "";
if (!version.name.contains(version.version))
- ui->versionSelectionBox->addItem(QString("%1 — %2%3").arg(version.name, version.version, release_type), QVariant(version.id));
+ ui->versionSelectionBox->addItem(QString("%1 — %2%3").arg(version.name, version.version, release_type),
+ QVariant(version.id));
else
ui->versionSelectionBox->addItem(QString("%1%2").arg(version.name, release_type), QVariant(version.id));
}