mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-06-13 13:47:46 +02:00
De-OOP ProviderCapabilities
There was no reason for it to be a class, and imo it created quite a code-smell needing to initialise it everywhere. Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
@ -15,8 +15,6 @@
|
||||
#include "modplatform/modrinth/ModrinthAPI.h"
|
||||
#include "modplatform/modrinth/ModrinthPackIndex.h"
|
||||
|
||||
static ModPlatform::ProviderCapabilities ProviderCaps;
|
||||
|
||||
static ModrinthAPI modrinth_api;
|
||||
static FlameAPI flame_api;
|
||||
|
||||
@ -162,10 +160,10 @@ void EnsureMetadataTask::executeTask()
|
||||
});
|
||||
|
||||
if (m_resources.size() > 1)
|
||||
setStatus(tr("Requesting metadata information from %1...").arg(ProviderCaps.readableName(m_provider)));
|
||||
setStatus(tr("Requesting metadata information from %1...").arg(ModPlatform::ProviderCapabilities::readableName(m_provider)));
|
||||
else if (!m_resources.empty())
|
||||
setStatus(tr("Requesting metadata information from %1 for '%2'...")
|
||||
.arg(ProviderCaps.readableName(m_provider), m_resources.begin().value()->name()));
|
||||
.arg(ModPlatform::ProviderCapabilities::readableName(m_provider), m_resources.begin().value()->name()));
|
||||
|
||||
m_current_task = version_task;
|
||||
version_task->start();
|
||||
@ -215,7 +213,7 @@ void EnsureMetadataTask::emitFail(Resource* resource, QString key, RemoveFromLis
|
||||
|
||||
Task::Ptr EnsureMetadataTask::modrinthVersionsTask()
|
||||
{
|
||||
auto hash_type = ProviderCaps.hashType(ModPlatform::ResourceProvider::MODRINTH).first();
|
||||
auto hash_type = ModPlatform::ProviderCapabilities::hashType(ModPlatform::ResourceProvider::MODRINTH).first();
|
||||
|
||||
auto response = std::make_shared<QByteArray>();
|
||||
auto ver_task = modrinth_api.currentVersions(m_resources.keys(), hash_type, response);
|
||||
|
Reference in New Issue
Block a user