<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>268274</bug_id>
          
          <creation_ts>2011-03-12 03:47:21 +0000</creation_ts>
          <short_desc>kmymoney 4.5.3 hangs for ~60 seconds upon right clicking payee from payees tab</short_desc>
          <delta_ts>2012-03-07 13:17:06 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>kmymoney</product>
          <component>general</component>
          <version>unspecified</version>
          <rep_platform>Ubuntu</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Bob Mroczka">rmroczk</reporter>
          <assigned_to name="KMyMoney Devel Mailing List">kmymoney-devel</assigned_to>
          <cc>20120808_bugs.kde.org</cc>
    
    <cc>alan.m.hughes</cc>
    
    <cc>martin.tlustos</cc>
    
    <cc>mguttman</cc>
    
    <cc>n.baughman</cc>
    
    <cc>onet.cristian</cc>
    
    <cc>yzhernand</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>10</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1096193</commentid>
    <comment_count>0</comment_count>
    <who name="Bob Mroczka">rmroczk</who>
    <bug_when>2011-03-12 03:47:21 +0000</bug_when>
    <thetext>Version:           unspecified (using KDE 4.6.1) 
OS:                Linux

strace on process yields thousands of repeated clock_gettime(CLOCK_MONOTONIC... calls.  same behavior occurs from ledger when right clicking a transaction and then choosing go to payee.  other all activity performed within the application is very responsive and does not cause this hanging behavior.
i performed a consistency check and the OK dialog returned almost instantaneously.

Reproducible: Always</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1100854</commentid>
    <comment_count>1</comment_count>
    <who name="Cristian Oneț">onet.cristian</who>
    <bug_when>2011-03-24 19:51:34 +0000</bug_when>
    <thetext>This is caused by a performance problem in the payees view caused by the complexity of KPayeesView::slotSelectPayee(void) which, depending on the dataset, can take a while (I observed 1-2 seconds on my production version of the application).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1100882</commentid>
    <comment_count>2</comment_count>
    <who name="Cristian Oneț">onet.cristian</who>
    <bug_when>2011-03-24 20:45:55 +0000</bug_when>
    <thetext>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 &quot;stage 2&quot; means that I had split the KPayeesView::slotSelectPayee function in two because it&apos;s pretty complex with &quot;stage 2&quot; 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 &lt; m_payeesList-&gt;count(); ++i)
      m_payeesList-&gt;item(i)-&gt;setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);

and 
  for (int i = 0; i &lt; m_payeesList-&gt;count(); ++i)
    m_payeesList-&gt;item(i)-&gt;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1102256</commentid>
    <comment_count>3</comment_count>
    <who name="Cristian Oneț">onet.cristian</who>
    <bug_when>2011-03-29 10:50:54 +0000</bug_when>
    <thetext>Quoting a user from the mailing list:
&quot;Hi, I&apos;m using kmymoney 4.5.3 in kde4.6.1/kubuntu 10.10

I moved last week from Quicken 2002 standard. Last time I tried before
that kmymoney would not import the QIF file as it was too old. However,
I was able to accomplish this by importing the QIF files into Skrooge,
and exporting as a kmymoney file. Import to kmymoney of 12 years of data
was flawless so that was great.

However, I have a list of payees that also goes back 12 years. Many
(probably 80%) are superfluous of course. However if I click on any one
of them the program will freeze and has to be forcibly closed. This also
happens if I click on any of the icons at the top of the payee list. I
have created a new blank kmymoney file and don&apos;t have this issue so I
suspect it&apos;s because of the sheer number of payees.

Is there any way I can edit the payee list from outside the program (I
wouldn&apos;t even mind clearing it) without causing damage to something else?&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1106010</commentid>
    <comment_count>4</comment_count>
    <who name="Bob Mroczka">rmroczk</who>
    <bug_when>2011-04-09 20:01:33 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; Further information to help pinpoint the source of the problem:
