[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-telepathy
Subject:    Re: Review Request 108598: Create the new types enum - Important please review !
From:       "David Edmundson" <david () davidedmundson ! co ! uk>
Date:       2013-01-30 0:24:09
Message-ID: 20130130002409.1745.21851 () vidsolbach ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


> On Jan. 29, 2013, 6:06 p.m., David Edmundson wrote:
> > KTp/types.h, line 74
> > <http://git.reviewboard.kde.org/r/108598/diff/1/?file=109299#file109299line74>
> > 
> > I've just realised this was a really stupid idea.
> > 
> > The logic was - when subclassing/proxying you can add roles at the right point.
> > 
> > This makes no sense from an ABI POV, as when we add a role value this will change \
> > and the client code will break unless it recompiled. 
> > Will remove
> 
> Dan Vrátil wrote:
> You didn't have to remove it. You could just move the CustomContactRole to reserve \
> numerical values for additional contact roles: 
> ...
> ContactTubesRole, // (this is something like Qt::UserRole + 2015)
> CustomContactRole = Qt::UserRole + 3000,
> 
> //heading roles
> HeaderTotalUsersRole = Qt::UserRole  + 4000,
> ...
> 
> 
> If we would want to add a new contact role (say ContactGoneMadRole), it would be \
> appended at the end of enum: 
> CustomRole = Qt::UserRole + 5000,
> 
> ContactGoneMagRole = ContactTubesRole + 1
> };
> 
> This would ensure numerical continuity of contact roles while preserving ABI.
> 
> http://techbase.kde.org/Policies/Binary_Compatibility_Issues_With_C++#The_Do.27s_and_Don.27ts
>  

but does having the CustomContactRole actually add anything over just using the one \
CustomRole?


- David


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/108598/#review26374
-----------------------------------------------------------


