refactor: move more tied logic to model and move logic to the resources

This moves the QSortFilterProxyModel to the resource model files,
acessible via a factory method, and moves the sorting and filtering to
the objects themselves, decoupling the code a bit.

This also adds a basic implementation of methods in the
ResourceFolderModel, simplifying the process of constructing a new model
from it.

Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
flow
2022-08-10 14:42:24 -03:00
parent af2cf2734d
commit 1e2f0ab308
8 changed files with 265 additions and 16 deletions

View File

@ -91,15 +91,13 @@ public:
/// Deletes all the selected mods
bool deleteMods(const QModelIndexList &indexes);
void disableInteraction(bool disabled) { ResourceFolderModel::enableInteraction(!disabled); }
/// Enable or disable listed mods
bool setModStatus(const QModelIndexList &indexes, ModStatusAction action);
bool isValid();
void startWatching();
void stopWatching();
bool startWatching() override;
bool stopWatching() override;
QDir indexDir() { return { QString("%1/.index").arg(dir().absolutePath()) }; }