<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://svn.reviewboard.kde.org/r/6694/">http://svn.reviewboard.kde.org/r/6694/</a>
     </td>
    </tr>
   </table>
   <br />








<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On May 31st, 2011, 7:33 p.m., <b>Cristian Onet</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  



<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="http://svn.reviewboard.kde.org/r/6694/diff/1/?file=46317#file46317line877" style="color: black; font-weight: bold; text-decoration: underline;">/trunk/extragear/office/kmymoney/kmymoney/converter/mymoneyqifreader.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">void MyMoneyQifReader::processCategoryEntry(void)</pre></td>

  </tr>
 </tbody>



 
 




 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">874</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">  } else if (!extractLine(&#39;E&#39;).isEmpty()) {</pre></td>
    <th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">877</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">  } else if <span class="hl">(</span>(!extractLine(&#39;E&#39;).isEmpty()) <span class="hl">|| (m_extractedLine != -1)) </span>{</pre></td>
  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The second m_extractedLine != -1 is unnecessary since the first one will always have priority.</pre>
 </blockquote>



 <p>On May 31st, 2011, 7:48 p.m., <b>Allan Anderson</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Sorry, but I must be missing something.

If the first extract line test fails and drops through to the second, the second &#39;empty&#39; test is always going to fail, and the first test will have reset m_extractedLine to -1, so as I see it, the setup for the &#39;E&#39; line will not occur?</pre>
 </blockquote>







</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">If the call to extractLine changes m_extractedLine then it makes sense.</pre>
<br />




<p>- Cristian</p>


<br />
<p>On May 31st, 2011, 7:20 p.m., Allan Anderson wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://svn.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for kmymoney.</div>
<div>By Allan Anderson.</div>


<p style="color: grey;"><i>Updated May 31, 2011, 7:20 p.m.</i></p>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">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 &#39;Unable to
add account: Account has invalid type&#39;.  The only option given is &#39;OK&#39;, 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&#39;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 - here&#39;s the reduced version.

!Type:Cat
NBonus
I
^
NCapital gains
I
^
NChild Benefit
I
^
NDiv Income
I
^

The problem lies in MyMoneyQifReader::processCategoryEntry.

An &quot;!extractLine(&#39;I&#39;).isEmpty()&quot; (or &#39;E&#39;) test is performed.  If, as is likely, the line 
contains only the &#39;I&#39; or &#39;E&#39;, the test will return empty and no accounts get set up.

The test needs to confirm if either line is detected, empty or otherwise, and set up accordingly.
</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Tested with the same files which previously failed, and they now import correctly.</pre>
  </td>
 </tr>
</table>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="https://bugs.kde.org/show_bug.cgi?id=274598">274598</a>


</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>/trunk/extragear/office/kmymoney/kmymoney/converter/mymoneyqifreader.cpp <span style="color: grey">(1234356)</span></li>

</ul>

<p><a href="http://svn.reviewboard.kde.org/r/6694/diff/" style="margin-left: 3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>