Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/models/accountsproxymodel.cpp
Show All 31 Lines | |||||
32 | #include "mymoneyenums.h" | 32 | #include "mymoneyenums.h" | ||
33 | #include "mymoneyinstitution.h" | 33 | #include "mymoneyinstitution.h" | ||
34 | #include "mymoneyaccount.h" | 34 | #include "mymoneyaccount.h" | ||
35 | #include "mymoneymoney.h" | 35 | #include "mymoneymoney.h" | ||
36 | 36 | | |||
37 | using namespace eAccountsModel; | 37 | using namespace eAccountsModel; | ||
38 | 38 | | |||
39 | AccountsProxyModel::AccountsProxyModel(QObject *parent) : | 39 | AccountsProxyModel::AccountsProxyModel(QObject *parent) : | ||
40 | KRecursiveFilterProxyModel(parent), | 40 | QSortFilterProxyModel(parent), | ||
41 | d_ptr(new AccountsProxyModelPrivate) | 41 | d_ptr(new AccountsProxyModelPrivate) | ||
tbaumgart: See above. | |||||
42 | { | 42 | { | ||
43 | setRecursiveFilteringEnabled(true); | ||||
43 | setDynamicSortFilter(true); | 44 | setDynamicSortFilter(true); | ||
44 | setSortLocaleAware(true); | 45 | setSortLocaleAware(true); | ||
I would add the following to the header file: #if QT_VERSION < QT_VERSION_CHECK(5,10,0) // provide the interface for backward compatbility void setRecursiveFilteringEnabled(bool) {} #endif and remove the enclosing #if/#endif in the code so it is prepared for the future. tbaumgart: I would add the following to the header file:
```
#if QT_VERSION < QT_VERSION_CHECK(5,10,0)… | |||||
45 | setFilterCaseSensitivity(Qt::CaseInsensitive); | 46 | setFilterCaseSensitivity(Qt::CaseInsensitive); | ||
46 | } | 47 | } | ||
47 | 48 | | |||
48 | AccountsProxyModel::AccountsProxyModel(AccountsProxyModelPrivate &dd, QObject *parent) : | 49 | AccountsProxyModel::AccountsProxyModel(AccountsProxyModelPrivate &dd, QObject *parent) : | ||
49 | KRecursiveFilterProxyModel(parent), d_ptr(&dd) | 50 | QSortFilterProxyModel(parent), d_ptr(&dd) | ||
50 | { | 51 | { | ||
52 | setRecursiveFilteringEnabled(true); | ||||
51 | } | 53 | } | ||
52 | 54 | | |||
tbaumgart: same here | |||||
53 | AccountsProxyModel::~AccountsProxyModel() | 55 | AccountsProxyModel::~AccountsProxyModel() | ||
54 | { | 56 | { | ||
55 | } | 57 | } | ||
56 | 58 | | |||
57 | /** | 59 | /** | ||
58 | * This function was re-implemented so we could have a special display order (favorites first) | 60 | * This function was re-implemented so we could have a special display order (favorites first) | ||
59 | */ | 61 | */ | ||
60 | bool AccountsProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const | 62 | bool AccountsProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const | ||
▲ Show 20 Lines • Show All 298 Lines • Show Last 20 Lines |
See above.