Bug 288293 - Deleting a category with subcategories referenced only in budgets results in an uncaught exception
Summary: Deleting a category with subcategories referenced only in budgets results in ...
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: SVN
Platform: Gentoo Packages Linux
: NOR crash (vote)
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-05 22:46 UTC by Cristian Oneț
Modified: 2011-12-18 18:48 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Testfile to reproduce the described bug (4.45 KB, application/x-kmymoney)
2011-12-05 22:46 UTC, Cristian Oneț
Details

Note You need to log in before you can comment on or make changes to this 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