Bug 249852 - categories are all zero when opening another file
Summary: categories are all zero when opening another file
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 4.5
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-02 10:45 UTC by Stefan Vater
Modified: 2011-12-10 08:57 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 Stefan Vater 2010-09-02 10:45:51 UTC
Version:           4.5 (using KDE 4.5.0) 
OS:                Linux

When opening another file (after one file was open) the categories in the new file are gone. I have to close kmymoney and reopen it to have the categories again.

Reproducible: Sometimes

Steps to Reproduce:
see above. The problem is that this does not happen always, only sometimes!


Expected Results:  
Categories are there as defined before.
Comment 1 Alvaro Soliverez 2010-09-02 11:44:25 UTC
I have never seen this. Is there anything in particular about these files?
Comment 2 Stefan Vater 2010-09-02 12:07:01 UTC
I am not sure. The roblem really is that this only happens occasionally. Would it help to sen you an anonymous file?
Comment 3 Alvaro Soliverez 2010-09-02 12:25:17 UTC
when it happens, can you take a screenshot of the categories?
Also, if you can save them as anonymous file, compress them and upload them, it would be great. (Don't forget to compress the files, 'cause there are size limits)
Comment 4 Cristian Oneț 2010-09-02 12:32:36 UTC
I've seen this before it's an old issue dating back to the KDE3 version. I just haven't been able to find out what is causing it.
Comment 5 Stefan Vater 2010-09-02 12:57:45 UTC
Yes, this has already happened in the 1.0.x versions. I just wanted to wait for the 4.5 version to see if the problem persists. I will do a screenshot and send the files to you as soon as it happens again.

By the way: This software is great work! I love it. Thank you very much and keep going!
Comment 6 Cristian Oneț 2010-09-02 13:16:09 UTC
I've just remembered something and I'll post it here as a hint. While developing the accounts model I've observed that if you the accounts list is requested from the MyMoneyFile object before it's completely loaded then the categories get the balances displayed as 0. 
Running a consistency check fixes it but we should take a look at it by locally adding a code that reads the account list while the file is not completely loaded and debugging to see what causes this behavior.
Since this bug usually happens when switching between kmymoney files I assume that some widget requests the account list while the file is not completely loaded thus triggering this behavior.
Comment 7 Alvaro Soliverez 2010-09-03 15:52:08 UTC
There is a signal fileLoaded. Perhaps if we add a fileClosed signal, and we prevent the models from updating between those two signals, ie. when the file is closed or it has not been completely loaded, we can prevent the problem.
Comment 8 Thomas Baumgart 2011-09-28 19:01:17 UTC
Cristian: could it be that we already fixed this?
Comment 9 Cristian Oneț 2011-12-10 08:57:02 UTC
I'm closing this bug since I'm sure it's fixed by this commit:
http://websvn.kde.org/?revision=1224575&view=revision

This can't happen anymore since:
1. AccountsModel is loaded after the file is loaded
2. AccountsModel is cleared after the file is closed
3. AccountsModel::load() is only called in the above cases so there is no way to reach the situation in which  AccountsModel::load() is called while the file is empty which was causing this bug