diff options
author | Roberto C. Sanchez <roberto@connexer.com> | 2014-10-21 22:58:34 -0400 |
---|---|---|
committer | Roberto C. Sanchez <roberto@connexer.com> | 2014-10-21 22:58:34 -0400 |
commit | 1ea03c0fce8066c1e22188447b4a6ca4dcef1201 (patch) | |
tree | 1ad46980fdca402062502b20b7e16468b89393f8 /src/backend/bookshelfmodel/categoryitem.h | |
parent | 579657c8cb4ecd8a313221e70bdbbc7267f20286 (diff) |
Imported Upstream version 2.10.1
Diffstat (limited to 'src/backend/bookshelfmodel/categoryitem.h')
-rw-r--r-- | src/backend/bookshelfmodel/categoryitem.h | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/src/backend/bookshelfmodel/categoryitem.h b/src/backend/bookshelfmodel/categoryitem.h index 75d5a7c..135f337 100644 --- a/src/backend/bookshelfmodel/categoryitem.h +++ b/src/backend/bookshelfmodel/categoryitem.h @@ -4,7 +4,7 @@ * * This file is part of BibleTime's source code, http://www.bibletime.info/. * -* Copyright 1999-2011 by the BibleTime developers. +* Copyright 1999-2014 by the BibleTime developers. * The BibleTime source code is licensed under the GNU General Public License * version 2.0. * @@ -22,28 +22,29 @@ namespace BookshelfModel { -class CategoryItem: public Item { - Q_DECLARE_TR_FUNCTIONS(CategoryItem); +class CategoryItem: public GroupItem<Item::ITEM_CATEGORY> { - public: - static const Item::Type GROUP_TYPE = Item::ITEM_CATEGORY; +public: /* Methods: */ - CategoryItem(CSwordModuleInfo *module); + inline CategoryItem(const CSwordModuleInfo & module) + : m_category(module.category()) {} - inline const CSwordModuleInfo::Category &category() const { - return m_category; - } + inline const CSwordModuleInfo::Category & category() const { + return m_category; + } - QVariant data(int role = Qt::DisplayRole) const; + QVariant data(int role = Qt::DisplayRole) const; - inline bool fitFor(CSwordModuleInfo *module) const { - return module->category() == m_category; - } + inline bool fitFor(const CSwordModuleInfo & module) const { + return module.category() == m_category; + } - bool operator<(const Item &other) const; + bool operator<(const Item & other) const; + +private: /* Fields: */ + + const CSwordModuleInfo::Category m_category; - protected: - CSwordModuleInfo::Category m_category; }; } // namespace BookshelfModel |