refactor: move general code from mod model to its own model
This aims to continue decoupling other types of resources (e.g. resource packs, shader packs, etc) from mods, so that we don't have to continuously watch our backs for changes to one of them affecting the others. To do so, this creates a more general list model for resources, based on the mods one, that allows you to extend it with functionality for other resources. I had to do some template and preprocessor stuff to get around the QObject limitation of not allowing templated classes, so that's sadge :c On the other hand, I tried cleaning up most general-purpose code in the mod model, and added some documentation, because it looks nice :D Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
@ -38,11 +38,11 @@
|
||||
|
||||
#include "minecraft/mod/MetadataHandler.h"
|
||||
|
||||
ModFolderLoadTask::ModFolderLoadTask(QDir& mods_dir, QDir& index_dir, bool is_indexed, bool clean_orphan)
|
||||
: m_mods_dir(mods_dir), m_index_dir(index_dir), m_is_indexed(is_indexed), m_clean_orphan(clean_orphan), m_result(new Result())
|
||||
ModFolderLoadTask::ModFolderLoadTask(QDir mods_dir, QDir index_dir, bool is_indexed, bool clean_orphan)
|
||||
: Task(nullptr, false), m_mods_dir(mods_dir), m_index_dir(index_dir), m_is_indexed(is_indexed), m_clean_orphan(clean_orphan), m_result(new Result())
|
||||
{}
|
||||
|
||||
void ModFolderLoadTask::run()
|
||||
void ModFolderLoadTask::executeTask()
|
||||
{
|
||||
if (m_is_indexed) {
|
||||
// Read metadata first
|
||||
@ -96,7 +96,7 @@ void ModFolderLoadTask::run()
|
||||
}
|
||||
}
|
||||
|
||||
emit succeeded();
|
||||
emitSucceeded();
|
||||
}
|
||||
|
||||
void ModFolderLoadTask::getFromMetadata()
|
||||
|
Reference in New Issue
Block a user