[Kmymoney-devel] [Bug 309105] Crash after editing security

allan agander93 at gmail.com
Wed Nov 14 20:36:31 UTC 2012


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

--- Comment #8 from allan <agander93 at 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.


More information about the KMyMoney-devel mailing list