diff options
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. */ |