Purpose of this patch is to speed up set up of accounts model. It involves deduplication of data loaded into model, configuring columns to be displayed and deferring load of data.
Changes:
- Context menu per view for selecting columns to be displayed. Views can have different columns set. If column isn't displayed in any view, then it is released from AccountsModel thus freeing resources.
- During KMM start only Account column is loaded. The rest is loaded on demand.
- Signals for views using KMyMoneyAccountTreeView are connected in ctors of those views, so no need for proxy signals.
- KAccountsView is loaded on demand just like other views.
- Signals blocked in AccountsModel::load to not emit lots of dataChanged signals.
- AccountsModel::loadPreferredAccount for copying preferred account and not recalculating it from the beginning.
- QStandardItemModel::setChild instead of QStandardItemModel::setData(index, value) to lessen overhead.
- AccountsModel::setAccountData takes minimal arguments needed for correctness.
- AccountsModel::setAccountData can update data selectively thus shortening time to update.
- AccountsModel::Columns::*DisplayRole are useless (There is already Qt::DisplayRole), so they were removed significantly.
- AccountsModel::Columns::Account used instead of 0 for correctness.
- KMyMoneyView::slotNetBalProChanged deduplicates common code from views using KMyMoneyAccountTreeView