Connected filters

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97
2023-10-21 18:28:33 +03:00
parent 4850434c67
commit 9e85297f7a
23 changed files with 214 additions and 152 deletions

View File

@ -11,6 +11,7 @@
#include "QObjectPtr.h"
#include "ResourceDownloadTask.h"
#include "modplatform/ModIndex.h"
#include "modplatform/ResourceAPI.h"
#include "tasks/ConcurrentTask.h"
@ -55,6 +56,16 @@ class ResourceModel : public QAbstractListModel {
[[nodiscard]] auto getSortingMethods() const { return m_api->getSortingMethods(); }
/** Whether the version is opted out or not. Currently only makes sense in CF. */
virtual bool optedOut(const ModPlatform::IndexedVersion& ver) const
{
Q_UNUSED(ver);
return false;
};
virtual bool checkFilters(ModPlatform::IndexedPack::Ptr) { return true; }
virtual bool checkVersionFilters(const ModPlatform::IndexedVersion&);
public slots:
void fetchMore(const QModelIndex& parent) override;
// NOTE: Can't use [[nodiscard]] here because of https://bugreports.qt.io/browse/QTBUG-58628 on Qt 5.12