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

2013-05-16 Thread Allan Anderson

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

(Updated May 16, 2013, 12:05 p.m.)


Status
--

This change has been marked as submitted.


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.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

___
KMyMoney-devel mailing list
KMyMoney-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmymoney-devel


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

2013-05-16 Thread Allan Anderson


> On May 16, 2013, 10:50 a.m., Cristian Oneț wrote:
> > kmymoney/models/accountsmodel.cpp, line 68
> > 
> >
> > MyMoneyAccount::accountTypeE acctype = acc.accountType();
> > Just a small style issue.

Thanks.  Fixed that and retested OK.  Will go ahead now.


- Allan


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


On May 15, 2013, 4:31 p.m., Allan Anderson wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/110022/
> ---
> 
> (Updated May 15, 2013, 4:31 p.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.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
> 
>

___
KMyMoney-devel mailing list
KMyMoney-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmymoney-devel


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

2013-05-16 Thread Cristian Oneț

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



kmymoney/models/accountsmodel.cpp


MyMoneyAccount::accountTypeE acctype = acc.accountType();
Just a small style issue.


- Cristian Oneț


On May 15, 2013, 4:31 p.m., Allan Anderson wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/110022/
> ---
> 
> (Updated May 15, 2013, 4:31 p.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.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
> 
>

___
KMyMoney-devel mailing list
KMyMoney-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmymoney-devel


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

2013-05-16 Thread Thomas Baumgart

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

Ship it!


Ship It!

- Thomas Baumgart


On May 15, 2013, 6:31 p.m., Allan Anderson wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/110022/
> ---
> 
> (Updated May 15, 2013, 6:31 p.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.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
> 
>

___
KMyMoney-devel mailing list
KMyMoney-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmymoney-devel


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

2013-05-15 Thread Allan Anderson

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

(Updated May 15, 2013, 4:31 p.m.)


Review request for KMymoney.


Changes
---

Change addedCategoriesList to AccountsModel::Private and reference it through 
the d-pointer, as suggested.



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 (updated)
-

  kmymoney/converter/mymoneyqifreader.cpp f42b12b 
  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

___
KMyMoney-devel mailing list
KMyMoney-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmymoney-devel


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

2013-05-14 Thread Thomas Baumgart

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



kmymoney/models/accountsmodel.h


You should make addedCategoriesList a member of AccountsModel::Private and 
reference it through the d-pointer.



kmymoney/models/accountsmodel.cpp


This should not be here.


- Thomas Baumgart


On May 15, 2013, 1:13 a.m., Allan Anderson wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/110022/
> ---
> 
> (Updated May 15, 2013, 1:13 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
> 
>

___
KMyMoney-devel mailing list
KMyMoney-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmymoney-devel


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

2013-05-14 Thread Allan Anderson

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

(Updated May 14, 2013, 11:13 p.m.)


Review request for KMymoney.


Changes
---

For the sake of clarity, I'll illustrate the issues.  There were two different 
problems, but which produced similar symptoms, although only in Categories view.
A) If a QIF categories list file like this -
"
!Type:Cat
NA:B
DOne sub cat
E
^
"
was imported, it produced the expected structure -
"
A
|-B
"
If it was imported again, the resultant structure was -
"
A
|-B
|-B
"

B) If a QIF categories list file like this -
!Type:Cat
NA:B:C:D
DThree sub cats
E
^
"
was imported, it produced the following weird structure -
"
A
|-B
  |-C
  | |-D
  | |-D
  |-C
|-D
"
No double import was necessary.  Also, if that same imported category format 
was entered manually, the same structure appeared in Categories view.

This new patch file differs only in having the redundant duplicateCategory flag 
removed.


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 (updated)
-

  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

___
KMyMoney-devel mailing list
KMyMoney-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmymoney-devel


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

2013-05-14 Thread Allan Anderson


> On April 21, 2013, 3:47 p.m., Thomas Baumgart wrote:
> > kmymoney/models/accountsmodel.cpp, line 89
> > 
> >
> > .. and here the check for the flag to be false. How could it ever get 
> > true here?
> > 
> > Looking at it, I would simply remove all the flag business and simply 
> > return if the account is already there (as you do).
> 
> Allan Anderson wrote:
> Agreed and done.  All tests OK.  I think what I'd done was to add the 
> return later, without looking at the consequence.  A lesson to be learned.
> 
> Allan Anderson wrote:
> Is anyone able to say if this is now OK to ship, please?
> 
> Cristian Oneț wrote:
> You did not update the patch with the flag removed so I can't say. I 
> still didn't have time to look into this but without that flag the patch 
> should look more 'elegant' :).

No, I was holding off for further changes from yourself.  I have had the flag 
removed here for a while, but I'll do some triple checking, and further testing 
and then do a full update of the patch.


- Allan


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


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
> 
>

___
KMyMoney-devel mailing list
KMyMoney-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmymoney-devel


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

2013-05-14 Thread Cristian Oneț


> On April 21, 2013, 3:47 p.m., Thomas Baumgart wrote:
> > kmymoney/models/accountsmodel.cpp, line 89
> > 
> >
> > .. and here the check for the flag to be false. How could it ever get 
> > true here?
> > 
> > Looking at it, I would simply remove all the flag business and simply 
> > return if the account is already there (as you do).
> 
> Allan Anderson wrote:
> Agreed and done.  All tests OK.  I think what I'd done was to add the 
> return later, without looking at the consequence.  A lesson to be learned.
> 
> Allan Anderson wrote:
> Is anyone able to say if this is now OK to ship, please?

You did not update the patch with the flag removed so I can't say. I still 
didn't have time to look into this but without that flag the patch should look 
more 'elegant' :).


