fcfb2cfc3d
For now this doesn't mean much, but it will help when we need data exclusive from the metadata, such as addon id and mod provider. Also removes the metadata when the mod is deleted, and make the Mod.h file a little more pleasing to look at :)
30 lines
555 B
C++
30 lines
555 B
C++
#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:
|
|
ModFolderLoadTask(QDir& mods_dir, QDir& index_dir);
|
|
void run();
|
|
signals:
|
|
void succeeded();
|
|
private:
|
|
QDir& m_mods_dir, m_index_dir;
|
|
ResultPtr m_result;
|
|
};
|