Bug 279470 - Accounts view is not updated when account data changes
Summary: Accounts view is not updated when account data changes
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Unclassified
Component: general (show other bugs)
Version: SVN
Platform: openSUSE RPMs Linux
: HI critical (vote)
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-05 17:36 UTC by Thomas Baumgart
Modified: 2011-08-06 13:27 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
This patch fixed the problem but should receive a bit of review before committing it right before the release (2.97 KB, patch)
2011-08-05 18:02 UTC, Cristian Oneț
Details
Updated the patch to handle the changing of the 'Favorite' status of the account (3.41 KB, patch)
2011-08-05 18:30 UTC, Cristian Oneț
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Baumgart 2011-08-05 17:36:34 UTC
Version:           SVN trunk (using KDE 4.6.0) 
OS:                Linux

The accounts view is not updated after changes to an account.

Reproducible: Always

Steps to Reproduce:
Select the accounts view, select an account, select 'Account/Edit' and change the name. Press OK.

Actual Results:  
Name in accounts view is not updated.

Expected Results:  
Name in accounts view is updated.

Changing the name of a category in the categories view updates the name in the view.
Comment 1 Cristian Oneț 2011-08-05 18:02:50 UTC
Created attachment 62582 [details]
This patch fixed the problem but should receive a bit of review before committing it right before the release

The bug only affect accounts which are marked as 'Favorite'.

This happens because there are actually 2 items for such accounts in the accounts model. In the future the 'Favorites' account grouping should be done in a proxy (as if that would be easier :):)).

The fix consist in internal API change. The function which was used to retrieve the account item by id (when the parent item was not known) now always returns the account which is not the child of the 'Favorite accounts' item.

In the client code of this API in all the relevant places when an account is favorite the corresponding item is also updated explicitly.

Thoughts?
Comment 2 Cristian Oneț 2011-08-05 18:30:29 UTC
Created attachment 62584 [details]
Updated the patch to handle the changing of the 'Favorite' status of the account
Comment 3 Cristian Oneț 2011-08-06 13:27:00 UTC
SVN commit 1245224 by conet:

BUG: 279470
Update all the model items even if an account is favorite in which case there are two items which correspond to the same account. This is another case of account data change that affects the model layout that was not handled correctly.
And extra fix of the AccountsFilterProxyModel::removeAccountType which now really removes the account type even if the type is present in the list more then once (m_typeList should really be a set).

 M  +28 -8     accountsmodel.cpp  


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