From a45737e852c207d02f1dd06227de7916baa290c1 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 1 May 2025 20:12:24 +0200 Subject: Make the genre filter work It works basically, but it could use a few improvements, like filtering out genres which we don't want to archive, and maybe make the size filter work in addition to it. --- archivebrowsermodel.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'archivebrowsermodel.h') diff --git a/archivebrowsermodel.h b/archivebrowsermodel.h index 7d0d263..212ecea 100644 --- a/archivebrowsermodel.h +++ b/archivebrowsermodel.h @@ -12,6 +12,8 @@ #include #include +class QAction; + #include "smtreemodel.h" class ArchiveBrowserModel : public SmTreeModel { @@ -27,6 +29,7 @@ class ArchiveBrowserModel : public SmTreeModel { int nextDVDNo() const; virtual Qt::ItemFlags flags(const QModelIndex &index) const; QList availableQualities() { return mAvailableQualities; } + QStringList availableGenres() { return mAvailableGenres; } QModelIndexList children(const QModelIndex &idx); public slots: @@ -40,6 +43,7 @@ class ArchiveBrowserModel : public SmTreeModel { void readConfig(); int mNumFields; QList mAvailableQualities; + QStringList mAvailableGenres; QSqlDatabase mDb; }; @@ -52,6 +56,7 @@ class ArchiveBrowserModelProxy : public QSortFilterProxyModel { void setQualityFilter(QString quality); void setSizeFilter(int activate); void setBytesRemaining(qint64 bytes); + void toggleGenre(QAction *a); protected: virtual bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const; @@ -60,6 +65,7 @@ class ArchiveBrowserModelProxy : public QSortFilterProxyModel { int mQuality; bool mSizeFilter; qint64 mBytesRemaining; + QStringList mGenreFilters; }; #endif // ARCHIVEBROWSERMODEL_H -- cgit v1.2.3-70-g09d2