Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/models/accountsproxymodel.cpp
Show All 30 Lines | |||||
31 | #include "modelenums.h" | 31 | #include "modelenums.h" | ||
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 | #if QT_VERSION < QT_VERSION_CHECK(5,10,0) | ||||
40 | #define QSortFilterProxyModel KRecursiveFilterProxyModel | ||||
41 | #endif | ||||
39 | AccountsProxyModel::AccountsProxyModel(QObject *parent) : | 42 | AccountsProxyModel::AccountsProxyModel(QObject *parent) : | ||
40 | KRecursiveFilterProxyModel(parent), | 43 | QSortFilterProxyModel(parent), | ||
41 | d_ptr(new AccountsProxyModelPrivate) | 44 | d_ptr(new AccountsProxyModelPrivate) | ||
tbaumgart: See above. | |||||
42 | { | 45 | { | ||
46 | setRecursiveFilteringEnabled(true); | ||||
43 | setDynamicSortFilter(true); | 47 | setDynamicSortFilter(true); | ||
44 | setSortLocaleAware(true); | 48 | 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); | 49 | setFilterCaseSensitivity(Qt::CaseInsensitive); | ||
46 | } | 50 | } | ||
47 | 51 | | |||
48 | AccountsProxyModel::AccountsProxyModel(AccountsProxyModelPrivate &dd, QObject *parent) : | 52 | AccountsProxyModel::AccountsProxyModel(AccountsProxyModelPrivate &dd, QObject *parent) : | ||
49 | KRecursiveFilterProxyModel(parent), d_ptr(&dd) | 53 | QSortFilterProxyModel(parent), d_ptr(&dd) | ||
50 | { | 54 | { | ||
55 | setRecursiveFilteringEnabled(true); | ||||
51 | } | 56 | } | ||
57 | #undef QSortFilterProxyModel | ||||
tbaumgart: same here | |||||
52 | 58 | | |||
53 | AccountsProxyModel::~AccountsProxyModel() | 59 | AccountsProxyModel::~AccountsProxyModel() | ||
54 | { | 60 | { | ||
55 | } | 61 | } | ||
56 | 62 | | |||
57 | /** | 63 | /** | ||
58 | * This function was re-implemented so we could have a special display order (favorites first) | 64 | * This function was re-implemented so we could have a special display order (favorites first) | ||
59 | */ | 65 | */ | ||
▲ Show 20 Lines • Show All 299 Lines • Show Last 20 Lines |
See above.