diff options
author | Arno <arno@disconnect.de> | 2025-05-03 01:08:13 +0200 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2025-05-03 01:08:13 +0200 |
commit | f18b4201d891aea10a4b38bd923f4c8fc4ee7209 (patch) | |
tree | b36b9364cfdef72bb3152d5c6fdeb1b8b8b270ab /delegates.cpp | |
parent | 88a80f8fb94ad10a9162ff340e392e79a7103fa3 (diff) | |
download | SheMov-f18b4201d891aea10a4b38bd923f4c8fc4ee7209.tar.gz SheMov-f18b4201d891aea10a4b38bd923f4c8fc4ee7209.tar.bz2 SheMov-f18b4201d891aea10a4b38bd923f4c8fc4ee7209.zip |
Beautify genre display in ArchiveBrowser
Display explicitly included genres with a check mark, and others with a
cross mark.
Diffstat (limited to 'delegates.cpp')
-rw-r--r-- | delegates.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/delegates.cpp b/delegates.cpp index 4be7f4d..f542014 100644 --- a/delegates.cpp +++ b/delegates.cpp @@ -12,6 +12,7 @@ #include "delegates.h" #include "smglobals.h" #include "helper.h" +#include "archivebrowsermodel.h" /* Delegate for File no. */ @@ -58,8 +59,17 @@ QWidget *FileTypeDelegate::createEditor(QWidget *parent, const QStyleOptionViewI /* Delegate for Genres */ QString GenreDelegate::displayText(const QVariant &value, const QLocale &) const { + const QStringList &filtered = mProxy->genreFilters(); QStringList genres = value.toStringList(); - return genres.join(' '); + QStringList retval; + for(const QString &g : std::as_const(genres)){ + if(filtered.contains(g)){ + retval << QString("%1 %2").arg(QChar(0x2705)).arg(g); + }else{ + retval << QString("%1 %2").arg(QChar(0x274c)).arg(g); + } + } + return retval.join(' '); } /* Delegate for Dvd no. */ |