D23917: Use const_iterator

2019-09-14 Thread Frederik Gladhorn
This revision was automatically updated to reflect the committed changes.
Closed by commit R127:28841048d555: Use const_iterator (authored by gladhorn).

REPOSITORY
  R127 KWayland

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D23917?vs=66021=66027

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

AFFECTED FILES
  src/client/plasmawindowmanagement.cpp
  src/client/registry.cpp
  src/server/keyboard_interface.cpp
  src/server/output_interface.cpp
  src/server/outputdevice_interface.cpp
  src/server/seat_interface.cpp
  tests/pasteclient.cpp

To: gladhorn, #kwin, zzag
Cc: kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns


D23917: Use const_iterator

2019-09-14 Thread Vlad Zahorodnii
zzag accepted this revision.
This revision is now accepted and ready to land.

REPOSITORY
  R127 KWayland

BRANCH
  master

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

To: gladhorn, #kwin, zzag
Cc: kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns


D23917: Use const_iterator

2019-09-14 Thread Frederik Gladhorn
gladhorn updated this revision to Diff 66021.
gladhorn edited the summary of this revision.
gladhorn removed subscribers: broulik, zzag.
gladhorn added a comment.


  Fixed two missing spots

REPOSITORY
  R127 KWayland

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D23917?vs=65946=66021

BRANCH
  master

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

AFFECTED FILES
  src/client/plasmawindowmanagement.cpp
  src/client/registry.cpp
  src/server/keyboard_interface.cpp
  src/server/output_interface.cpp
  src/server/outputdevice_interface.cpp
  src/server/seat_interface.cpp
  tests/pasteclient.cpp

To: gladhorn, #kwin
Cc: kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns, broulik, 
zzag


D23917: Use const_iterator

2019-09-14 Thread Frederik Gladhorn
gladhorn added a comment.


  Yes, for me always using constBegin/constEnd makes reading the code slightly 
easier.

INLINE COMMENTS

> zzag wrote in registry.cpp:879
> constEnd

Thanks!

> zzag wrote in output_interface.cpp:119
> constEnd

Thanks!

REPOSITORY
  R127 KWayland

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

To: gladhorn, #kwin
Cc: broulik, zzag, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, 
bruns


D23917: Use const_iterator

2019-09-12 Thread Vlad Zahorodnii
zzag added a comment.


  In D23917#530297 , @broulik wrote:
  
  > If the container is `const` already there's no real reason to explicitly 
use `constBegin` which is effectively the same
  
  
  Yes, however it's still a good idea to be explicit about it.

REPOSITORY
  R127 KWayland

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

To: gladhorn, #kwin
Cc: broulik, zzag, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, 
bruns


D23917: Use const_iterator

2019-09-12 Thread Kai Uwe Broulik
broulik added a comment.


  If the container is `const` already there's no real reason to explicitly use 
`constBegin` which is effectively the same

REPOSITORY
  R127 KWayland

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

To: gladhorn, #kwin
Cc: broulik, zzag, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, 
bruns


D23917: Use const_iterator

2019-09-12 Thread Vlad Zahorodnii
zzag added inline comments.

INLINE COMMENTS

> registry.cpp:879
>  });
>  if (it == m_interfaces.end()) {
>  qCDebug(KWAYLAND_CLIENT) << "Don't have interface " << 
> int(interface) << "with name " << name << "and minimum version" << version;

constEnd

REPOSITORY
  R127 KWayland

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

To: gladhorn, #kwin
Cc: zzag, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns


D23917: Use const_iterator

2019-09-12 Thread Vlad Zahorodnii
zzag added inline comments.

INLINE COMMENTS

> output_interface.cpp:119
> +auto rit = std::find_if(resources.constBegin(), 
> resources.constEnd(), [native] (const ResourceData ) { return 
> data.resource == native; });
>  if (rit != resources.end()) {
>  return (*it);

constEnd

REPOSITORY
  R127 KWayland

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

To: gladhorn, #kwin
Cc: zzag, kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns


D23917: Use const_iterator

2019-09-12 Thread Frederik Gladhorn
gladhorn updated this revision to Diff 65946.
gladhorn added a comment.


  fixup

REPOSITORY
  R127 KWayland

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D23917?vs=65945=65946

BRANCH
  master

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

AFFECTED FILES
  src/client/plasmawindowmanagement.cpp
  src/client/registry.cpp
  src/server/keyboard_interface.cpp
  src/server/output_interface.cpp
  src/server/outputdevice_interface.cpp
  src/server/seat_interface.cpp
  tests/pasteclient.cpp

To: gladhorn, #kwin
Cc: kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns


D23917: Use const_iterator

2019-09-12 Thread Frederik Gladhorn
gladhorn created this revision.
gladhorn added a reviewer: KWin.
Herald added a project: Frameworks.
Herald added a subscriber: kde-frameworks-devel.
gladhorn requested review of this revision.

REVISION SUMMARY
  When trivial, replace iterators with the const versrion.

REPOSITORY
  R127 KWayland

BRANCH
  master

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

AFFECTED FILES
  src/client/plasmawindowmanagement.cpp
  src/client/registry.cpp
  src/server/keyboard_interface.cpp
  src/server/output_interface.cpp
  src/server/outputdevice_interface.cpp
  src/server/seat_interface.cpp
  tests/pasteclient.cpp

To: gladhorn, #kwin
Cc: kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns