2019-08-04 02:27:53 +01:00
|
|
|
#pragma once
|
2022-04-16 00:35:17 +01:00
|
|
|
|
2019-08-04 02:27:53 +01:00
|
|
|
#include <QDir>
|
|
|
|
#include <QMap>
|
2022-04-16 00:35:17 +01:00
|
|
|
#include <QObject>
|
|
|
|
#include <QRunnable>
|
2019-08-04 02:27:53 +01:00
|
|
|
#include <memory>
|
2022-04-16 00:35:17 +01:00
|
|
|
#include "minecraft/mod/Mod.h"
|
2019-08-04 02:27:53 +01:00
|
|
|
|
|
|
|
class ModFolderLoadTask : public QObject, public QRunnable
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
struct Result {
|
|
|
|
QMap<QString, Mod> mods;
|
|
|
|
};
|
|
|
|
using ResultPtr = std::shared_ptr<Result>;
|
|
|
|
ResultPtr result() const {
|
|
|
|
return m_result;
|
|
|
|
}
|
|
|
|
|
|
|
|
public:
|
2022-04-15 04:24:57 +01:00
|
|
|
ModFolderLoadTask(QDir& mods_dir, QDir& index_dir);
|
2019-08-04 02:27:53 +01:00
|
|
|
void run();
|
|
|
|
signals:
|
|
|
|
void succeeded();
|
|
|
|
private:
|
2022-04-15 04:24:57 +01:00
|
|
|
QDir& m_mods_dir, m_index_dir;
|
2019-08-04 02:27:53 +01:00
|
|
|
ResultPtr m_result;
|
|
|
|
};
|