- Cristian


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


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
> 
>

___
KMyMoney-devel mailing list
KMyMoney-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmymoney-devel


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

2013-05-14 Thread Allan Anderson


> On April 21, 2013, 3:47 p.m., Thomas Baumgart wrote:
> > kmymoney/models/accountsmodel.cpp, line 89
> > 
> >
> > .. and here the check for the flag to be false. How could it ever get 
> > true here?
> > 
> > Looking at it, I would simply remove all the flag business and simply 
> > return if the account is already there (as you do).
> 
> Allan Anderson wrote:
> Agreed and done.  All tests OK.  I think what I'd done was to add the 
> return later, without looking at the consequence.  A lesson to be learned.

Is anyone able to say if this is now OK to ship, please?


- Allan


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


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
> 
>

___
KMyMoney-devel mailing list
KMyMoney-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmymoney-devel


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

2013-04-25 Thread Allan Anderson


> On April 21, 2013, 3:47 p.m., Thomas Baumgart wrote:
> > kmymoney/models/accountsmodel.cpp, line 65
> > 
> >
> > Am I missing something here? You set this boolean to false, set it to 
> > true in only one spot and return immediately afterwards. The only time you 
> > check this flag it is always false. So to me this simply is a NOP.

See below.  I haven't done a revised patch at this stage, as I think I'm 
waiting on Cristian (17 April), who wants to '...come up with a more elegant 
fix.'


> On April 21, 2013, 3:47 p.m., Thomas Baumgart wrote:
> > kmymoney/models/accountsmodel.cpp, line 89
> > 
> >
> > .. and here the check for the flag to be false. How could it ever get 
> > true here?
> > 
> > Looking at it, I would simply remove all the flag business and simply 
> > return if the account is already there (as you do).

Agreed and done.  All tests OK.  I think what I'd done was to add the return 
later, without looking at the consequence.  A lesson to be learned.


- Allan


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


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
> 
>

___
KMyMoney-devel mailing list
KMyMoney-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmymoney-devel


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

2013-04-21 Thread Thomas Baumgart

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



kmymoney/models/accountsmodel.cpp


Am I missing something here? You set this boolean to false, set it to true 
in only one spot and return immediately afterwards. The only time you check 
this flag it is always false. So to me this simply is a NOP.



kmymoney/models/accountsmodel.cpp


Here's the corresponding return ...



kmymoney/models/accountsmodel.cpp


.. and here the check for the flag to be false. How could it ever get true 
here?

Looking at it, I would simply remove all the flag business and simply 
return if the account is already there (as you do).


- Thomas Baumgart


On April 15, 2013, 1:53 p.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, 1:53 p.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
> 
>

___
KMyMoney-devel mailing list
KMyMoney-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmymoney-devel


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

2013-04-17 Thread Allan Anderson


> On April 17, 2013, 6:42 a.m., Cristian Oneț wrote:
> > 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.

Yes, that's it, more or less.
Ignoring imports for the moment, if one wishes to have a structure 
catA:subcatB:subcatC, then, entering that all in one step results in the 
duplication, in the view, of subcatC.  So, the whole structure is created in 
one go.  If, instead, one creates the steps one at a time, all is well.  Adding 
a further subcategory results in a third level one with two copies of the 
fourth level one, followed by another third level one with a further copy of 
the fourth level one.

As I see it, in the first method, when catA is created, recursively subcatB is 
the added, then subcatC.  Next, it moves on and tries to do the same with 
subcatB, etc.  The now-existing categories are not discovered.

Sadly, I don't do 'elegant', at least not in models.  I had a hard enough time 
finding my way around.  I couldn't see where in the model to find the newly 
created categories, that's why I had to resort to using a list to record them 
temporarily.


- Allan


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


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
> 
>

___
KMyMoney-devel mailing list
KMyMoney-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmymoney-devel


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

2013-04-16 Thread Cristian Oneț

---
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
> 
>

___
KMyMoney-devel mailing list
KMyMoney-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmymoney-devel


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

2013-04-15 Thread Allan Anderson

---
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

___
KMyMoney-devel mailing list
KMyMoney-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmymoney-devel


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

2013-04-15 Thread Allan Anderson

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

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

___
KMyMoney-devel mailing list
KMyMoney-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmymoney-devel