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











<div>



<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="https://git.reviewboard.kde.org/r/130143/diff/1/?file=496041#file496041line416" style="color: black; font-weight: bold; text-decoration: underline;">kmymoney/converter/mymoneytemplate.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

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



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">416</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">      <span class="n">flag</span><span class="p">.</span><span class="n">setAttribute</span><span class="p">(</span><span class="n">QString</span><span class="p">(</span><span class="s">"value"</span><span class="p">),</span> <span class="s">"1"</span><span class="p">);</span></pre></td>
  </tr>

 </tbody>

</table>

 <div style="margin-left: 2em;">

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I agree with Christian here. The flag is either present in the template or not. That should be sufficient. Plus, I don't see a usage of the attribute 'value' in this patch at all. So, from MPOV, the 'value' attribute can be removed.</p></pre>
 </div>
</div>
<br />

<div>



<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="https://git.reviewboard.kde.org/r/130143/diff/1/?file=496042#file496042line222" style="color: black; font-weight: bold; text-decoration: underline;">kmymoney/dialogs/knewaccountdlg.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

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



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">222</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">  <span class="k">if</span> <span class="p">(</span><span class="n">account</span><span class="p">.</span><span class="n">accountType</span><span class="p">()</span> <span class="o">==</span> <span class="n">MyMoneyAccount</span><span class="o">::</span><span class="n">Equity</span><span class="p">)</span> <span class="p">{</span></pre></td>
  </tr>

 </tbody>

</table>

 <div style="margin-left: 2em;">

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">You could write </p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;"><div class="codehilite" style="background: #f8f8f8"><pre style="line-height: 125%"><span></span>m_qcheckboxOpeningBalance->setEnabled(false);
m_qcheckboxOpeningBalance->setToolTip(i18n("Reason"));
</pre></div>
</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">here infront of the if() statement and only enable it inside in case no other opening balance account was found. In case the reason differs (transactions found), update the tooltip reason. Also update the tooltip contents in case one can mark the account as opening balance account with text which explains what this is good for (which I expected to find in the ui file but did not).</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">This code layout saves you the multiple else paths at the end.</p></pre>
 </div>
</div>
<br />

<div>



<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="https://git.reviewboard.kde.org/r/130143/diff/1/?file=496042#file496042line239" style="color: black; font-weight: bold; text-decoration: underline;">kmymoney/dialogs/knewaccountdlg.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

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



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">239</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="c1">// let only allow state change if no transactions are assigned to this account</span></pre></td>
  </tr>

 </tbody>

</table>

 <div style="margin-left: 2em;">

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Agreed, it might be not so wise to hide the widget in case the account cannot be made an opening balance account.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">I just verified that the tooltip is also shown when a widget is disabled. So showing a descriptive text in the tooltip whenever the widget is disabled is a good idea.</p></pre>
 </div>
</div>
<br />

<div>



<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="https://git.reviewboard.kde.org/r/130143/diff/1/?file=496042#file496042line240" style="color: black; font-weight: bold; text-decoration: underline;">kmymoney/dialogs/knewaccountdlg.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

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



 
 

 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">240</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="n">QList</span><span class="o"><</span><span class="n">QPair</span><span class="o"><</span><span class="n">MyMoneyTransaction</span><span class="p">,</span> <span class="n">MyMoneySplit</span><span class="o">></span> <span class="o">></span> <span class="n">transactionList</span><span class="p">;</span></pre></td>
  </tr>

 </tbody>

</table>

 <div style="margin-left: 2em;">

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">You could simplify this whole basic block into a single instruction with</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">m_qcheckboxOpeningBalance->setEnabled(MyMoneyFile::instance()->transactionCount(account.id()) == 0);</p></pre>
 </div>
</div>
<br />



<p>- Thomas Baumgart</p>


<br />
<p>On Mai 30th, 2017, 9:45 vorm. CEST, Ralf Habacker wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
 <tr>
  <td>

<div>Review request for KMymoney.</div>
<div>By Ralf Habacker.</div>


<p style="color: grey;"><i>Updated Mai 30, 2017, 9:45 vorm.</i></p>







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


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


</div>



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


<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;">This patch introduce a feature to specify a dedicated account
to be used as opening balance account instead of using an account
with a predefined name which may be language specific.

The "opening balance account" flag could be set in the account
editor if no other account contains this flag. Also changing
the state of the flag is only possible if no transactions are
assigned to the account having this flag.

On creating a new kmymoney file the "opening balance account"
flag is imported from a related template account flag if specified
in the following form

<account type="16" name="9000 Saldovortragskonten">
   <flag name="OpeningBalanceAccount" value="1"/>
</account>

If specified the template admin needs to make sure that only one
template account has this flag set.

Exporting the current kmymoney file to an account template exports
this flag too.

BUG:370290</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;"><ul style="padding: 0;text-rendering: inherit;margin: 0 0 0 1em;line-height: inherit;white-space: normal;">
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">compiled</li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">set/unset "opening balance account" flag in account editor for a given account and save/load kmymoney file -> state is persistent</li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">checked if it is possible to set "opening balance account" flag in an additional account -> check box is not visible on editing the second account</li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">checked if it is possible to change "opening balance account" flag if transactions are assigned to the opening balance account -> check box is disabled</li>
</ul>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Note: I choosed the flag name as to be 'OpeningBalanceAccount' in the template file and kmymoney file to have the same name.</p></pre>
  </td>
 </tr>
</table>


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

 <li>kmymoney/converter/mymoneytemplate.cpp <span style="color: grey">(25a343e3fbdd9409ebdbd814bc08122c151a09d9)</span></li>

 <li>kmymoney/dialogs/knewaccountdlg.cpp <span style="color: grey">(dfe2967174bf323d9eda4983fd545d0930a9ec43)</span></li>

 <li>kmymoney/dialogs/knewaccountdlgdecl.ui <span style="color: grey">(bee638d2b4f73bc8496c86bbf606bfaa5fa4c913)</span></li>

 <li>kmymoney/mymoney/mymoneyfile.cpp <span style="color: grey">(692014b21ec8bff4e4c3f3f240d377cd7b9697b3)</span></li>

 <li>kmymoney/mymoney/storage/mymoneystorageanon.cpp <span style="color: grey">(b6d0dc6a7b499aa45498cb76bef836731ff618d4)</span></li>

 <li>kmymoney/reports/objectinfotable.cpp <span style="color: grey">(584a9a378d37d51766e551d8e6b6baffe4fb397d)</span></li>

 <li>kmymoney/reports/reportstestcommon.h <span style="color: grey">(22000165dff793c5d7281072f702e0ca3c40f882)</span></li>

 <li>kmymoney/reports/reportstestcommon.cpp <span style="color: grey">(40b103ca965e0a1973b6fd0a351ddb976aa10471)</span></li>

</ul>

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






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







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