<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://git.reviewboard.kde.org/r/106846/">http://git.reviewboard.kde.org/r/106846/</a>
     </td>
    </tr>
   </table>
   <br />








<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On October 22nd, 2012, 6:13 a.m., <b>Thomas Baumgart</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://git.reviewboard.kde.org/r/106846/diff/5/?file=91718#file91718line85" style="color: black; font-weight: bold; text-decoration: underline;">kmymoney/mymoney/mymoneytag.h</a>
    <span style="font-weight: normal;">

     (Diff revision 5)

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

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

   <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
   <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">public:</pre></td>

  </tr>
 </tbody>




 
 



 <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">85</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">  <span class="n">QString</span> <span class="n">name</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span> <span class="k">const</span>            <span class="p">{</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;">Use 'const <type>&' when returning direct members of complex types such as QString, QDate, QColor. It improves performance.</pre>
 </blockquote>



 <p>On October 22nd, 2012, 9:15 p.m., <b>Alessandro Russo</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;">I did the changes but If I put const QColor& tagColor(void) I get this error:
mymoney/storage/mymoneystoragesql.cpp:2952:56: error: passing ‘const QColor’ as ‘this’ argument of ‘void QColor::setNamedColor(const QString&)’ discards qualifiers [-fpermissive]

The row is:
tag.tagColor().setNamedColor(GETSTRING(tagColorCol));</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;">What about tag.setTagColor(QColor(GETSTRING(tagColorCol)); ? 

The code you have does not do what you think it does anyway... What you have returns a copy of the QColor member, then trashes it when scope is exited. The member variable in MMTag is never touched. 

For const-correctness, all non-basic return values in accessor functions should be const. On this project we make it a const-reference for efficiency, but we have to be careful about initializing a const-reference with a return value that gets destroyed while there is still a reference to it. QObjects help with that quite a bit.

You are already using the mutator functions you coded for the rest of the MMTag object you have, so this will just make it look like the rest.</pre>
<br />




<p>- Fernando</p>


<br />
<p>On October 21st, 2012, 10:52 p.m., Alessandro Russo wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.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 Alessandro Russo.</div>


<p style="color: grey;"><i>Updated Oct. 21, 2012, 10:52 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;">1) I created and almost completed the Tag tab in KMyMoneyView (KTagsView),
it's similar to the payees tab.
2) I modified many classes in the storage folder and created a new class
MyMoneyTag similar to MyMoneyPayee, now Tags save and load correctly but not
all tag attribute (visibibleFrom,etc..) are saved/loaded yet.
3) I changed transactioneditor, transaction and KGlobalLedgerView, now there
is a new widget called Tags in the translationeditor that someway works but
no tags are shown in the ledger yet and no widget is showed when you insert
or edit a transaction directly from the ledger (is this a feature that
somebody uses?).
4) Missing features:
  - multi tags per transaction (only 1 tag can be added at this time)
  - no tag selection in reports
  - hierarchical tags (I'm rethinking about the real usefulness of this
one... as implementing it will require some work  )
  - in the tag tab you can select a color for the tag, this will be used to
show the tag in the ledger with this  color, also no visibility check is
made.
  - no tags in a split
 Bugs:
  - in the tag tab if you select a tag and click on the 'New tag' button the
selected tag wil be deleted and replaced with an empy "NewTag"
  - in the transaction editor when you edit a transaction with a tag the tag
