Make view columns user selectable

Authored by wojnilowicz on Jul 4 2017, 12:14 PM.

Description

Make view columns user selectable

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:

  1. 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.

  1. During KMM start only Account column is loaded. The rest is loaded on

demand.

  1. Signals for views using KMyMoneyAccountTreeView are connected in

ctors of those views, so no need for proxy signals.

  1. KAccountsView is loaded on demand just like other views.
  2. Signals blocked in AccountsModel::load to not emit lots of

dataChanged signals.

  1. AccountsModel::loadPreferredAccount for copying preferred account and

not recalculating it from the beginning.

  1. QStandardItemModel::setChild instead of

QStandardItemModel::setData(index, value) to lessen overhead.

  1. AccountsModel::setAccountData takes minimal arguments needed for

correctness.

  1. AccountsModel::setAccountData can update data selectively thus

shortening time to update.

  1. AccountsModel::Columns::*DisplayRole are useless (There is already

Qt::DisplayRole), so they were removed significantly.

  1. AccountsModel::Columns::Account used instead of 0 for correctness.
  2. KMyMoneyView::slotNetBalProChanged deduplicates common code from

views using KMyMoneyAccountTreeView

BUG:315747
BUG:346009
FIXED-IN:5.0

Signed-off-by: Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com>

Differential Revision: https://phabricator.kde.org/D6954

Signed-off-by: Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com>

Details

Committed
wojnilowiczAug 2 2017, 3:52 PM
Differential Revision
D6954: Make view columns user selectable
Parents
R261:747762d13868: Fix compilation with CMake 3.9
Branches
Unknown
Tags
Unknown