D13238: [tests] Add pointer constraints test

Vlad Zagorodniy noreply at phabricator.kde.org
Thu May 31 18:47:06 UTC 2018


zzag added a comment.


  Some nitpicks. :-)

INLINE COMMENTS

> pointerconstraints.cpp:50
> +
> +void WaylandBackend::init(MainWindow *window) {
> +    Backend::init(window);

Coding style nitpick: put `{` on a new line.

> pointerconstraints.cpp:169
> +
> +    auto *confinedPointer = m_pointerConstraints->confinePointer(winSurface.data(),
> +                                                                 m_pointer,

IMHO, that's not the best case to use auto.

> pointerconstraints.cpp:175
> +
> +    if (confinedPointer) {
> +        m_confinedPointer = confinedPointer;

What about

  if (!confinedPointer) {
      qDebug() << "ERROR when receiving confined pointer!";
      return;
  }
  
  // ...

?

> pointerconstraints.cpp:324
> +        return QRect();
> +    } else {
> +        return QRect(m_testAreaInInput->mapTo(this, QPoint(0,0)), m_testAreaInInput->size());

Coding style nitpick: no else after return.

> pointerconstraints.cpp:402
> +
> +#include "pointerconstraints.moc"

Is there a reason why the moc file is included?

REPOSITORY
  R127 KWayland

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

To: romangg, #plasma, #frameworks
Cc: zzag, kde-frameworks-devel, ragreen, Pitel, schernikov, michaelh, ZrenBot, ngraham, bruns, alexeymin, lesliezhai, ali-mohamed, jensreuterberg, abetts, eliasp, sebas, apol, mart, hein
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180531/706fb7ee/attachment.html>


More information about the Kde-frameworks-devel mailing list