On Jan. 29, 2013, 6:13 p.m., David Edmundson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/108598/
> -----------------------------------------------------------
> 
> (Updated Jan. 29, 2013, 6:13 p.m.)
> 
> 
> Review request for Telepathy.
> 
> 
> Description
> -------
> 
> Create the new types enum.
> 
> This is really important. Please please review. 
> Give a "ship it!" if you're happy with the enum. I will only push into the \
> model_refactor_3 branch. 
> Obviously this won't compile, I want to make sure people are happy with this \
> _before_ we start changing all the other code. We can add roles later, but I don't \
> want to be editing or deleting them.  
> I'm also not sure whether I should namespace the enum so we don't have roles at the \
> top level of the KTp namespace?  (i.e namespace KTp { namespace ContactModelRoles { \
> enum ModelRoles{ .....  ) ? Thoughts? 
> (what's not shown in the diff is that I've also deleted/merged the ktp-metatypes.h \
> file) 
> 
> Diffs
> -----
> 
> KTp/Models/CMakeLists.txt a95e0c19c816f0cb8a465614fa7e1adecb6d58d1 
> KTp/Models/accounts-filter-model.h 0733e147bb0a46f20d391228f97f872b2fbe11f0 
> KTp/Models/accounts-model-item.h 54012029bf21a58dbf5a2b0bfa26cde766d00cbc 
> KTp/Models/accounts-model-item.cpp 67e66265c680211573309625934403373d4025b5 
> KTp/Models/contact-model-item.h b8447a5fec4166096172f51ef997ebf81022cb0d 
> KTp/Models/contact-model-item.cpp e4fa8d973b7a30b303416613eafeb3d344f0ccd0 
> KTp/Models/contacts-model.h 2a9cf44736e6e3aea5f92eb09e6840314ba94247 
> KTp/Models/contacts-model.cpp 5eb37b1755d3b69961fbed4131ab470c252a29ba 
> KTp/Models/flat-model-proxy.h 088df7a0aa911ddbf0d34e6ea3f88d4b5c167c4a 
> KTp/Models/flat-model-proxy.cpp ef39f3ec91d6a5f49fa8612fd667eb5ce94ff993 
> KTp/Models/groups-model-item.h 19365d5e1376d2d29ab73ce1c10866a7d83bb56d 
> KTp/Models/groups-model-item.cpp 191e59b3c79d06e05f4efd8a29fc8341519574b5 
> KTp/Models/groups-model.h a0707660e3ebef030d6ba9b46d74f785d7a8727e 
> KTp/Models/groups-model.cpp b0010dc5699241b726f8d73fd1ad3eed906aceed 
> KTp/Models/proxy-tree-node.h 598bcd5578fe8be45a8590641cfd019759c0d76c 
> KTp/Models/proxy-tree-node.cpp 175bf1466cfaa3a98055e0befc7707c7520a8d5b 
> KTp/Models/tree-node.h 0d13255d48760df589eb9a4a1e3ae9f5274ead99 
> KTp/Models/tree-node.cpp f9413ceae41bc2da9582acf82c20ab8c25d86cf6 
> KTp/ktp-metatypes.h 9488ee5cbe059d831466b1a1115e2ff359457bac 
> KTp/types.h PRE-CREATION 
> 
> Diff: http://git.reviewboard.kde.org/r/108598/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> David Edmundson
> 
> 


[Attachment #5 (text/html)]

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










<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On January 29th, 2013, 6:06 p.m. UTC, <b>David \
Edmundson</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/108598/diff/1/?file=109299#file109299line74" \
style="color: black; font-weight: bold; text-decoration: underline;">KTp/types.h</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">74</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span \
class="n">CustomContactRole</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;">I&#39;ve just realised \
this was a really stupid idea.

The logic was - when subclassing/proxying you can add roles at the right point.

This makes no sense from an ABI POV, as when we add a role value this will change and \
the client code will break unless it recompiled.

Will remove</pre>
 </blockquote>



 <p>On January 29th, 2013, 7:01 p.m. UTC, <b>Dan Vrátil</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;">You didn&#39;t have to \
remove it. You could just move the CustomContactRole to reserve numerical values for \
additional contact roles:

...
ContactTubesRole, // (this is something like Qt::UserRole + 2015)
CustomContactRole = Qt::UserRole + 3000,

//heading roles
HeaderTotalUsersRole = Qt::UserRole  + 4000,
...


If we would want to add a new contact role (say ContactGoneMadRole), it would be \
appended at the end of enum:

CustomRole = Qt::UserRole + 5000,

ContactGoneMagRole = ContactTubesRole + 1
};

This would ensure numerical continuity of contact roles while preserving ABI.

http://techbase.kde.org/Policies/Binary_Compatibility_Issues_With_C++#The_Do.27s_and_Don.27ts
 </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;">but does \
having the CustomContactRole actually add anything over just using the one \
CustomRole?</pre> <br />




<p>- David</p>


<br />
<p>On January 29th, 2013, 6:13 p.m. UTC, David Edmundson wrote:</p>






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

<div>Review request for Telepathy.</div>
<div>By David Edmundson.</div>


<p style="color: grey;"><i>Updated Jan. 29, 2013, 6:13 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;">Create the new types enum.

This is really important. Please please review. 
Give a &quot;ship it!&quot; if you&#39;re happy with the enum. I will only push into \
the model_refactor_3 branch.

Obviously this won&#39;t compile, I want to make sure people are happy with this \
_before_ we start changing all the other code. We can add roles later, but I \
don&#39;t want to be editing or deleting them. 

I&#39;m also not sure whether I should namespace the enum so we don&#39;t have roles \
at the top level of the KTp namespace?  (i.e namespace KTp { namespace \
ContactModelRoles { enum ModelRoles{ .....  ) ? Thoughts?

(what&#39;s not shown in the diff is that I&#39;ve also deleted/merged the \
ktp-metatypes.h file)</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>KTp/Models/CMakeLists.txt <span style="color: \
grey">(a95e0c19c816f0cb8a465614fa7e1adecb6d58d1)</span></li>

 <li>KTp/Models/accounts-filter-model.h <span style="color: \
grey">(0733e147bb0a46f20d391228f97f872b2fbe11f0)</span></li>

 <li>KTp/Models/accounts-model-item.h <span style="color: \
grey">(54012029bf21a58dbf5a2b0bfa26cde766d00cbc)</span></li>

 <li>KTp/Models/accounts-model-item.cpp <span style="color: \
grey">(67e66265c680211573309625934403373d4025b5)</span></li>

 <li>KTp/Models/contact-model-item.h <span style="color: \
grey">(b8447a5fec4166096172f51ef997ebf81022cb0d)</span></li>

 <li>KTp/Models/contact-model-item.cpp <span style="color: \
grey">(e4fa8d973b7a30b303416613eafeb3d344f0ccd0)</span></li>

 <li>KTp/Models/contacts-model.h <span style="color: \
grey">(2a9cf44736e6e3aea5f92eb09e6840314ba94247)</span></li>

 <li>KTp/Models/contacts-model.cpp <span style="color: \
grey">(5eb37b1755d3b69961fbed4131ab470c252a29ba)</span></li>

 <li>KTp/Models/flat-model-proxy.h <span style="color: \
grey">(088df7a0aa911ddbf0d34e6ea3f88d4b5c167c4a)</span></li>

 <li>KTp/Models/flat-model-proxy.cpp <span style="color: \
grey">(ef39f3ec91d6a5f49fa8612fd667eb5ce94ff993)</span></li>

 <li>KTp/Models/groups-model-item.h <span style="color: \
grey">(19365d5e1376d2d29ab73ce1c10866a7d83bb56d)</span></li>

 <li>KTp/Models/groups-model-item.cpp <span style="color: \
grey">(191e59b3c79d06e05f4efd8a29fc8341519574b5)</span></li>

 <li>KTp/Models/groups-model.h <span style="color: \
grey">(a0707660e3ebef030d6ba9b46d74f785d7a8727e)</span></li>

 <li>KTp/Models/groups-model.cpp <span style="color: \
grey">(b0010dc5699241b726f8d73fd1ad3eed906aceed)</span></li>

 <li>KTp/Models/proxy-tree-node.h <span style="color: \
grey">(598bcd5578fe8be45a8590641cfd019759c0d76c)</span></li>

 <li>KTp/Models/proxy-tree-node.cpp <span style="color: \
grey">(175bf1466cfaa3a98055e0befc7707c7520a8d5b)</span></li>

 <li>KTp/Models/tree-node.h <span style="color: \
grey">(0d13255d48760df589eb9a4a1e3ae9f5274ead99)</span></li>

 <li>KTp/Models/tree-node.cpp <span style="color: \
grey">(f9413ceae41bc2da9582acf82c20ab8c25d86cf6)</span></li>

 <li>KTp/ktp-metatypes.h <span style="color: \
grey">(9488ee5cbe059d831466b1a1115e2ff359457bac)</span></li>

 <li>KTp/types.h <span style="color: grey">(PRE-CREATION)</span></li>

</ul>

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







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








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



_______________________________________________
KDE-Telepathy mailing list
KDE-Telepathy@kde.org
https://mail.kde.org/mailman/listinfo/kde-telepathy


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic