2019-08-04 06:57:53 +05:30
|
|
|
#pragma once
|
|
|
|
#include <QRunnable>
|
|
|
|
#include <QObject>
|
|
|
|
#include <QDir>
|
|
|
|
#include <QMap>
|
|
|
|
#include "Mod.h"
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
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 08:54:57 +05:30
|
|
|
ModFolderLoadTask(QDir& mods_dir, QDir& index_dir);
|
2019-08-04 06:57:53 +05:30
|
|
|
void run();
|
|
|
|
signals:
|
|
|
|
void succeeded();
|
|
|
|
private:
|
2022-04-15 08:54:57 +05:30
|
|
|
QDir& m_mods_dir, m_index_dir;
|
2019-08-04 06:57:53 +05:30
|
|
|
ResultPtr m_result;
|
|
|
|
};
|