Bug 255476 - Ledger view remains disabled after switching to a different file
Summary: Ledger view remains disabled after switching to a different file
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: SVN
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-28 09:09 UTC by Thomas Baumgart
Modified: 2010-11-05 20:52 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Baumgart 2010-10-28 09:09:25 UTC
Version:           SVN trunk (using KDE 4.3.5) 
OS:                Linux

The ledger view remains inaccessible (disabled) when opening a different file.

Reproducible: Always

Steps to Reproduce:
Create two KMyMoney data files. Configure KMyMoney so that "Start with last selected view" is turned on. Select the ledger view and quit KMyMoney. (I am not sure if this is necessary, but it's what I have here).

Start KMyMoney with the first filename on the command line, then use File/Open to open the second one.

Actual Results:  
Ledger view is disabled.

Expected Results:  
Ledger view needs to be updated and enabled.
Comment 1 Cristian Oneț 2010-10-28 09:18:44 UTC
I will take a look at this since I'm sure this is caused by revision 1182460
Comment 2 Cristian Oneț 2010-10-28 19:06:25 UTC
SVN commit 1190712 by conet:

BUG: 255476
Ledger view remains disabled after switching to a different file.
This was caused by the fact that the accounts model was not loaded by the time the account selector in the ledger was being used to set the visible account. This means that at that time the visible account could not be set. After the accounts model gets loaded nobody tried to set the ledger's visible account which is correct. Fix this problem by making sure that the accounts model is loaded by the time the ledger's visible account is being set. Do this by activating the "load on idle" feature only if there is a real account loaded not after the first time like it was done before.

 M  +9 -1      accountsmodel.cpp  
 M  +1 -1      accountsmodel.h  
 M  +2 -3      models.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1190712
Comment 3 Cristian Oneț 2010-11-05 20:52:03 UTC
SVN commit 1193387 by conet:

BUG: 255476
Ledger view remains disabled after switching to a different file.
This was caused by the fact that the accounts model was not loaded by the time the account selector in the ledger was being used to set the visible account. This means that at that time the visible account could not be set. After the accounts model gets loaded nobody tried to set the ledger's visible account which is correct. Fix this problem by making sure that the accounts model is loaded by the time the ledger's visible account is being set. Do this by activating the "load on idle" feature only if there is a real account loaded not after the first time like it was done before.
+
A small step in improving the performance issue. Load the accounts model on idle instead of when dataChanged() is emitted when it's possible.
Backport to the stable branch.

 M  +9 -1      accountsmodel.cpp  
 M  +2 -2      accountsmodel.h  
 M  +19 -2     models.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1193387