Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/models/models.cpp
Context not available. | |||||
31 | // Project Includes | 31 | // Project Includes | ||
---|---|---|---|---|---|
32 | 32 | | |||
33 | #include "accountsmodel.h" | 33 | #include "accountsmodel.h" | ||
34 | #include "onlinejobmodel.h" | | |||
35 | #include "ledgermodel.h" | 34 | #include "ledgermodel.h" | ||
36 | #include "costcentermodel.h" | 35 | #include "costcentermodel.h" | ||
37 | #include "payeesmodel.h" | 36 | #include "payeesmodel.h" | ||
Context not available. | |||||
48 | Private() | 47 | Private() | ||
49 | : m_accountsModel(0) | 48 | : m_accountsModel(0) | ||
50 | , m_institutionsModel(0) | 49 | , m_institutionsModel(0) | ||
51 | , m_onlineJobModel(0) | | |||
52 | , m_ledgerModel(0) | 50 | , m_ledgerModel(0) | ||
53 | , m_costCenterModel(0) | 51 | , m_costCenterModel(0) | ||
54 | , m_payeesModel(0) | 52 | , m_payeesModel(0) | ||
Context not available. | |||||
58 | 56 | | |||
59 | AccountsModel *m_accountsModel; | 57 | AccountsModel *m_accountsModel; | ||
60 | InstitutionsModel *m_institutionsModel; | 58 | InstitutionsModel *m_institutionsModel; | ||
61 | onlineJobModel *m_onlineJobModel; | | |||
62 | LedgerModel *m_ledgerModel; | 59 | LedgerModel *m_ledgerModel; | ||
63 | CostCenterModel *m_costCenterModel; | 60 | CostCenterModel *m_costCenterModel; | ||
64 | PayeesModel *m_payeesModel; | 61 | PayeesModel *m_payeesModel; | ||
Context not available. | |||||
117 | return d->m_institutionsModel; | 114 | return d->m_institutionsModel; | ||
118 | } | 115 | } | ||
119 | 116 | | |||
120 | onlineJobModel* Models::onlineJobsModel() | | |||
121 | { | | |||
122 | if (!d->m_onlineJobModel) { | | |||
123 | d->m_onlineJobModel = new onlineJobModel(this); | | |||
124 | #ifdef KMM_MODELTEST | | |||
125 | /// @todo using the ModelTest feature on the onlineJobModel crashes. Need to fix. | | |||
126 | // new ModelTest(d->m_onlineJobModel, Models::instance()); | | |||
127 | #endif | | |||
128 | } | | |||
129 | return d->m_onlineJobModel; | | |||
130 | } | | |||
131 | | ||||
132 | #ifdef ENABLE_UNFINISHEDFEATURES | 117 | #ifdef ENABLE_UNFINISHEDFEATURES | ||
133 | /** | 118 | /** | ||
134 | * This is the function to get a reference to the core @ref LedgerModel. | 119 | * This is the function to get a reference to the core @ref LedgerModel. | ||
Context not available. | |||||
230 | { | 215 | { | ||
231 | accountsModel()->AccountsModel::load(); | 216 | accountsModel()->AccountsModel::load(); | ||
232 | institutionsModel()->InstitutionsModel::load(); | 217 | institutionsModel()->InstitutionsModel::load(); | ||
233 | onlineJobsModel()->load(); | | |||
234 | costCenterModel()->load(); | 218 | costCenterModel()->load(); | ||
235 | #ifdef ENABLE_UNFINISHEDFEATURES | 219 | #ifdef ENABLE_UNFINISHEDFEATURES | ||
236 | ledgerModel()->load(); | 220 | ledgerModel()->load(); | ||
Context not available. | |||||
248 | // to avoid any uncaught KMyMoneyExceptions while using the account objects from this model after the file has been closed | 232 | // to avoid any uncaught KMyMoneyExceptions while using the account objects from this model after the file has been closed | ||
249 | accountsModel()->removeRows(0, accountsModel()->rowCount()); | 233 | accountsModel()->removeRows(0, accountsModel()->rowCount()); | ||
250 | institutionsModel()->removeRows(0, institutionsModel()->rowCount()); | 234 | institutionsModel()->removeRows(0, institutionsModel()->rowCount()); | ||
251 | onlineJobsModel()->unload(); | | |||
252 | #ifdef ENABLE_UNFINISHEDFEATURES | 235 | #ifdef ENABLE_UNFINISHEDFEATURES | ||
253 | ledgerModel()->unload(); | 236 | ledgerModel()->unload(); | ||
254 | #endif | 237 | #endif | ||
Context not available. |