diff --git a/launcher/modplatform/CheckUpdateTask.h b/launcher/modplatform/CheckUpdateTask.h index b9bed7ee1..d3f577f44 100644 --- a/launcher/modplatform/CheckUpdateTask.h +++ b/launcher/modplatform/CheckUpdateTask.h @@ -12,7 +12,7 @@ class CheckUpdateTask : public Task { public: CheckUpdateTask(QList& resources, - std::list& mcVersions, + std::vector& mcVersions, QList loadersList, ResourceFolderModel* resourceModel) : Task(), m_resources(resources), m_gameVersions(mcVersions), m_loadersList(std::move(loadersList)), m_resourceModel(resourceModel) @@ -65,7 +65,7 @@ class CheckUpdateTask : public Task { protected: QList& m_resources; - std::list& m_gameVersions; + std::vector& m_gameVersions; QList m_loadersList; ResourceFolderModel* m_resourceModel; diff --git a/launcher/modplatform/ResourceAPI.cpp b/launcher/modplatform/ResourceAPI.cpp index cdc1d8090..5411b1804 100644 --- a/launcher/modplatform/ResourceAPI.cpp +++ b/launcher/modplatform/ResourceAPI.cpp @@ -262,7 +262,7 @@ Task::Ptr ResourceAPI::getDependencyVersion(DependencySearchArgs&& args, Callbac return netJob; } -QString ResourceAPI::getGameVersionsString(std::list mcVersions) const +QString ResourceAPI::getGameVersionsString(std::vector mcVersions) const { QString s; for (auto& ver : mcVersions) { diff --git a/launcher/modplatform/ResourceAPI.h b/launcher/modplatform/ResourceAPI.h index 84bbe8bf0..90b854530 100644 --- a/launcher/modplatform/ResourceAPI.h +++ b/launcher/modplatform/ResourceAPI.h @@ -81,7 +81,7 @@ class ResourceAPI { std::optional search; std::optional sorting; std::optional loaders; - std::optional> versions; + std::optional> versions; std::optional side; std::optional categoryIds; bool openSource; @@ -90,7 +90,7 @@ class ResourceAPI { struct VersionSearchArgs { ModPlatform::IndexedPack::Ptr pack; - std::optional> mcVersions; + std::optional> mcVersions; std::optional loaders; ModPlatform::ResourceType resourceType; }; @@ -124,7 +124,7 @@ class ResourceAPI { QString mapMCVersionToModrinth(Version v) const; - QString getGameVersionsString(std::list mcVersions) const; + QString getGameVersionsString(std::vector mcVersions) const; public: virtual auto getSearchURL(SearchArgs const& args) const -> std::optional = 0; diff --git a/launcher/modplatform/flame/FlameCheckUpdate.h b/launcher/modplatform/flame/FlameCheckUpdate.h index d4b97a2b7..c2b3c9c35 100644 --- a/launcher/modplatform/flame/FlameCheckUpdate.h +++ b/launcher/modplatform/flame/FlameCheckUpdate.h @@ -7,7 +7,7 @@ class FlameCheckUpdate : public CheckUpdateTask { public: FlameCheckUpdate(QList& resources, - std::list& mcVersions, + std::vector& mcVersions, QList loadersList, ResourceFolderModel* resourceModel) : CheckUpdateTask(resources, mcVersions, std::move(loadersList), resourceModel) diff --git a/launcher/modplatform/modrinth/ModrinthAPI.cpp b/launcher/modplatform/modrinth/ModrinthAPI.cpp index ecbba4c75..75902d4a4 100644 --- a/launcher/modplatform/modrinth/ModrinthAPI.cpp +++ b/launcher/modplatform/modrinth/ModrinthAPI.cpp @@ -40,7 +40,7 @@ Task::Ptr ModrinthAPI::currentVersions(const QStringList& hashes, QString hash_f Task::Ptr ModrinthAPI::latestVersion(QString hash, QString hash_format, - std::optional> mcVersions, + std::optional> mcVersions, std::optional loaders, QByteArray* response) { @@ -70,7 +70,7 @@ Task::Ptr ModrinthAPI::latestVersion(QString hash, Task::Ptr ModrinthAPI::latestVersions(const QStringList& hashes, QString hash_format, - std::optional> mcVersions, + std::optional> mcVersions, std::optional loaders, QByteArray* response) { diff --git a/launcher/modplatform/modrinth/ModrinthAPI.h b/launcher/modplatform/modrinth/ModrinthAPI.h index acfe396b7..d1ed845cf 100644 --- a/launcher/modplatform/modrinth/ModrinthAPI.h +++ b/launcher/modplatform/modrinth/ModrinthAPI.h @@ -20,13 +20,13 @@ class ModrinthAPI : public ResourceAPI { Task::Ptr latestVersion(QString hash, QString hash_format, - std::optional> mcVersions, + std::optional> mcVersions, std::optional loaders, QByteArray* response); Task::Ptr latestVersions(const QStringList& hashes, QString hash_format, - std::optional> mcVersions, + std::optional> mcVersions, std::optional loaders, QByteArray* response); @@ -192,7 +192,7 @@ class ModrinthAPI : public ResourceAPI { .arg(BuildConfig.MODRINTH_PROD_URL, args.pack->addonId.toString(), get_arguments.isEmpty() ? "" : "?", get_arguments.join('&')); }; - QString getGameVersionsArray(std::list mcVersions) const + QString getGameVersionsArray(std::vector mcVersions) const { QString s; for (auto& ver : mcVersions) { diff --git a/launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp b/launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp index b24da6fc9..9d1383ff0 100644 --- a/launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp +++ b/launcher/modplatform/modrinth/ModrinthCheckUpdate.cpp @@ -16,7 +16,7 @@ static ModrinthAPI api; ModrinthCheckUpdate::ModrinthCheckUpdate(QList& resources, - std::list& mcVersions, + std::vector& mcVersions, QList loadersList, ResourceFolderModel* resourceModel) : CheckUpdateTask(resources, mcVersions, std::move(loadersList), resourceModel) diff --git a/launcher/modplatform/modrinth/ModrinthCheckUpdate.h b/launcher/modplatform/modrinth/ModrinthCheckUpdate.h index e44c782d1..857e40daf 100644 --- a/launcher/modplatform/modrinth/ModrinthCheckUpdate.h +++ b/launcher/modplatform/modrinth/ModrinthCheckUpdate.h @@ -7,7 +7,7 @@ class ModrinthCheckUpdate : public CheckUpdateTask { public: ModrinthCheckUpdate(QList& resources, - std::list& mcVersions, + std::vector& mcVersions, QList loadersList, ResourceFolderModel* resourceModel); diff --git a/launcher/ui/dialogs/ResourceUpdateDialog.cpp b/launcher/ui/dialogs/ResourceUpdateDialog.cpp index 3587b8c40..4b8ef3a0a 100644 --- a/launcher/ui/dialogs/ResourceUpdateDialog.cpp +++ b/launcher/ui/dialogs/ResourceUpdateDialog.cpp @@ -29,7 +29,7 @@ #include -static std::list mcVersions(BaseInstance* inst) +static std::vector mcVersions(BaseInstance* inst) { return { static_cast(inst)->getPackProfile()->getComponent("net.minecraft")->getVersion() }; } diff --git a/launcher/ui/pages/modplatform/ModModel.cpp b/launcher/ui/pages/modplatform/ModModel.cpp index ef38a595d..c0768b9c3 100644 --- a/launcher/ui/pages/modplatform/ModModel.cpp +++ b/launcher/ui/pages/modplatform/ModModel.cpp @@ -27,7 +27,7 @@ ResourceAPI::SearchArgs ModModel::createSearchArguments() Q_ASSERT(profile); Q_ASSERT(m_filter); - std::optional> versions{}; + std::optional> versions{}; std::optional categories{}; auto loaders = profile->getSupportedModLoaders(); @@ -55,7 +55,7 @@ ResourceAPI::VersionSearchArgs ModModel::createVersionsArguments(const QModelInd Q_ASSERT(profile); Q_ASSERT(m_filter); - std::optional> versions{}; + std::optional> versions{}; auto loaders = profile->getSupportedModLoaders(); if (!m_filter->versions.empty()) versions = m_filter->versions; diff --git a/launcher/ui/pages/modplatform/TexturePackModel.cpp b/launcher/ui/pages/modplatform/TexturePackModel.cpp index 7c1490671..9e9fdaa8a 100644 --- a/launcher/ui/pages/modplatform/TexturePackModel.cpp +++ b/launcher/ui/pages/modplatform/TexturePackModel.cpp @@ -9,7 +9,7 @@ #include "meta/Index.h" #include "meta/Version.h" -static std::list s_availableVersions = {}; +static std::vector s_availableVersions = {}; namespace ResourceDownload { TexturePackResourceModel::TexturePackResourceModel(BaseInstance const& inst, ResourceAPI* api, QString debugName, QString metaEntryBase) diff --git a/launcher/ui/pages/modplatform/modrinth/ModrinthModel.h b/launcher/ui/pages/modplatform/modrinth/ModrinthModel.h index 114c07ca6..96f6fd128 100644 --- a/launcher/ui/pages/modplatform/modrinth/ModrinthModel.h +++ b/launcher/ui/pages/modplatform/modrinth/ModrinthModel.h @@ -98,7 +98,7 @@ class ModpackListModel : public QAbstractListModel { protected: void requestLogo(QString file, QString url); - inline auto getMineVersions() const -> std::list; + inline auto getMineVersions() const -> std::vector; protected: ModrinthPage* m_parent; diff --git a/launcher/ui/widgets/ModFilterWidget.cpp b/launcher/ui/widgets/ModFilterWidget.cpp index 60b298901..4afab6b6e 100644 --- a/launcher/ui/widgets/ModFilterWidget.cpp +++ b/launcher/ui/widgets/ModFilterWidget.cpp @@ -243,7 +243,7 @@ void ModFilterWidget::prepareBasicFilter() ui->liteLoader->setChecked(loaders & ModPlatform::LiteLoader); m_filter->loaders = loaders; auto def = m_instance->getPackProfile()->getComponentVersion("net.minecraft"); - m_filter->versions.emplace_front(def); + m_filter->versions.emplace_back(def); ui->versions->setCheckedItems({ def }); ui->version->setCurrentIndex(ui->version->findText(def)); } else { @@ -263,7 +263,7 @@ void ModFilterWidget::onVersionFilterChanged(int) { auto versions = ui->versions->checkedItems(); versions.sort(); - std::list current_list; + std::vector current_list; for (const QString& version : versions) current_list.emplace_back(version); @@ -385,7 +385,7 @@ void ModFilterWidget::onOpenSourceFilterChanged() void ModFilterWidget::onReleaseFilterChanged() { - std::list releases; + std::vector releases; if (ui->releaseCb->isChecked()) releases.push_back(ModPlatform::IndexedVersionType::Release); if (ui->betaCb->isChecked()) diff --git a/launcher/ui/widgets/ModFilterWidget.h b/launcher/ui/widgets/ModFilterWidget.h index f00b98eb0..85deb51dc 100644 --- a/launcher/ui/widgets/ModFilterWidget.h +++ b/launcher/ui/widgets/ModFilterWidget.h @@ -58,8 +58,8 @@ class ModFilterWidget : public QTabWidget { Q_OBJECT public: struct Filter { - std::list versions; - std::list releases; + std::vector versions; + std::vector releases; ModPlatform::ModLoaderTypes loaders; ModPlatform::Side side; bool hideInstalled;