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

« back to all changes in this revision

Viewing changes to src/backend/bookshelfmodel/btcheckstatefilterproxymodel.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:
13
13
#include "backend/bookshelfmodel/btcheckstatefilterproxymodel.h"
14
14
 
15
15
BtCheckStateFilterProxyModel::BtCheckStateFilterProxyModel(QObject *parent)
16
 
    : QSortFilterProxyModel(parent), m_enabled(true), m_showChecked(true),
17
 
      m_showUnchecked(false), m_showPartiallyChecked(true)
18
 
{
 
16
        : QSortFilterProxyModel(parent), m_enabled(true), m_showChecked(true),
 
17
        m_showUnchecked(false), m_showPartiallyChecked(true) {
19
18
    setFilterRole(Qt::CheckStateRole);
20
19
}
21
20
 
48
47
}
49
48
 
50
49
bool BtCheckStateFilterProxyModel::filterAcceptsRow(int row,
51
 
        const QModelIndex &parent) const
52
 
{
 
50
        const QModelIndex &parent) const {
53
51
    typedef Qt::CheckState CS;
54
52
 
55
53
    if (!m_enabled) return true;
62
60
             state == Qt::PartiallyChecked);
63
61
    if (state == Qt::Unchecked) {
64
62
        return m_showUnchecked;
65
 
    } else if (state == Qt::Checked) {
 
63
    }
 
64
    else if (state == Qt::Checked) {
66
65
        return m_showChecked;
67
 
    } else {
 
66
    }
 
67
    else {
68
68
        return m_showPartiallyChecked;
69
69
    }
70
70
}