&gt; Timer(KPayeesView::slotSelectPayee): 24 elapsed
&gt; Timer(KPayeesView::slotSelectPayee stage 2): 481 elapsed
&gt; Timer(KPayeesView::slotSelectPayee end): 11 elapsed
&gt; Timer(KPayeesView::slotSelectPayee): 0 elapsed
&gt; Timer(KPayeesView::slotSelectPayee stage 2): 482 elapsed
&gt; Timer(KPayeesView::slotSelectPayee end): 10 elapsed
&gt; Timer(KPayeesView::slotSelectPayee): 258 elapsed
&gt; Timer(KPayeesView::slotSelectPayee stage 2): 479 elapsed
&gt; Timer(KPayeesView::slotSelectPayee end): 11 elapsed
&gt; 
&gt; Where &quot;stage 2&quot; means that I had split the KPayeesView::slotSelectPayee
&gt; function in two because it&apos;s pretty complex with &quot;stage 2&quot; beginning from line
&gt; 417. As it can be seen from this trace the performance problem is somewhere
&gt; between lines 370 and 417.
&gt; 
&gt; Some examples would be:
&gt;     for (int i = 0; i &lt; m_payeesList-&gt;count(); ++i)
&gt;       m_payeesList-&gt;item(i)-&gt;setFlags(Qt::ItemIsSelectable |
&gt; Qt::ItemIsEnabled);
&gt; 
&gt; and 
&gt;   for (int i = 0; i &lt; m_payeesList-&gt;count(); ++i)
&gt;     m_payeesList-&gt;item(i)-&gt;setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable |
&gt; Qt::ItemIsEnabled);
&gt; 
&gt; each of these calls emmit an itemChanged signal which is connected to
&gt; 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 &lt; m_payeesList-&gt;count(); ++i)
  m_payeesList-&gt;item(i)-&gt;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&apos;m unsure how to proceed in resolving this issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1106341</commentid>
    <comment_count>5</comment_count>
    <who name="Alvaro Soliverez">asoliverez</who>
    <bug_when>2011-04-10 18:28:57 +0000</bug_when>
    <thetext>*** Bug 270596 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1110612</commentid>
    <comment_count>6</comment_count>
    <who name="Bob Mroczka">rmroczk</who>
    <bug_when>2011-04-23 14:48:56 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; Further information to help pinpoint the source of the problem:
&gt; Timer(KPayeesView::slotSelectPayee): 24 elapsed
&gt; Timer(KPayeesView::slotSelectPayee stage 2): 481 elapsed
&gt; Timer(KPayeesView::slotSelectPayee end): 11 elapsed
&gt; Timer(KPayeesView::slotSelectPayee): 0 elapsed
&gt; Timer(KPayeesView::slotSelectPayee stage 2): 482 elapsed
&gt; Timer(KPayeesView::slotSelectPayee end): 10 elapsed
&gt; Timer(KPayeesView::slotSelectPayee): 258 elapsed
&gt; Timer(KPayeesView::slotSelectPayee stage 2): 479 elapsed
&gt; Timer(KPayeesView::slotSelectPayee end): 11 elapsed
&gt; 
&gt; Where &quot;stage 2&quot; means that I had split the KPayeesView::slotSelectPayee
&gt; function in two because it&apos;s pretty complex with &quot;stage 2&quot; beginning from line
&gt; 417. As it can be seen from this trace the performance problem is somewhere
&gt; between lines 370 and 417.
&gt; 
&gt; Some examples would be:
&gt;     for (int i = 0; i &lt; m_payeesList-&gt;count(); ++i)
&gt;       m_payeesList-&gt;item(i)-&gt;setFlags(Qt::ItemIsSelectable |
&gt; Qt::ItemIsEnabled);
&gt; 
&gt; and 
&gt;   for (int i = 0; i &lt; m_payeesList-&gt;count(); ++i)
&gt;     m_payeesList-&gt;item(i)-&gt;setFlags(Qt::ItemIsEditable | Qt::ItemIsSelectable |
&gt; Qt::ItemIsEnabled);
&gt; 
&gt; each of these calls emmit an itemChanged signal which is connected to
&gt; slotRenamePayee which indeed does nothing if m_allowEditing is false.

I commented out both of these for loops and recompiled. I am no longer having the issue and I am not noticing any unexpected behavior.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1112782</commentid>
    <comment_count>7</comment_count>
    <who name="Mike">mguttman</who>
    <bug_when>2011-04-29 13:46:10 +0000</bug_when>
    <thetext>I am seeing a 1-2 minute delay whenever I do anything on the payee list, e.g.
