<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/128743/">https://git.reviewboard.kde.org/r/128743/</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/128743/diff/3/?file=475263#file475263line290" style="color: black; font-weight: bold; text-decoration: underline;">src/addressee.h</a>
    <span style="font-weight: normal;">

     (Diff revision 3)

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



 
 

 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">289</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="kt">void</span> <span class="nf">setBirthday</span><span class="p">(</span><span class="k">const</span> <span class="n">QDateTime</span> <span class="o">&</span><span class="n">birthday</span><span class="p">);</span></pre></td>
    <th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">290</font></th>
    <td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span class="kt">void</span> <span class="nf">setBirthday</span><span class="p">(</span><span class="k">const</span> <span class="n">QDateTime</span> <span class="o">&</span><span class="n">birthday</span><span class="p"><span class="hl">,</span></span><span class="hl"> </span><span class="kt"><span class="hl">bool</span></span><span class="hl"> </span><span class="n"><span class="hl">withTime</span></span><span class="hl"> </span><span class="o"><span class="hl">=</span></span><span class="hl"> </span><span class="nb"><span class="hl">true</span></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;">What is the API/ABI policy for KContacts?
This is an ABI change, when it comes to upgrading libKF5AkonadiContact without recompiling all consumers of it.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Could this perhaps be done with an overload method
<code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">void setBirthday(const QDateTime &birthday, bool withTime);</code> instead (and a comment to merge both into one on the next ABI change occasion)?</p></pre>
 </div>
</div>
<br />



<p>- Friedrich W. H. Kossebau</p>


<br />
<p>On August 26th, 2016, 9:15 a.m. UTC, Benni Hill 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 KDEPIM-Libraries and Laurent Montel.</div>
<div>By Benni Hill.</div>


<p style="color: grey;"><i>Updated Aug. 26, 2016, 9:15 a.m.</i></p>









<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kcontacts
</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;"><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;">My aim was to implement a way to determine if there has been set a explicit time with the date of birth and that the time is only exported to a vcard if it has been explicitly specified. Some vcard implementations (e.g. on Android) ignore the birthday field if it comes with a time.
The problem here is that <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">QDateTime</code> (when set with a valid date) always has a valid time (midnight by default). I therefore added the boolean <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">withTime</code> to <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">setBirthday()</code> which is stored inside <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">Addressee</code> and can be queried with <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">birthdayHasTime()</code>. I also added <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">setBirthday
 (QDate)</code>.
I changed <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">VCardTool</code> to make use of this new methods when importing/exporting vcards.
Probably <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">KContacts::Field</code> and <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">KContacts::LDIFConverter</code> also should be adjusted.
To make use of this change in KAddressbook, (at least?) akonadi-contatcs has to be adjusted as well (in <code style="text-rendering: inherit;color: #4444cc;padding: 0;white-space: normal;margin: 0;line-height: inherit;">PersonalEditorWidget::storeContact()</code>):</li>
</ul>
<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 style="color: #A00000">--- a/src/editor/personaleditor/personaleditorwidget.cpp</span>
<span style="color: #00A000">+++ b/src/editor/personaleditor/personaleditorwidget.cpp</span>
<span style="color: #800080; font-weight: bold">@@ -83,12 +83,7 @@ void PersonalEditorWidget::loadContact(const KContacts::Addressee &contact)</span>
 void PersonalEditorWidget::storeContact(KContacts::Addressee &contact)
 {
     // dates group
<span style="color: #A00000">-    QDateTime birthday = QDateTime(mBirthdateWidget->date(), QTime(), contact.birthday().timeSpec());</span>
<span style="color: #A00000">-    // This is needed because the constructor above sets the time component</span>
<span style="color: #A00000">-    // of the QDateTime to midnight.  We want it to stay invalid.</span>
<span style="color: #A00000">-    birthday.setTime(QTime());</span>
<span style="color: #A00000">-</span>
<span style="color: #A00000">-    contact.setBirthday(birthday);</span>
<span style="color: #00A000">+    contact.setBirthday(mBirthdateWidget->date());</span>
     Akonadi::Utils::storeCustom(contact, QStringLiteral("X-Anniversary"), mAnniversaryWidget->date().toString(Qt::ISODate));

     // family group
</pre></div>
</p>
<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;">Unrelated to this changes I implemented a way in VCardTool to import/export dates without a year. Dates without a year ('--MMdd') are imported as year=-1 and during export, years <= 0 are written as '--'. (This also has to be implemented in the user inteface some where to make any use.)</li>
</ul></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;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Added autotests:</p>
<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;">Exporting birthdays without a time.</li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">Importing/Exporting dates without a year.</li>
</ul></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>CMakeLists.txt <span style="color: grey">(0b4786f)</span></li>

 <li>autotests/addresseetest.cpp <span style="color: grey">(156d642)</span></li>

 <li>autotests/birthdaytest.h <span style="color: grey">(6535c42)</span></li>

 <li>autotests/birthdaytest.cpp <span style="color: grey">(4c5313b)</span></li>

 <li>autotests/datetimetest.h <span style="color: grey">(329810e)</span></li>

 <li>autotests/datetimetest.cpp <span style="color: grey">(8517f00)</span></li>

 <li>autotests/ldifconvertertest.h <span style="color: grey">(da9220f)</span></li>

 <li>autotests/ldifconvertertest.cpp <span style="color: grey">(9d3971e)</span></li>

 <li>src/addressee.h <span style="color: grey">(4dc0dfd)</span></li>

 <li>src/addressee.cpp <span style="color: grey">(9f4dd2e)</span></li>

 <li>src/converter/ldifconverter.cpp <span style="color: grey">(d1fee94)</span></li>

 <li>src/field.cpp <span style="color: grey">(3406c9d)</span></li>

 <li>src/vcardtool.h <span style="color: grey">(48890ed)</span></li>

 <li>src/vcardtool.cpp <span style="color: grey">(aa5654d)</span></li>

</ul>

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






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







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