Bug 288293

Summary: Deleting a category with subcategories referenced only in budgets results in an uncaught exception
Product: [Applications] kmymoney Reporter: Cristian OneČ› <onet.cristian>
Component: generalAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version: SVN   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Testfile to reproduce the described bug

Description Cristian OneČ› 2011-12-05 22:46:38 UTC
Created attachment 66419 [details]
Testfile to reproduce the described bug

Version:           SVN trunk (using KDE 4.7.3) 
OS:                Linux

I was working on BUG 288279 when I've stumbled upon this scenario after reading the lax reference tests in kmymoney.cpp between lines 3406-3418.
It seems that if the user selects "Delete all" the sub-categories are only checked for references in transactions which will not be enough.
Any ideas on how to run the same reference tests for the sub-accounts?

Reproducible: Always

Steps to Reproduce:
1. Delete 'Parent' expense account
2. Choose the "Delete all" option

Actual Results:  
Observe the uncaught exception

Expected Results:  
The account and the sub-accounts should be deleted correctly by removing/moving all the references to them.

OS: Linux (x86_64) release 3.0.6-gentoo
Compiler: x86_64-pc-linux-gnu-gcc
Comment 1 Thomas Baumgart 2011-12-18 18:35:49 UTC
Git commit b2ceddca0d5c2252fb24edb4ddb6fab782d309f1 by Thomas Baumgart.
Committed on 18/12/2011 at 19:35.
Pushed by tbaumgart into branch 'master'.

BUG: 288293

Don't delete objects from cache that are not touched during removeAccountList

M  +5    -4    kmymoney/mymoney/mymoneyfile.cpp

http://commits.kde.org/kmymoney/b2ceddca0d5c2252fb24edb4ddb6fab782d309f1
Comment 2 Thomas Baumgart 2011-12-18 18:48:54 UTC
Git commit d7d700da38c107b8741f2339db1f0dc2bb1b5aa1 by Thomas Baumgart.
Committed on 18/12/2011 at 19:35.
Pushed by tbaumgart into branch '4.6'.

BUG: 288293

Don't delete objects from cache that are not touched during removeAccountList
(cherry picked from commit b2ceddca0d5c2252fb24edb4ddb6fab782d309f1)

M  +5    -4    kmymoney/mymoney/mymoneyfile.cpp

http://commits.kde.org/kmymoney/d7d700da38c107b8741f2339db1f0dc2bb1b5aa1