diff options
Diffstat (limited to 'src/backend/bookshelfmodel/categoryitem.cpp')
-rw-r--r-- | src/backend/bookshelfmodel/categoryitem.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/backend/bookshelfmodel/categoryitem.cpp b/src/backend/bookshelfmodel/categoryitem.cpp index 1788dfc..46905d7 100644 --- a/src/backend/bookshelfmodel/categoryitem.cpp +++ b/src/backend/bookshelfmodel/categoryitem.cpp @@ -20,6 +20,17 @@ CategoryItem::CategoryItem(CSwordModuleInfo *module) // Intentionally empty } +QVariant CategoryItem::data(int role) const { + switch (role) { + case Qt::DisplayRole: + return BtBookshelfModel::categoryName(m_category); + case Qt::DecorationRole: + return BtBookshelfModel::categoryIcon(m_category); + default: + return Item::data(role); + } +} + bool CategoryItem::operator<(const Item &other) const { if (other.type() != ITEM_CATEGORY) { return ITEM_CATEGORY < other.type(); |