D17898: Cast to AbstractClient instead of Client in Toplevel::setReadyForPainting

Martin Flöser <[email protected]>
Newsgroups gmane.comp.kde.devel.kwin
Message-ID <[email protected]>
graesslin added a comment.


  In D17898#384616 <https://phabricator.kde.org/D17898#384616>, @zzag wrote:
  
  > Off-topic: what should we prefer
  >
  >   auto foo = qobject_cast<Foo*>(bar);
  >
  >
  > or
  >
  >   auto foo = qobject_cast<Foo *>(bar);
  >
  >
  > ?
  
  
  I tend to prefer the latter case with whitespace. But our code is so messed up in that area that I think both is fine. A little bit on KWin coding style history. KWin used to have it's own coding style, the Lubos style. You can still find it for example in ksmserver, which was also maintained by Lubos. The coding style was fine, the only problem was that nobody really understood it and Lubos didn't demand it to be correct. So the code was everything but not consistent. When I became maintainer I reformatted the code with astyle to follow kdelibs style. The conversion with such rules is not perfect, e.g. such cases are not covered. Nowadays tooling might be better. I could imagine that something clang based would be able to cover such cases. So in case such a tool exists I would be all for reformat once again.

INLINE COMMENTS

> zzag wrote in toplevel.cpp:265
> While we're on this, would it be feasible to use qobject_cast instead?

Is there any real advantage of qobject_cast?

REPOSITORY
  R108 KWin

BRANCH
  ready-for-painting-cast

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

To: graesslin, #kwin, zzag
Cc: zzag, kwin, GB_2, mkulinski, ragreen, jackyalcine, Pitel, iodelay, bwowk, ZrenBot, ngraham, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, 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.