[Kmymoney-devel] Review Request 110022: Creation of sub-categories duplicated in Categories view.

Cristian Oneț onet.cristian at gmail.com
Wed Apr 17 06:42:35 UTC 2013


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/110022/#review31194
-----------------------------------------------------------


I need a bit of time to take a look at the bug (the categories view part of it). As I understood the categories view has a problem that causes the same category to be displayed twice, even though there is only one category in the file, is that correct? If so let me understand what is going on and maybe we can come up with a more elegant fix.

- Cristian Oneț


On April 15, 2013, 11:53 a.m., Allan Anderson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/110022/
> -----------------------------------------------------------
> 
> (Updated April 15, 2013, 11:53 a.m.)
> 
> 
> Review request for KMymoney.
> 
> 
> Description
> -------
> 
> BUG:317655 - Re-importing a categories list QIF file results in duplicated categories. Also, when creating sub-categories, some may appear twice or more times in Categories view.
> 
> These problems showed up with a single users categories list QIF file.  The re-importing problem is fixed by the 
> /kmymoney/converter/mymoneyqifreader.cpp change.
> 
> @@ -906,7 +906,7 @@ void MyMoneyQifReader::processCategoryEntry(void)
>    }
>  
>    // check if we can find the account already in the file
> -  MyMoneyAccount acc = kmymoney->findAccount(account, MyMoneyAccount());
> +  MyMoneyAccount acc = kmymoney->findAccount(account, parentAccount);
> 
> Even without any re-importing, there was a further problem, where third-level(plus) sub-categories get duplicated.  With the following simple file -
> "!Type:Cat
> NUtilities:Telephone:Cell:A
> DCell Phone
> E
> ^"
> the "N" line is dealt with recursively, and initially, all the categories get created.  However, what happens then is that the second part is dealt with, and the next lower level is created again, etc.
> 
> Initially, during this recursive process, the categories have not yet been added to the KMM file, so I add them to a new addedCategoriesList, which is scanned on each pass, to avoid this duplication.  Because the process is recursive, I made the list static, to ensure the higher levels are retained between passes when descending the tree.
> 
> The problem is not confined to importing.  If that "N" line category tree is created manually, in one entry, or during .kmy file loading, the third and lower levels get duplicated/triplicated.
> 
> The problem manifests itself only in the Categories view.  Within the rest of KMM, the categories are created and maintained correctly.
> 
> 
> This addresses bug 317655.
>     http://bugs.kde.org/show_bug.cgi?id=317655
> 
> 
> Diffs
> -----
> 
>   kmymoney/converter/mymoneyqifreader.cpp f42b12b 
>   kmymoney/models/accountsmodel.h 38f9f2c 
>   kmymoney/models/accountsmodel.cpp 3679314 
> 
> Diff: http://git.reviewboard.kde.org/r/110022/diff/
> 
> 
> Testing
> -------
> 
> Numerous test case QIF files created and imported.  Also, as the problem affected my live data file, that, too, was used for testing.
> 
> 
> Thanks,
> 
> Allan Anderson
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kmymoney-devel/attachments/20130417/f07e0c2d/attachment.html>


More information about the KMyMoney-devel mailing list