D27060: Introduce coding-conventions.md

David Edmundson <[email protected]>
Newsgroups gmane.comp.kde.devel.kwin
Message-ID <[email protected]>
davidedmundson accepted this revision.
davidedmundson added a comment.
This revision is now accepted and ready to land.


  ++
  
  You know my thoughts on per project rules. 
  But maybe it is different for kwin. Use of setRight() is the easier call than left+width() if you are actually using it for painting and need to think about the 1px the other way round.
  
  But would here work? https://community.kde.org/Policies/API_to_Avoid#API_that_is_considered_broken  
  if we added a line about "for anything other than painting"

INLINE COMMENTS

> coding-conventions.md:38
> +Exception 1: you can use `QRect::moveRight()` and `QRect::moveBottom()` to snap a rectangle to
> +another rectangle as long as the corresponding borders match, for example
> +

please say another QRect instead of rectangle.

QRectF source;
QRect target;

target.setRight(source.right());

is problematic

REPOSITORY
  R108 KWin

BRANCH
  coding-conventions

REVISION DETAIL
  https://phabricator.kde.org/D27060

To: zzag, #kwin, davidedmundson
Cc: davidedmundson, kwin, Orage, LeGast00n, The-Feren-OS-Dev, jraleigh, zachus, fbampaloukas, GB_2, mkulinski, ragreen, jackyalcine, iodelay, crozbo, bwowk, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, hardening, romangg, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.