diff options
Diffstat (limited to 'src/backend/bookshelfmodel/categoryitem.cpp')
-rw-r--r-- | src/backend/bookshelfmodel/categoryitem.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/backend/bookshelfmodel/categoryitem.cpp b/src/backend/bookshelfmodel/categoryitem.cpp index 3ce6e88..1788dfc 100644 --- a/src/backend/bookshelfmodel/categoryitem.cpp +++ b/src/backend/bookshelfmodel/categoryitem.cpp @@ -10,7 +10,8 @@ * **********/ -#include "categoryitem.h" +#include "backend/bookshelfmodel/categoryitem.h" + namespace BookshelfModel { @@ -23,7 +24,10 @@ 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; + const CategoryItem &o(static_cast<const CategoryItem &>(other)); + if (m_category == CSwordModuleInfo::UnknownCategory) return false; + if (o.m_category == CSwordModuleInfo::UnknownCategory) return true; + return m_category < o.m_category; } } // namespace BookshelfModel |