Bug 274598

Summary: Unable to add account: Account has invalid type
Product: [Applications] kmymoney Reporter: allan <agander93>
Component: generalAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: SVN   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:

Description allan 2011-05-31 13:59:05 UTC
Version:           SVN trunk (using KDE 4.6.0) 
OS:                Linux

I have a QIF file containing a category list including a large number of categories.  When I try to import, each entry produces the message 'Unable to add account: Account has invalid type'.  The only option given is 'OK', which produces the same message for the next category.   There are too many entries to continue, so KMM has to be aborted, and the user is none the wiser as to the record in question or the problem with it.

I'm pretty sure this file imported correctly under KMM 1.x and earlier.

If the file size is reduced and the messages accepted, the import proceeds but no categories get created.

The file format seems OK to me - 

!Type:Cat
NBonus
I
^
NCapital gains
I
^
NChild Benefit
I
^
NDiv Income
I
^
NDiv Income:Ord dividend
I
^
!Type:Bank
D26.11.2006
T0.00
CX
POpening Balance
L[Artemis Inc]
^


Reproducible: Didn't try

Steps to Reproduce:
Make a QIF file as above and import it.

Actual Results:  
as described.

Expected Results:  
Categories get created.
User is give helpful information of problem.
User is given opportunity to abort.
Comment 1 allan 2011-06-01 12:14:20 UTC
SVN commit 1234489 by allananderson:

When trying to import a category list, each entry produces the message 'Unable to add account: Account has invalid type'.  The only option given is 'OK', which produces the same message for the next category.
The problem lies in MyMoneyQifReader::processCategoryEntry.  An "!extractLine('I').isEmpty()" (or 'E') test is performed.  If, as is likely, the line 
contains only the 'I' or 'E', the test will return empty and no accounts get set up.

The test is modified to confirm if either line is detected, empty or otherwise, and then set up accordingly.
BUG:274598
REVIEW:6694


 M  +5 -2      mymoneyqifreader.cpp  


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