autotests: Make idle-inhibitor-v1 factory function return a std::unique_ptr

wilder/Plasma/6.2
Vlad Zahorodnii 2 years ago
parent 2922b8d0a7
commit a887b737ef
  1. 2
      autotests/integration/kwin_wayland_test.h
  2. 4
      autotests/integration/test_helpers.cpp

@ -710,7 +710,7 @@ std::unique_ptr<XdgPopup> createXdgPopupSurface(KWayland::Client::Surface *surfa
CreationSetup configureMode = CreationSetup::CreateAndConfigure);
std::unique_ptr<XdgToplevelDecorationV1> createXdgToplevelDecorationV1(XdgToplevel *toplevel);
IdleInhibitorV1 *createIdleInhibitorV1(KWayland::Client::Surface *surface);
std::unique_ptr<IdleInhibitorV1> createIdleInhibitorV1(KWayland::Client::Surface *surface);
AutoHideScreenEdgeV1 *createAutoHideScreenEdgeV1(KWayland::Client::Surface *surface, uint32_t border);
CursorShapeDeviceV1 *createCursorShapeDeviceV1(KWayland::Client::Pointer *pointer);

@ -1047,7 +1047,7 @@ std::unique_ptr<XdgToplevelDecorationV1> createXdgToplevelDecorationV1(XdgToplev
return std::make_unique<XdgToplevelDecorationV1>(manager, toplevel);
}
IdleInhibitorV1 *createIdleInhibitorV1(KWayland::Client::Surface *surface)
std::unique_ptr<IdleInhibitorV1> createIdleInhibitorV1(KWayland::Client::Surface *surface)
{
IdleInhibitManagerV1 *manager = s_waylandConnection.idleInhibitManagerV1;
if (!manager) {
@ -1055,7 +1055,7 @@ IdleInhibitorV1 *createIdleInhibitorV1(KWayland::Client::Surface *surface)
return nullptr;
}
return new IdleInhibitorV1(manager, surface);
return std::make_unique<IdleInhibitorV1>(manager, surface);
}
AutoHideScreenEdgeV1 *createAutoHideScreenEdgeV1(KWayland::Client::Surface *surface, uint32_t border)

Loading…
Cancel
Save