https://bugs.kde.org/show_bug.cgi?id=309105

--- Comment #8 from allan <agande...@gmail.com> ---
It wasn't helpful to load all accounts from file into the model every time the
void InstitutionsModel::slotObjectAdded() routine was entered, the line
d->m_file->accountList(list);
being the cause.

I've now revised the patch and the end of void
InstitutionsModel::slotObjectAdded() now is -

  if (!account || account->parentAccountId().isEmpty() ||
account->isIncomeExpense())
    return;

  static_cast<InstitutionsPrivate *>(d)->loadInstitution(this, *account);
  QStringList list = account->accountList();
  for (QStringList::ConstIterator it_l = list.constBegin(); it_l !=
list.constEnd(); ++it_l) {
    const MyMoneyAccount& accnt = d->m_file->account(*it_l);
    static_cast<InstitutionsPrivate *>(d)->loadInstitution(this, accnt);
  }
}
The crash no longer occurs and varying the order of creation of the various
institution, investment and stock accounts has not so far produced any
problems.  Neither has testing with my live file.  I'll continue testing, and
would appreciate a 'looks OK', or otherwise, before I commit.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
KMyMoney-devel mailing list
KMyMoney-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmymoney-devel

Reply via email to