summaryrefslogtreecommitdiff
path: root/src/backend/bookshelfmodel/categoryitem.cpp
diff options
context:
space:
mode:
authorRoberto C. Sanchez <roberto@connexer.com>2014-10-21 22:48:29 -0400
committerRoberto C. Sanchez <roberto@connexer.com>2014-10-21 22:48:29 -0400
commite8a196082586bb68e0bf254a8f6f4b8f39071f32 (patch)
treeb03dbbd1b5be6092ed5e9bcb3806aa2d4938bba3 /src/backend/bookshelfmodel/categoryitem.cpp
parentdd2f7ce46df53f2c377c02d1bf4df8adcf092072 (diff)
Imported Upstream version 2.3.3
Diffstat (limited to 'src/backend/bookshelfmodel/categoryitem.cpp')
-rw-r--r--src/backend/bookshelfmodel/categoryitem.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/backend/bookshelfmodel/categoryitem.cpp b/src/backend/bookshelfmodel/categoryitem.cpp
index 0d4b853..3ce6e88 100644
--- a/src/backend/bookshelfmodel/categoryitem.cpp
+++ b/src/backend/bookshelfmodel/categoryitem.cpp
@@ -15,9 +15,15 @@
namespace BookshelfModel {
CategoryItem::CategoryItem(CSwordModuleInfo *module)
- : Item(ITEM_CATEGORY), m_category(module->category())
-{
+ : Item(ITEM_CATEGORY), m_category(module->category()) {
// Intentionally empty
}
+bool CategoryItem::operator<(const Item &other) const {
+ if (other.type() != ITEM_CATEGORY) {
+ return ITEM_CATEGORY < other.type();
+ }
+ return m_category < static_cast<const CategoryItem &>(other).m_category;
+}
+
} // namespace BookshelfModel