summaryrefslogtreecommitdiffstats
path: root/api/logic/minecraft/curse
diff options
context:
space:
mode:
Diffstat (limited to 'api/logic/minecraft/curse')
-rw-r--r--api/logic/minecraft/curse/FileResolvingTask.cpp10
-rw-r--r--api/logic/minecraft/curse/FileResolvingTask.h6
-rw-r--r--api/logic/minecraft/curse/PackManifest.cpp2
3 files changed, 10 insertions, 8 deletions
diff --git a/api/logic/minecraft/curse/FileResolvingTask.cpp b/api/logic/minecraft/curse/FileResolvingTask.cpp
index 13308202..aaac404b 100644
--- a/api/logic/minecraft/curse/FileResolvingTask.cpp
+++ b/api/logic/minecraft/curse/FileResolvingTask.cpp
@@ -3,17 +3,19 @@
const char * metabase = "https://cursemeta.dries007.net";
-Curse::FileResolvingTask::FileResolvingTask(QVector<Curse::File>& toProcess)
+Curse::FileResolvingTask::FileResolvingTask(Curse::Manifest& toProcess)
: m_toProcess(toProcess)
{
}
void Curse::FileResolvingTask::executeTask()
{
+ setStatus(tr("Resolving curse mod IDs..."));
+ setProgress(0, m_toProcess.files.size());
m_dljob.reset(new NetJob("Curse file resolver"));
- results.resize(m_toProcess.size());
+ results.resize(m_toProcess.files.size());
int index = 0;
- for(auto & file: m_toProcess)
+ for(auto & file: m_toProcess.files)
{
auto projectIdStr = QString::number(file.projectId);
auto fileIdStr = QString::number(file.fileId);
@@ -42,7 +44,7 @@ void Curse::FileResolvingTask::netJobFinished()
failed = true;
continue;
}
- auto & out = m_toProcess[index];
+ auto & out = m_toProcess.files[index];
out.fileName = Json::requireString(obj, "FileNameOnDisk");
out.url = Json::requireString(obj, "DownloadURL");
out.resolved = true;
diff --git a/api/logic/minecraft/curse/FileResolvingTask.h b/api/logic/minecraft/curse/FileResolvingTask.h
index b7ca85d3..a9357bfb 100644
--- a/api/logic/minecraft/curse/FileResolvingTask.h
+++ b/api/logic/minecraft/curse/FileResolvingTask.h
@@ -12,8 +12,8 @@ class MULTIMC_LOGIC_EXPORT FileResolvingTask : public Task
{
Q_OBJECT
public:
- explicit FileResolvingTask(QVector<Curse::File> &toProcess);
- const QVector<Curse::File> &getResults() const
+ explicit FileResolvingTask(Curse::Manifest &toProcess);
+ const Curse::Manifest &getResults() const
{
return m_toProcess;
}
@@ -25,7 +25,7 @@ protected slots:
void netJobFinished();
private: /* data */
- QVector<Curse::File> m_toProcess;
+ Curse::Manifest m_toProcess;
QVector<QByteArray> results;
NetJobPtr m_dljob;
};
diff --git a/api/logic/minecraft/curse/PackManifest.cpp b/api/logic/minecraft/curse/PackManifest.cpp
index a4ea703b..fd40a37c 100644
--- a/api/logic/minecraft/curse/PackManifest.cpp
+++ b/api/logic/minecraft/curse/PackManifest.cpp
@@ -11,7 +11,7 @@ static void loadFileV1(Curse::File & f, QJsonObject & file)
static void loadModloaderV1(Curse::Modloader & m, QJsonObject & modLoader)
{
m.id = Json::requireString(modLoader, "id");
- m.primary = Json::ensureBoolean(modLoader, "primary", false);
+ m.primary = Json::ensureBoolean(modLoader, QString("primary"), false);
}
static void loadMinecraftV1(Curse::Minecraft & m, QJsonObject & minecraft)