Review Request 108598: Create the new types enum - Important please review !

David Edmundson david at davidedmundson.co.uk
Wed Jan 30 00:24:09 UTC 2013



> 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
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-telepathy/attachments/20130130/4822d8c1/attachment.html>


More information about the KDE-Telepathy mailing list