~ubuntu-branches/ubuntu/trusty/bibletime/trusty

« back to all changes in this revision

Viewing changes to src/backend/bookshelfmodel/categoryitem.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Marsden
  • Date: 2009-11-18 17:30:00 UTC
  • mfrom: (1.3.4 upstream) (5.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20091118173000-endkhjz5qai88tvr
Tags: 2.4-1
* New upstream version 2.4
* debian/control: 
  - Replace incorrect bibletime-data Depends on lib4qt-gui
    with bibletime Depends on libqtgui4 (>= 4.4.0). (Closes: #556209).
  - Add Build-depends: on zlib1g-dev and libcurl4-gnutls-dev 
    (Closes: #556805).

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
*
11
11
**********/
12
12
 
13
 
#include "categoryitem.h"
 
13
#include "backend/bookshelfmodel/categoryitem.h"
 
14
 
14
15
 
15
16
namespace BookshelfModel {
16
17
 
17
18
CategoryItem::CategoryItem(CSwordModuleInfo *module)
18
 
    : Item(ITEM_CATEGORY), m_category(module->category())
19
 
{
 
19
        : Item(ITEM_CATEGORY), m_category(module->category()) {
20
20
    // Intentionally empty
21
21
}
22
22
 
 
23
bool CategoryItem::operator<(const Item &other) const {
 
24
    if (other.type() != ITEM_CATEGORY) {
 
25
        return ITEM_CATEGORY < other.type();
 
26
    }
 
27
    const CategoryItem &o(static_cast<const CategoryItem &>(other));
 
28
    if (m_category   == CSwordModuleInfo::UnknownCategory) return false;
 
29
    if (o.m_category == CSwordModuleInfo::UnknownCategory) return true;
 
30
    return m_category < o.m_category;
 
31
}
 
32
 
23
33
} // namespace BookshelfModel