[Kmymoney-devel] [Bug 268274] kmymoney 4.5.3 hangs for ~60 seconds upon right clicking payee from payees tab
Bob Mroczka
bob at mroczka.com
Sat Apr 9 20:01:35 CEST 2011
https://bugs.kde.org/show_bug.cgi?id=268274
--- Comment #4 from Bob Mroczka <bob mroczka com> 2011-04-09 20:01:33 ---
(In reply to comment #2)
> Further information to help pinpoint the source of the problem:
> Timer(KPayeesView::slotSelectPayee): 24 elapsed
> Timer(KPayeesView::slotSelectPayee stage 2): 481 elapsed
> Timer(KPayeesView::slotSelectPayee end): 11 elapsed
> Timer(KPayeesView::slotSelectPayee): 0 elapsed
> Timer(KPayeesView::slotSelectPayee stage 2): 482 elapsed
> Timer(KPayeesView::slotSelectPayee end): 10 elapsed
> Timer(KPayeesView::slotSelectPayee): 258 elapsed
> Timer(KPayeesView::slotSelectPayee stage 2): 479 elapsed
> Timer(KPayeesView::slotSelectPayee end): 11 elapsed
>
> Where "stage 2" means that I had split the KPayeesView::slotSelectPayee
> function in two because it's pretty complex with "stage 2" beginning from line
> 417. As it can be seen from this trace the performance problem is somewhere
> between lines 370 and 417.
>
> Some examples would be:
> for (int i = 0; i < m_payeesList->count(); ++i)
> m_payeesList->item(i)->setFlags(Qt::ItemIsSelectable |
> Qt::ItemIsEnabled);
>
> and
> for (int i = 0; i < m_payeesList->count(); ++i)
> m_payeesList->item(i)->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable |
> Qt::ItemIsEnabled);
>
> each of these calls emmit an itemChanged signal which is connected to
> slotRenamePayee which indeed does nothing if m_allowEditing is false.
You hit the nail on the head. In my particular case I have just over 1000
payees. I made some changes to kpayeesview.cpp myself and can confirm the poor
performing code is
for (int i = 0; i < m_payeesList->count(); ++i)
m_payeesList->item(i)->setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable |
Qt::ItemIsEnabled);
I noticed about a 30 second delay while performing this loop. In addition I
found something else interesting. When I am in the ledger and right click on a
transaction then click go to payee this particular function is getting invoked
twice and that this particular loop is getting called a second time compounding
the delay. my qt/c++ skills are very lacking so I'm unsure how to proceed in
resolving this issue.
--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the KMyMoney-devel
mailing list