field is empty, when not in edit mode it show the tag name correctly.
  - many more... </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="http://bugs.kde.org/show_bug.cgi?id=207761">207761</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>kmymoney/dialogs/CMakeLists.txt <span style="color: grey">(9a8d782)</span></li>

 <li>kmymoney/dialogs/kfindtransactiondlg.h <span style="color: grey">(397d623)</span></li>

 <li>kmymoney/dialogs/kfindtransactiondlg.cpp <span style="color: grey">(506d752)</span></li>

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

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

 <li>kmymoney/dialogs/ktagreassigndlg.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>kmymoney/dialogs/ktagreassigndlg.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>kmymoney/dialogs/ktagreassigndlgdecl.ui <span style="color: grey">(PRE-CREATION)</span></li>

 <li>kmymoney/dialogs/transactioneditor.h <span style="color: grey">(2535d96)</span></li>

 <li>kmymoney/dialogs/transactioneditor.cpp <span style="color: grey">(06c7fd1)</span></li>

 <li>kmymoney/kmymoney.h <span style="color: grey">(9482812)</span></li>

 <li>kmymoney/kmymoney.cpp <span style="color: grey">(1ef7400)</span></li>

 <li>kmymoney/kmymoney.kcfg <span style="color: grey">(95e33df)</span></li>

 <li>kmymoney/kmymoneyui.rc <span style="color: grey">(4294c46)</span></li>

 <li>kmymoney/mymoney/CMakeLists.txt <span style="color: grey">(d2917b5)</span></li>

 <li>kmymoney/mymoney/mymoneyfile.h <span style="color: grey">(6c1aa25)</span></li>

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

 <li>kmymoney/mymoney/mymoneyobjectcontainer.h <span style="color: grey">(21cd74c)</span></li>

 <li>kmymoney/mymoney/mymoneyobjectcontainer.cpp <span style="color: grey">(2e9c496)</span></li>

 <li>kmymoney/mymoney/mymoneyreport.h <span style="color: grey">(7747353)</span></li>

 <li>kmymoney/mymoney/mymoneyreport.cpp <span style="color: grey">(24d75d8)</span></li>

 <li>kmymoney/mymoney/mymoneysplit.h <span style="color: grey">(ded6b4c)</span></li>

 <li>kmymoney/mymoney/mymoneysplit.cpp <span style="color: grey">(168d1e6)</span></li>

 <li>kmymoney/mymoney/mymoneytag.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>kmymoney/mymoney/mymoneytag.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>kmymoney/mymoney/mymoneytransactionfilter.h <span style="color: grey">(2a7b85d)</span></li>

 <li>kmymoney/mymoney/mymoneytransactionfilter.cpp <span style="color: grey">(6650fef)</span></li>

 <li>kmymoney/mymoney/storage/CMakeLists.txt <span style="color: grey">(0495726)</span></li>

 <li>kmymoney/mymoney/storage/imymoneyserialize.h <span style="color: grey">(ff49986)</span></li>

 <li>kmymoney/mymoney/storage/imymoneystorage.h <span style="color: grey">(8b980b7)</span></li>

 <li>kmymoney/mymoney/storage/mymoneydatabasemgr.h <span style="color: grey">(ab587ed)</span></li>

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

 <li>kmymoney/mymoney/storage/mymoneydbdef.h <span style="color: grey">(a2eecaf)</span></li>

 <li>kmymoney/mymoney/storage/mymoneydbdef.cpp <span style="color: grey">(9fa9781)</span></li>

 <li>kmymoney/mymoney/storage/mymoneyseqaccessmgr.h <span style="color: grey">(da67e58)</span></li>

 <li>kmymoney/mymoney/storage/mymoneyseqaccessmgr.cpp <span style="color: grey">(232d6b2)</span></li>

 <li>kmymoney/mymoney/storage/mymoneystorageanon.h <span style="color: grey">(482fc9d)</span></li>

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

 <li>kmymoney/mymoney/storage/mymoneystoragebin.h <span style="color: grey">(af2b254)</span></li>

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

 <li>kmymoney/mymoney/storage/mymoneystoragesql.h <span style="color: grey">(73875b3)</span></li>

 <li>kmymoney/mymoney/storage/mymoneystoragesql.cpp <span style="color: grey">(90ee818)</span></li>

 <li>kmymoney/mymoney/storage/mymoneystoragexml.h <span style="color: grey">(126cf8c)</span></li>

 <li>kmymoney/mymoney/storage/mymoneystoragexml.cpp <span style="color: grey">(88a02df)</span></li>

 <li>kmymoney/reports/listtable.cpp <span style="color: grey">(d163f58)</span></li>

 <li>kmymoney/reports/querytable.cpp <span style="color: grey">(697f425)</span></li>

 <li>kmymoney/views/CMakeLists.txt <span style="color: grey">(de0272f)</span></li>

 <li>kmymoney/views/kgloballedgerview.cpp <span style="color: grey">(dfaecbd)</span></li>

 <li>kmymoney/views/kmymoneyview.h <span style="color: grey">(99ab398)</span></li>

 <li>kmymoney/views/kmymoneyview.cpp <span style="color: grey">(49dcc85)</span></li>

 <li>kmymoney/views/ktagsview.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>kmymoney/views/ktagsview.cpp <span style="color: grey">(PRE-CREATION)</span></li>

 <li>kmymoney/views/ktagsviewdecl.ui <span style="color: grey">(PRE-CREATION)</span></li>

 <li>kmymoney/widgets/kmymoney.widgets <span style="color: grey">(857e42c)</span></li>

 <li>kmymoney/widgets/kmymoneymvccombo.h <span style="color: grey">(305e8a1)</span></li>

 <li>kmymoney/widgets/kmymoneymvccombo.cpp <span style="color: grey">(42a3687)</span></li>

 <li>kmymoney/widgets/kmymoneyreportconfigtab3decl.ui <span style="color: grey">(ab150ee)</span></li>

 <li>kmymoney/widgets/transaction.h <span style="color: grey">(a28053e)</span></li>

 <li>kmymoney/widgets/transaction.cpp <span style="color: grey">(bfaafbf)</span></li>

</ul>

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




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








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