* right-click on a name
* left click to select another payee
* double-click to rename

I don&apos;t have the source code installed, just got the package via yum.  So it&apos;s not easy for me to change the code as suggested above.

Will a fix for this be implemented soon?  It really makes the program painful to use, considering that most other things work well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1113796</commentid>
    <comment_count>8</comment_count>
    <who name="Alvaro Soliverez">asoliverez</who>
    <bug_when>2011-05-02 02:09:46 +0000</bug_when>
    <thetext>I agree with the change. Those lines of code are a leftover of the KDE3 widgets. It is no longer necessary, as the edit is only allowed when only 1 item is selected anyway. And double-clicking selects 1 item too.

If no one objects, I will commit the fix suggested above, removing those lines of code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1114269</commentid>
    <comment_count>9</comment_count>
    <who name="Alvaro Soliverez">asoliverez</who>
    <bug_when>2011-05-03 02:20:52 +0000</bug_when>
    <thetext>SVN commit 1230245 by asoliverez:

Removed setting the flags of each PayeeItem individually. This should solve the performance problem when managing payees.
BUG:268274

 M  +0 -7      kpayeesview.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&amp;revision=1230245</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1114285</commentid>
    <comment_count>10</comment_count>
    <who name="Brendan">KDE</who>
    <bug_when>2011-05-03 03:57:01 +0000</bug_when>
    <thetext>Thanks for fixing that bug. It was driving me crazy:) I just compiled and it
does not hang any more.

----
Brendan





On Mon, May 2, 2011 at 5:20 PM, Alvaro Soliverez &lt;asoliverez@kde.org&gt; wrote:

&gt; https://bugs.kde.org/show_bug.cgi?id=268274
&gt;
&gt;
&gt; Alvaro Soliverez &lt;asoliverez@kde.org&gt; changed:
&gt;
&gt;           What    |Removed                     |Added
&gt;
&gt; ----------------------------------------------------------------------------
&gt;              Status|ASSIGNED                    |RESOLVED
&gt;         Resolution|                            |FIXED
&gt;
&gt;
&gt;
&gt;
&gt; --- Comment #9 from Alvaro Soliverez &lt;asoliverez kde org&gt;  2011-05-03
&gt; 02:20:52 ---
&gt; SVN commit 1230245 by asoliverez:
&gt;
&gt; Removed setting the flags of each PayeeItem individually. This should solve
&gt; the
&gt; performance problem when managing payees.
&gt; BUG:268274
&gt;
&gt;  M  +0 -7      kpayeesview.cpp
&gt;
&gt;
&gt; WebSVN link: http://websvn.kde.org/?view=rev&amp;revision=1230245
&gt;
&gt; --
&gt; Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
&gt; ------- You are receiving this mail because: -------
&gt; You are the assignee for the bug.
&gt; _______________________________________________
&gt; KMyMoney-devel mailing list
&gt; KMyMoney-devel@kde.org
&gt; https://mail.kde.org/mailman/listinfo/kmymoney-devel
&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1114286</commentid>
    <comment_count>11</comment_count>
    <who name="Yözen Hernández">yzhernand</who>
    <bug_when>2011-05-03 04:04:11 +0000</bug_when>
    <thetext>Agreed. Thank you very much.

I can&apos;t compile 4.5.3 and above because then I&apos;d have to get the latest AqBanking libraries, but just commenting out those loops, as previously described, does the job.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1115626</commentid>
    <comment_count>12</comment_count>
    <who name="Cristian Oneț">onet.cristian</who>
    <bug_when>2011-05-06 16:22:25 +0000</bug_when>
    <thetext>*** Bug 262419 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1206898</commentid>
    <comment_count>13</comment_count>
    <who name="Alvaro Soliverez">asoliverez</who>
    <bug_when>2011-12-30 22:07:38 +0000</bug_when>
    <thetext>*** Bug 290209 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1233514</commentid>
    <comment_count>14</comment_count>
    <who name="Cristian Oneț">onet.cristian</who>
    <bug_when>2012-03-07 13:17:06 +0000</bug_when>
    <thetext>*** Bug 295465 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>