diff --git a/CMakeLists.txt b/CMakeLists.txt index 7c5c7547ba..adfae31111 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,7 @@ find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE) include(FeatureSummary) include(WriteBasicConfigVersionFile) include(GenerateExportHeader) +include(CheckCXXCompilerFlag) # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH}) @@ -441,6 +442,11 @@ include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/src/colors ) +check_cxx_compiler_flag(-Wno-unused-parameter COMPILER_UNUSED_PARAMETER_SUPPORTED) +if (COMPILER_UNUSED_PARAMETER_SUPPORTED) + add_compile_options(-Wno-unused-parameter) +endif() + if (KF5DocTools_FOUND) add_subdirectory(doc) endif() diff --git a/autotests/drm/mock_drm.cpp b/autotests/drm/mock_drm.cpp index 9b65720af9..56e0ec72e9 100644 --- a/autotests/drm/mock_drm.cpp +++ b/autotests/drm/mock_drm.cpp @@ -332,15 +332,12 @@ int drmGetCap(int fd, uint64_t capability, uint64_t *value) int drmHandleEvent(int fd, drmEventContextPtr evctx) { GPU(fd, -EINVAL); - // TODO ? - Q_UNUSED(evctx) return -(errno = ENOTSUP); } int drmIoctl(int fd, unsigned long request, void *arg) { GPU(fd, -EINVAL); - Q_UNUSED(arg); if (request == DRM_IOCTL_MODE_CREATE_DUMB) { auto args = static_cast(arg); auto dumb = std::make_shared(gpu, args->width, args->height, args->bpp); @@ -419,10 +416,6 @@ int drmModeAddFB(int fd, uint32_t width, uint32_t height, uint8_t depth, uint8_t bpp, uint32_t pitch, uint32_t bo_handle, uint32_t *buf_id) { - Q_UNUSED(depth) - Q_UNUSED(bpp) - Q_UNUSED(pitch) - Q_UNUSED(bo_handle) GPU(fd, EINVAL) auto fb = new MockFb(gpu, width, height); *buf_id = fb->id; @@ -434,11 +427,6 @@ int drmModeAddFB2(int fd, uint32_t width, uint32_t height, const uint32_t pitches[4], const uint32_t offsets[4], uint32_t *buf_id, uint32_t flags) { - Q_UNUSED(pixel_format) - Q_UNUSED(bo_handles) - Q_UNUSED(pitches) - Q_UNUSED(offsets) - Q_UNUSED(flags) GPU(fd, EINVAL) auto fb = new MockFb(gpu, width, height); *buf_id = fb->id; @@ -451,12 +439,6 @@ int drmModeAddFB2WithModifiers(int fd, uint32_t width, uint32_t height, const uint64_t modifier[4], uint32_t *buf_id, uint32_t flags) { - Q_UNUSED(pixel_format) - Q_UNUSED(bo_handles) - Q_UNUSED(pitches) - Q_UNUSED(offsets) - Q_UNUSED(modifier) - Q_UNUSED(flags) GPU(fd, EINVAL) if (!gpu->deviceCaps.contains(DRM_CAP_ADDFB2_MODIFIERS)) { return -(errno = ENOTSUP); @@ -605,13 +587,6 @@ int drmModeSetCursor(int fd, uint32_t crtcId, uint32_t bo_handle, uint32_t width int drmModeSetCursor2(int fd, uint32_t crtcId, uint32_t bo_handle, uint32_t width, uint32_t height, int32_t hot_x, int32_t hot_y) { GPU(fd, -EINVAL); - // TODO ? - Q_UNUSED(crtcId) - Q_UNUSED(bo_handle) - Q_UNUSED(width) - Q_UNUSED(height) - Q_UNUSED(hot_x) - Q_UNUSED(hot_y) return -(errno = ENOTSUP); } @@ -695,13 +670,6 @@ drmModeConnectorPtr drmModeGetConnectorCurrent(int fd, uint32_t connector_id) int drmModeCrtcSetGamma(int fd, uint32_t crtc_id, uint32_t size, uint16_t *red, uint16_t *green, uint16_t *blue) { - // TODO - Q_UNUSED(fd) - Q_UNUSED(crtc_id) - Q_UNUSED(size) - Q_UNUSED(red) - Q_UNUSED(green) - Q_UNUSED(blue) return -(errno = ENOTSUP); } @@ -1193,8 +1161,7 @@ int drmModeAtomicCommit(int fd, drmModeAtomicReqPtr req, uint32_t flags, void *u } if (flags & DRM_MODE_PAGE_FLIP_EVENT) { - // TODO - Q_UNUSED(user_data) + // Unsupported } } @@ -1230,34 +1197,21 @@ int drmModeDestroyPropertyBlob(int fd, uint32_t id) int drmModeCreateLease(int fd, const uint32_t *objects, int num_objects, int flags, uint32_t *lessee_id) { - // TODO? - Q_UNUSED(fd) - Q_UNUSED(objects) - Q_UNUSED(num_objects) - Q_UNUSED(flags) - Q_UNUSED(lessee_id) return -(errno = ENOTSUP); } drmModeLesseeListPtr drmModeListLessees(int fd) { - // TODO - Q_UNUSED(fd) return nullptr; } drmModeObjectListPtr drmModeGetLease(int fd) { - // TODO? - Q_UNUSED(fd) return nullptr; } int drmModeRevokeLease(int fd, uint32_t lessee_id) { - // TODO? - Q_UNUSED(fd) - Q_UNUSED(lessee_id) return -(errno = ENOTSUP); } diff --git a/autotests/integration/debug_console_test.cpp b/autotests/integration/debug_console_test.cpp index 1ebc29974b..765fe5b558 100644 --- a/autotests/integration/debug_console_test.cpp +++ b/autotests/integration/debug_console_test.cpp @@ -398,7 +398,6 @@ Q_SIGNALS: protected: void paintEvent(QPaintEvent *event) override { - Q_UNUSED(event) QPainter p(this); p.fillRect(0, 0, width(), height(), Qt::red); } diff --git a/autotests/integration/decoration_input_test.cpp b/autotests/integration/decoration_input_test.cpp index be24008175..29d4ebdc56 100644 --- a/autotests/integration/decoration_input_test.cpp +++ b/autotests/integration/decoration_input_test.cpp @@ -691,7 +691,6 @@ public: bool eventFilter(QObject *watched, QEvent *event) override { - Q_UNUSED(watched) if (event->type() == QEvent::HoverMove) { Q_EMIT hoverMove(); } else if (event->type() == QEvent::HoverLeave) { diff --git a/autotests/integration/fakes/org.kde.kdecoration2/fakedecoration_with_shadows.cpp b/autotests/integration/fakes/org.kde.kdecoration2/fakedecoration_with_shadows.cpp index 3aba0d0fe0..7509bd5cd2 100644 --- a/autotests/integration/fakes/org.kde.kdecoration2/fakedecoration_with_shadows.cpp +++ b/autotests/integration/fakes/org.kde.kdecoration2/fakedecoration_with_shadows.cpp @@ -27,8 +27,6 @@ public: void paint(QPainter *painter, const QRect &repaintRegion) override { - Q_UNUSED(painter) - Q_UNUSED(repaintRegion) } public Q_SLOTS: diff --git a/autotests/integration/helper/copy.cpp b/autotests/integration/helper/copy.cpp index 97b183adc2..5b0bb6c2ae 100644 --- a/autotests/integration/helper/copy.cpp +++ b/autotests/integration/helper/copy.cpp @@ -33,7 +33,6 @@ Window::~Window() = default; void Window::paintEvent(QPaintEvent *event) { - Q_UNUSED(event) QPainter p(this); p.fillRect(0, 0, width(), height(), Qt::red); } diff --git a/autotests/integration/helper/paste.cpp b/autotests/integration/helper/paste.cpp index 32ead5b8e4..78b4ab9d35 100644 --- a/autotests/integration/helper/paste.cpp +++ b/autotests/integration/helper/paste.cpp @@ -32,7 +32,6 @@ Window::~Window() = default; void Window::paintEvent(QPaintEvent *event) { - Q_UNUSED(event) QPainter p(this); p.fillRect(0, 0, width(), height(), Qt::blue); } diff --git a/autotests/integration/internal_window.cpp b/autotests/integration/internal_window.cpp index 17ea86061f..509c1b7f17 100644 --- a/autotests/integration/internal_window.cpp +++ b/autotests/integration/internal_window.cpp @@ -120,7 +120,6 @@ HelperWindow::~HelperWindow() = default; void HelperWindow::paintEvent(QPaintEvent *event) { - Q_UNUSED(event) QPainter p(this); p.fillRect(0, 0, width(), height(), Qt::red); } @@ -158,19 +157,16 @@ void HelperWindow::mouseReleaseEvent(QMouseEvent *event) void HelperWindow::wheelEvent(QWheelEvent *event) { - Q_UNUSED(event) Q_EMIT wheel(); } void HelperWindow::keyPressEvent(QKeyEvent *event) { - Q_UNUSED(event) Q_EMIT keyPressed(); } void HelperWindow::keyReleaseEvent(QKeyEvent *event) { - Q_UNUSED(event) Q_EMIT keyReleased(); } diff --git a/autotests/integration/plasmawindow_test.cpp b/autotests/integration/plasmawindow_test.cpp index 0591951faf..2e4db354e2 100644 --- a/autotests/integration/plasmawindow_test.cpp +++ b/autotests/integration/plasmawindow_test.cpp @@ -198,7 +198,6 @@ HelperWindow::~HelperWindow() = default; void HelperWindow::paintEvent(QPaintEvent *event) { - Q_UNUSED(event) QPainter p(this); p.fillRect(0, 0, width(), height(), Qt::red); } diff --git a/autotests/integration/stacking_order_test.cpp b/autotests/integration/stacking_order_test.cpp index 34bbc4238b..993be404cf 100644 --- a/autotests/integration/stacking_order_test.cpp +++ b/autotests/integration/stacking_order_test.cpp @@ -244,7 +244,6 @@ void StackingOrderTest::testDeletedTransient() // Close the top-most transient. connect(transient2, &Window::windowClosed, this, [](Window *original, Deleted *deleted) { - Q_UNUSED(original) deleted->refWindow(); }); @@ -659,7 +658,6 @@ void StackingOrderTest::testDeletedGroupTransient() // Unmap the transient. connect(transient, &X11Window::windowClosed, this, [](Window *original, Deleted *deleted) { - Q_UNUSED(original) deleted->refWindow(); }); diff --git a/autotests/integration/test_helpers.cpp b/autotests/integration/test_helpers.cpp index d78140d844..5f3d0ad14e 100644 --- a/autotests/integration/test_helpers.cpp +++ b/autotests/integration/test_helpers.cpp @@ -275,7 +275,6 @@ MockInputMethod::~MockInputMethod() void MockInputMethod::zwp_input_method_v1_activate(struct ::zwp_input_method_context_v1 *context) { - Q_UNUSED(context) if (!m_inputSurface) { m_inputSurface = Test::createSurface(); m_inputMethodSurface = Test::createInputPanelSurfaceV1(m_inputSurface.get(), s_waylandConnection.outputs.first()); @@ -1306,7 +1305,6 @@ bool VirtualInputDevice::isEnabled() const void VirtualInputDevice::setEnabled(bool enabled) { - Q_UNUSED(enabled) } LEDs VirtualInputDevice::leds() const @@ -1316,7 +1314,6 @@ LEDs VirtualInputDevice::leds() const void VirtualInputDevice::setLeds(LEDs leds) { - Q_UNUSED(leds) } bool VirtualInputDevice::isKeyboard() const diff --git a/autotests/integration/touch_input_test.cpp b/autotests/integration/touch_input_test.cpp index 834332f897..d1e69e9926 100644 --- a/autotests/integration/touch_input_test.cpp +++ b/autotests/integration/touch_input_test.cpp @@ -363,7 +363,6 @@ void TouchInputTest::testGestureDetection() { bool callbackTriggered = false; const auto callback = [&callbackTriggered](float progress) { - Q_UNUSED(progress); callbackTriggered = true; qWarning() << "progress callback!" << progress; }; diff --git a/autotests/libinput/mock_libinput.cpp b/autotests/libinput/mock_libinput.cpp index 5572e49fcc..dd505eaeab 100644 --- a/autotests/libinput/mock_libinput.cpp +++ b/autotests/libinput/mock_libinput.cpp @@ -656,21 +656,15 @@ struct libinput *libinput_udev_create_context(const struct libinput_interface *i if (!udev) { return nullptr; } - Q_UNUSED(interface) - Q_UNUSED(user_data) return new libinput; } void libinput_log_set_priority(struct libinput *libinput, enum libinput_log_priority priority) { - Q_UNUSED(libinput) - Q_UNUSED(priority) } void libinput_log_set_handler(struct libinput *libinput, libinput_log_handler log_handler) { - Q_UNUSED(libinput) - Q_UNUSED(log_handler) } struct libinput *libinput_unref(struct libinput *libinput) @@ -693,30 +687,25 @@ int libinput_udev_assign_seat(struct libinput *libinput, const char *seat_id) int libinput_get_fd(struct libinput *libinput) { - Q_UNUSED(libinput) return -1; } int libinput_dispatch(struct libinput *libinput) { - Q_UNUSED(libinput) return 0; } struct libinput_event *libinput_get_event(struct libinput *libinput) { - Q_UNUSED(libinput) return nullptr; } void libinput_suspend(struct libinput *libinput) { - Q_UNUSED(libinput) } int libinput_resume(struct libinput *libinput) { - Q_UNUSED(libinput) return 0; } @@ -936,22 +925,18 @@ int libinput_device_tablet_pad_get_num_buttons(struct libinput_device *device) struct libinput_device_group * libinput_device_get_device_group(struct libinput_device *device) { - Q_UNUSED(device); return nullptr; } void * libinput_device_group_get_user_data(struct libinput_device_group *group) { - Q_UNUSED(group); return nullptr; } void libinput_device_led_update(struct libinput_device *device, enum libinput_led leds) { - Q_UNUSED(device) - Q_UNUSED(leds) } void libinput_device_set_user_data(struct libinput_device *device, void *user_data) @@ -969,9 +954,6 @@ double libinput_event_tablet_tool_get_x_transformed(struct libinput_event_tablet_tool *event, uint32_t width) { - Q_UNUSED(event) - Q_UNUSED(width) - // it's unused at the moment, it doesn't really matter what we return return 0; } @@ -980,7 +962,5 @@ double libinput_event_tablet_tool_get_y_transformed(struct libinput_event_tablet_tool *event, uint32_t height) { - Q_UNUSED(event) - Q_UNUSED(height) return 4; } diff --git a/autotests/libkwineffects/mock_gl.cpp b/autotests/libkwineffects/mock_gl.cpp index 13a258cd52..7d7f8bf42a 100644 --- a/autotests/libkwineffects/mock_gl.cpp +++ b/autotests/libkwineffects/mock_gl.cpp @@ -45,8 +45,6 @@ static const GLubyte *mock_glGetStringi(GLenum name, GLuint index) static void mock_glGetIntegerv(GLenum pname, GLint *data) { - Q_UNUSED(pname) - Q_UNUSED(data) if (pname == GL_NUM_EXTENSIONS) { if (data && s_gl) { *data = s_gl->getString.extensions.count(); diff --git a/autotests/onscreennotificationtest.cpp b/autotests/onscreennotificationtest.cpp index 40c2df7539..a1e890ff79 100644 --- a/autotests/onscreennotificationtest.cpp +++ b/autotests/onscreennotificationtest.cpp @@ -24,12 +24,10 @@ namespace KWin void InputRedirection::installInputEventSpy(InputEventSpy *spy) { - Q_UNUSED(spy); } void InputRedirection::uninstallInputEventSpy(InputEventSpy *spy) { - Q_UNUSED(spy); } InputRedirection *InputRedirection::s_self = nullptr; diff --git a/autotests/tabbox/mock_tabboxhandler.cpp b/autotests/tabbox/mock_tabboxhandler.cpp index d01c326e7e..df88f74229 100644 --- a/autotests/tabbox/mock_tabboxhandler.cpp +++ b/autotests/tabbox/mock_tabboxhandler.cpp @@ -23,7 +23,6 @@ MockTabBoxHandler::~MockTabBoxHandler() void MockTabBoxHandler::grabbedKeyEvent(QKeyEvent *event) const { - Q_UNUSED(event) } QWeakPointer MockTabBoxHandler::activeClient() const @@ -38,7 +37,6 @@ void MockTabBoxHandler::setActiveClient(const QWeakPointer QWeakPointer MockTabBoxHandler::clientToAddToList(TabBox::TabBoxClient *client, int desktop) const { - Q_UNUSED(desktop) QList>::const_iterator it = m_windows.constBegin(); for (; it != m_windows.constEnd(); ++it) { if ((*it).get() == client) { diff --git a/autotests/tabbox/mock_tabboxhandler.h b/autotests/tabbox/mock_tabboxhandler.h index 02038a2420..f009c9e4d0 100644 --- a/autotests/tabbox/mock_tabboxhandler.h +++ b/autotests/tabbox/mock_tabboxhandler.h @@ -38,24 +38,17 @@ public: } QString desktopName(int desktop) const override { - Q_UNUSED(desktop) return "desktop 1"; } QString desktopName(TabBox::TabBoxClient *client) const override { - Q_UNUSED(client) return "desktop"; } void elevateClient(TabBox::TabBoxClient *c, QWindow *tabbox, bool elevate) const override { - Q_UNUSED(c) - Q_UNUSED(tabbox) - Q_UNUSED(elevate) } void shadeClient(TabBox::TabBoxClient *c, bool b) const override { - Q_UNUSED(c) - Q_UNUSED(b) } virtual void hideOutline() { @@ -65,7 +58,6 @@ public: bool isInFocusChain(TabBox::TabBoxClient *client) const override; int nextDesktopFocusChain(int desktop) const override { - Q_UNUSED(desktop) return 1; } int numberOfDesktops() const override @@ -78,16 +70,12 @@ public: } void raiseClient(TabBox::TabBoxClient *c) const override { - Q_UNUSED(c) } void restack(TabBox::TabBoxClient *c, TabBox::TabBoxClient *under) override { - Q_UNUSED(c) - Q_UNUSED(under) } virtual void showOutline(const QRect &outline) { - Q_UNUSED(outline) } TabBox::TabBoxClientList stackingOrder() const override { @@ -97,8 +85,6 @@ public: void highlightWindows(TabBox::TabBoxClient *window = nullptr, QWindow *controller = nullptr) override { - Q_UNUSED(window) - Q_UNUSED(controller) } bool noModifierGrab() const override diff --git a/autotests/test_virtual_desktops.cpp b/autotests/test_virtual_desktops.cpp index 750ff8eb77..2cfbf978ad 100644 --- a/autotests/test_virtual_desktops.cpp +++ b/autotests/test_virtual_desktops.cpp @@ -21,20 +21,14 @@ InputRedirection *InputRedirection::s_self = nullptr; void InputRedirection::registerAxisShortcut(Qt::KeyboardModifiers modifiers, PointerAxisDirection axis, QAction *action) { - Q_UNUSED(modifiers) - Q_UNUSED(axis) - Q_UNUSED(action) } void InputRedirection::registerTouchpadSwipeShortcut(SwipeDirection, uint fingerCount, QAction *) { - Q_UNUSED(fingerCount) } void InputRedirection::registerRealtimeTouchpadSwipeShortcut(SwipeDirection, uint fingerCount, QAction *, std::function progressCallback) { - Q_UNUSED(progressCallback) - Q_UNUSED(fingerCount) } void InputRedirection::registerTouchscreenSwipeShortcut(SwipeDirection, uint, QAction *, std::function) diff --git a/src/backends/drm/drm_egl_cursor_layer.cpp b/src/backends/drm/drm_egl_cursor_layer.cpp index 2b4685aa90..4a9711ba59 100644 --- a/src/backends/drm/drm_egl_cursor_layer.cpp +++ b/src/backends/drm/drm_egl_cursor_layer.cpp @@ -34,7 +34,6 @@ void EglGbmCursorLayer::aboutToStartPainting(const QRegion &damagedRegion) bool EglGbmCursorLayer::endFrame(const QRegion &renderedRegion, const QRegion &damagedRegion) { - Q_UNUSED(renderedRegion) return m_surface.endRendering(m_pipeline->renderOrientation(), damagedRegion); } diff --git a/src/backends/drm/drm_egl_layer.cpp b/src/backends/drm/drm_egl_layer.cpp index d6cea7bb8a..b12efbfcc7 100644 --- a/src/backends/drm/drm_egl_layer.cpp +++ b/src/backends/drm/drm_egl_layer.cpp @@ -51,7 +51,6 @@ void EglGbmLayer::aboutToStartPainting(const QRegion &damagedRegion) bool EglGbmLayer::endFrame(const QRegion &renderedRegion, const QRegion &damagedRegion) { - Q_UNUSED(renderedRegion) const bool ret = m_surface.endRendering(m_pipeline->renderOrientation(), damagedRegion); if (ret) { m_currentDamage = damagedRegion; diff --git a/src/backends/drm/drm_gpu.cpp b/src/backends/drm/drm_gpu.cpp index 82ab6178ce..4582a35953 100644 --- a/src/backends/drm/drm_gpu.cpp +++ b/src/backends/drm/drm_gpu.cpp @@ -518,9 +518,6 @@ static std::chrono::nanoseconds convertTimestamp(clockid_t sourceClock, clockid_ void DrmGpu::pageFlipHandler(int fd, unsigned int sequence, unsigned int sec, unsigned int usec, unsigned int crtc_id, void *user_data) { - Q_UNUSED(fd) - Q_UNUSED(sequence) - DrmGpu *gpu = static_cast(user_data); // The static_cast<> here are for a 32-bit environment where diff --git a/src/backends/drm/drm_qpainter_layer.cpp b/src/backends/drm/drm_qpainter_layer.cpp index 3e39aeceaf..57282bde8f 100644 --- a/src/backends/drm/drm_qpainter_layer.cpp +++ b/src/backends/drm/drm_qpainter_layer.cpp @@ -46,7 +46,6 @@ std::optional DrmQPainterLayer::beginFrame() bool DrmQPainterLayer::endFrame(const QRegion &renderedRegion, const QRegion &damagedRegion) { - Q_UNUSED(renderedRegion) m_currentDamage = damagedRegion; m_swapchain->releaseBuffer(m_swapchain->currentBuffer(), damagedRegion); m_currentFramebuffer = DrmFramebuffer::createFramebuffer(m_swapchain->currentBuffer()); @@ -114,7 +113,6 @@ std::optional DrmCursorQPainterLayer::beginFrame() bool DrmCursorQPainterLayer::endFrame(const QRegion &damagedRegion, const QRegion &renderedRegion) { - Q_UNUSED(renderedRegion) m_swapchain->releaseBuffer(m_swapchain->currentBuffer(), damagedRegion); m_currentFramebuffer = DrmFramebuffer::createFramebuffer(m_swapchain->currentBuffer()); if (!m_currentFramebuffer) { @@ -161,7 +159,6 @@ std::optional DrmVirtualQPainterLayer::beginFrame() bool DrmVirtualQPainterLayer::endFrame(const QRegion &renderedRegion, const QRegion &damagedRegion) { - Q_UNUSED(renderedRegion) m_currentDamage = damagedRegion; return true; } diff --git a/src/backends/drm/drm_virtual_egl_layer.cpp b/src/backends/drm/drm_virtual_egl_layer.cpp index 07cc3af32b..9823187466 100644 --- a/src/backends/drm/drm_virtual_egl_layer.cpp +++ b/src/backends/drm/drm_virtual_egl_layer.cpp @@ -78,7 +78,6 @@ std::optional VirtualEglGbmLayer::beginFrame() bool VirtualEglGbmLayer::endFrame(const QRegion &renderedRegion, const QRegion &damagedRegion) { - Q_UNUSED(renderedRegion); GLFramebuffer::popFramebuffer(); const auto buffer = m_gbmSurface->swapBuffers(damagedRegion); if (buffer) { diff --git a/src/backends/fakeinput/fakeinputdevice.cpp b/src/backends/fakeinput/fakeinputdevice.cpp index 14fa755270..07c71280a4 100644 --- a/src/backends/fakeinput/fakeinputdevice.cpp +++ b/src/backends/fakeinput/fakeinputdevice.cpp @@ -16,8 +16,6 @@ FakeInputDevice::FakeInputDevice(KWaylandServer::FakeInputDevice *device, QObjec , m_name(QStringLiteral("Fake Input Device %1").arg(++s_lastDeviceId)) { connect(device, &KWaylandServer::FakeInputDevice::authenticationRequested, this, [device](const QString &application, const QString &reason) { - Q_UNUSED(application) - Q_UNUSED(reason) // TODO: make secure device->setAuthentication(true); }); @@ -99,7 +97,6 @@ bool FakeInputDevice::isEnabled() const void FakeInputDevice::setEnabled(bool enabled) { - Q_UNUSED(enabled) } LEDs FakeInputDevice::leds() const @@ -109,7 +106,6 @@ LEDs FakeInputDevice::leds() const void FakeInputDevice::setLeds(LEDs leds) { - Q_UNUSED(leds) } bool FakeInputDevice::isKeyboard() const diff --git a/src/backends/libinput/connection.cpp b/src/backends/libinput/connection.cpp index 41af236455..4b40fec209 100644 --- a/src/backends/libinput/connection.cpp +++ b/src/backends/libinput/connection.cpp @@ -631,8 +631,6 @@ void Connection::applyScreenToDevice(Device *device) // TODO: this is currently non-functional even on DRM. Needs orientation() override there. device->setOrientation(Qt::PrimaryOrientation); -#else - Q_UNUSED(device) #endif } diff --git a/src/backends/libinput/context.cpp b/src/backends/libinput/context.cpp index c43608e9b5..0af2d04640 100644 --- a/src/backends/libinput/context.cpp +++ b/src/backends/libinput/context.cpp @@ -25,7 +25,6 @@ namespace LibInput static void libinputLogHandler(libinput *libinput, libinput_log_priority priority, const char *format, va_list args) { - Q_UNUSED(libinput) char buf[1024]; if (std::vsnprintf(buf, 1023, format, args) <= 0) { return; diff --git a/src/backends/libinput/device.cpp b/src/backends/libinput/device.cpp index 97f8a9e0ed..9f12a56d56 100644 --- a/src/backends/libinput/device.cpp +++ b/src/backends/libinput/device.cpp @@ -647,8 +647,6 @@ void Device::setOutputName(const QString &name) m_outputName = name; writeEntry(ConfigKey::OutputName, name); Q_EMIT outputNameChanged(); -#else - Q_UNUSED(name) #endif } diff --git a/src/backends/virtual/virtual_egl_backend.cpp b/src/backends/virtual/virtual_egl_backend.cpp index 1129b56982..1af06e9d62 100644 --- a/src/backends/virtual/virtual_egl_backend.cpp +++ b/src/backends/virtual/virtual_egl_backend.cpp @@ -57,8 +57,6 @@ std::optional VirtualEglLayer::beginFrame() bool VirtualEglLayer::endFrame(const QRegion &renderedRegion, const QRegion &damagedRegion) { - Q_UNUSED(renderedRegion) - Q_UNUSED(damagedRegion) GLFramebuffer::popFramebuffer(); return true; } diff --git a/src/backends/virtual/virtual_qpainter_backend.cpp b/src/backends/virtual/virtual_qpainter_backend.cpp index 9145d0a4d6..9304c80275 100644 --- a/src/backends/virtual/virtual_qpainter_backend.cpp +++ b/src/backends/virtual/virtual_qpainter_backend.cpp @@ -33,8 +33,6 @@ std::optional VirtualQPainterLayer::beginFrame() bool VirtualQPainterLayer::endFrame(const QRegion &renderedRegion, const QRegion &damagedRegion) { - Q_UNUSED(renderedRegion) - Q_UNUSED(damagedRegion) return true; } diff --git a/src/backends/wayland/wayland_backend.cpp b/src/backends/wayland/wayland_backend.cpp index 25c577c337..53a1c52f3a 100644 --- a/src/backends/wayland/wayland_backend.cpp +++ b/src/backends/wayland/wayland_backend.cpp @@ -226,7 +226,6 @@ WaylandInputDevice::WaylandInputDevice(KWayland::Client::Pointer *pointer, Wayla , m_pointer(pointer) { connect(pointer, &Pointer::entered, this, [this](quint32 serial, const QPointF &relativeToSurface) { - Q_UNUSED(relativeToSurface) m_enteredSerial = serial; }); connect(pointer, &Pointer::motion, this, [this](const QPointF &relativeToSurface, quint32 time) { @@ -236,7 +235,6 @@ WaylandInputDevice::WaylandInputDevice(KWayland::Client::Pointer *pointer, Wayla Q_EMIT pointerMotionAbsolute(absolutePos, time, this); }); connect(pointer, &Pointer::buttonStateChanged, this, [this](quint32 serial, quint32 time, quint32 button, Pointer::ButtonState nativeState) { - Q_UNUSED(serial) InputRedirection::PointerButtonState state; switch (nativeState) { case Pointer::ButtonState::Pressed: @@ -270,35 +268,29 @@ WaylandInputDevice::WaylandInputDevice(KWayland::Client::Pointer *pointer, Wayla if (pointerGestures) { m_pinchGesture.reset(pointerGestures->createPinchGesture(m_pointer.get(), this)); connect(m_pinchGesture.get(), &PointerPinchGesture::started, this, [this](quint32 serial, quint32 time) { - Q_UNUSED(serial); Q_EMIT pinchGestureBegin(m_pinchGesture->fingerCount(), time, this); }); connect(m_pinchGesture.get(), &PointerPinchGesture::updated, this, [this](const QSizeF &delta, qreal scale, qreal rotation, quint32 time) { Q_EMIT pinchGestureUpdate(scale, rotation, QSIZE_TO_QPOINT(delta), time, this); }); connect(m_pinchGesture.get(), &PointerPinchGesture::ended, this, [this](quint32 serial, quint32 time) { - Q_UNUSED(serial) Q_EMIT pinchGestureEnd(time, this); }); connect(m_pinchGesture.get(), &PointerPinchGesture::cancelled, this, [this](quint32 serial, quint32 time) { - Q_UNUSED(serial) Q_EMIT pinchGestureCancelled(time, this); }); m_swipeGesture.reset(pointerGestures->createSwipeGesture(m_pointer.get(), this)); connect(m_swipeGesture.get(), &PointerSwipeGesture::started, this, [this](quint32 serial, quint32 time) { - Q_UNUSED(serial) Q_EMIT swipeGestureBegin(m_swipeGesture->fingerCount(), time, this); }); connect(m_swipeGesture.get(), &PointerSwipeGesture::updated, this, [this](const QSizeF &delta, quint32 time) { Q_EMIT swipeGestureUpdate(QSIZE_TO_QPOINT(delta), time, this); }); connect(m_swipeGesture.get(), &PointerSwipeGesture::ended, this, [this](quint32 serial, quint32 time) { - Q_UNUSED(serial) Q_EMIT swipeGestureEnd(time, this); }); connect(m_swipeGesture.get(), &PointerSwipeGesture::cancelled, this, [this](quint32 serial, quint32 time) { - Q_UNUSED(serial) Q_EMIT swipeGestureCancelled(time, this); }); } @@ -358,7 +350,6 @@ bool WaylandInputDevice::isEnabled() const void WaylandInputDevice::setEnabled(bool enabled) { - Q_UNUSED(enabled) } LEDs WaylandInputDevice::leds() const @@ -368,7 +359,6 @@ LEDs WaylandInputDevice::leds() const void WaylandInputDevice::setLeds(LEDs leds) { - Q_UNUSED(leds) } bool WaylandInputDevice::isKeyboard() const @@ -676,7 +666,6 @@ bool WaylandBackend::initialize() m_waylandCursor->installImage(); }); connect(Cursors::self(), &Cursors::positionChanged, this, [this](Cursor *cursor, const QPoint &position) { - Q_UNUSED(cursor) if (m_waylandCursor) { m_waylandCursor->move(position); } diff --git a/src/backends/wayland/wayland_backend.h b/src/backends/wayland/wayland_backend.h index 84c4bbdcaa..e2cfa71730 100644 --- a/src/backends/wayland/wayland_backend.h +++ b/src/backends/wayland/wayland_backend.h @@ -80,7 +80,6 @@ public: virtual void init(); virtual void move(const QPointF &globalPosition) { - Q_UNUSED(globalPosition) } void installImage(); diff --git a/src/backends/wayland/wayland_egl_backend.cpp b/src/backends/wayland/wayland_egl_backend.cpp index 25ba75f803..8bd1232a94 100644 --- a/src/backends/wayland/wayland_egl_backend.cpp +++ b/src/backends/wayland/wayland_egl_backend.cpp @@ -161,7 +161,6 @@ std::optional WaylandEglOutput::beginFrame() bool WaylandEglOutput::endFrame(const QRegion &renderedRegion, const QRegion &damagedRegion) { - Q_UNUSED(renderedRegion) m_damageJournal.add(damagedRegion); GLFramebuffer::popFramebuffer(); return true; diff --git a/src/backends/wayland/wayland_output.cpp b/src/backends/wayland/wayland_output.cpp index 323362f298..e37302e8c7 100644 --- a/src/backends/wayland/wayland_output.cpp +++ b/src/backends/wayland/wayland_output.cpp @@ -151,7 +151,6 @@ XdgShellOutput::~XdgShellOutput() void XdgShellOutput::handleConfigure(const QSize &size, XdgShellSurface::States states, quint32 serial) { - Q_UNUSED(states); m_xdgShellSurface->ackConfigure(serial); if (size.width() > 0 && size.height() > 0) { resize(size * scale()); diff --git a/src/backends/wayland/wayland_output.h b/src/backends/wayland/wayland_output.h index 9a5c6d3a49..24637e3122 100644 --- a/src/backends/wayland/wayland_output.h +++ b/src/backends/wayland/wayland_output.h @@ -48,8 +48,6 @@ public: virtual void lockPointer(KWayland::Client::Pointer *pointer, bool lock) { - Q_UNUSED(pointer) - Q_UNUSED(lock) } virtual bool pointerIsLocked() diff --git a/src/backends/wayland/wayland_qpainter_backend.cpp b/src/backends/wayland/wayland_qpainter_backend.cpp index 473e39a8b3..4c785f7d9b 100644 --- a/src/backends/wayland/wayland_qpainter_backend.cpp +++ b/src/backends/wayland/wayland_qpainter_backend.cpp @@ -69,7 +69,6 @@ void WaylandQPainterOutput::remapBuffer() void WaylandQPainterOutput::updateSize(const QSize &size) { - Q_UNUSED(size) m_back = nullptr; m_slots.clear(); } @@ -136,8 +135,6 @@ std::optional WaylandQPainterOutput::beginFrame() bool WaylandQPainterOutput::endFrame(const QRegion &renderedRegion, const QRegion &damagedRegion) { - Q_UNUSED(renderedRegion) - m_damageJournal.add(damagedRegion); return true; } diff --git a/src/backends/x11/standalone/x11_standalone_egl_backend.cpp b/src/backends/x11/standalone/x11_standalone_egl_backend.cpp index bb1d4a3547..c6c5851c27 100644 --- a/src/backends/x11/standalone/x11_standalone_egl_backend.cpp +++ b/src/backends/x11/standalone/x11_standalone_egl_backend.cpp @@ -152,7 +152,6 @@ void EglBackend::endFrame(const QRegion &renderedRegion, const QRegion &damagedR void EglBackend::present(Output *output) { - Q_UNUSED(output) // Start the software vsync monitor. There is no any reliable way to determine when // eglSwapBuffers() or eglSwapBuffersWithDamageEXT() completes. m_vsyncMonitor->arm(); @@ -198,7 +197,6 @@ void EglBackend::presentSurface(EGLSurface surface, const QRegion &damage, const OutputLayer *EglBackend::primaryLayer(Output *output) { - Q_UNUSED(output) return m_layer.get(); } @@ -226,7 +224,6 @@ bool EglSurfaceTextureX11::create() void EglSurfaceTextureX11::update(const QRegion ®ion) { - Q_UNUSED(region) // mipmaps need to be updated m_texture->setDirty(); } diff --git a/src/backends/x11/standalone/x11_standalone_glx_backend.cpp b/src/backends/x11/standalone/x11_standalone_glx_backend.cpp index 5858902288..aa5bb42de7 100644 --- a/src/backends/x11/standalone/x11_standalone_glx_backend.cpp +++ b/src/backends/x11/standalone/x11_standalone_glx_backend.cpp @@ -806,8 +806,6 @@ void GlxBackend::endFrame(const QRegion &renderedRegion, const QRegion &damagedR void GlxBackend::present(Output *output) { - Q_UNUSED(output) - // If the GLX_INTEL_swap_event extension is not used for getting presentation feedback, // assume that the frame will be presented at the next vblank event, this is racy. if (m_vsyncMonitor) { @@ -861,7 +859,6 @@ OverlayWindow *GlxBackend::overlayWindow() const OutputLayer *GlxBackend::primaryLayer(Output *output) { - Q_UNUSED(output) return m_layer.get(); } @@ -883,7 +880,6 @@ bool GlxSurfaceTextureX11::create() void GlxSurfaceTextureX11::update(const QRegion ®ion) { - Q_UNUSED(region) // mipmaps need to be updated m_texture->setDirty(); } diff --git a/src/backends/x11/standalone/x11_standalone_xfixes_cursor_event_filter.cpp b/src/backends/x11/standalone/x11_standalone_xfixes_cursor_event_filter.cpp index 71f49a38ca..f0d3cfcefe 100644 --- a/src/backends/x11/standalone/x11_standalone_xfixes_cursor_event_filter.cpp +++ b/src/backends/x11/standalone/x11_standalone_xfixes_cursor_event_filter.cpp @@ -21,7 +21,6 @@ XFixesCursorEventFilter::XFixesCursorEventFilter(X11Cursor *cursor) bool XFixesCursorEventFilter::event(xcb_generic_event_t *event) { - Q_UNUSED(event); m_cursor->notifyCursorChanged(); return false; } diff --git a/src/backends/x11/windowed/x11_windowed_backend.cpp b/src/backends/x11/windowed/x11_windowed_backend.cpp index 59309900a1..3a45e15751 100644 --- a/src/backends/x11/windowed/x11_windowed_backend.cpp +++ b/src/backends/x11/windowed/x11_windowed_backend.cpp @@ -79,7 +79,6 @@ bool X11WindowedInputDevice::isEnabled() const void X11WindowedInputDevice::setEnabled(bool enabled) { - Q_UNUSED(enabled) } LEDs X11WindowedInputDevice::leds() const @@ -89,7 +88,6 @@ LEDs X11WindowedInputDevice::leds() const void X11WindowedInputDevice::setLeds(LEDs leds) { - Q_UNUSED(leds) } bool X11WindowedInputDevice::isKeyboard() const diff --git a/src/backends/x11/windowed/x11_windowed_egl_backend.cpp b/src/backends/x11/windowed/x11_windowed_egl_backend.cpp index e27d30d529..0283e56088 100644 --- a/src/backends/x11/windowed/x11_windowed_egl_backend.cpp +++ b/src/backends/x11/windowed/x11_windowed_egl_backend.cpp @@ -55,7 +55,6 @@ std::optional X11WindowedEglOutput::beginFrame() bool X11WindowedEglOutput::endFrame(const QRegion &renderedRegion, const QRegion &damagedRegion) { - Q_UNUSED(renderedRegion) m_lastDamage = damagedRegion; GLFramebuffer::popFramebuffer(); return true; diff --git a/src/backends/x11/windowed/x11_windowed_qpainter_backend.cpp b/src/backends/x11/windowed/x11_windowed_qpainter_backend.cpp index 3169f436a6..3474896913 100644 --- a/src/backends/x11/windowed/x11_windowed_qpainter_backend.cpp +++ b/src/backends/x11/windowed/x11_windowed_qpainter_backend.cpp @@ -45,8 +45,6 @@ std::optional X11WindowedQPainterOutput::beginFrame() bool X11WindowedQPainterOutput::endFrame(const QRegion &renderedRegion, const QRegion &damagedRegion) { - Q_UNUSED(renderedRegion) - Q_UNUSED(damagedRegion) return true; } diff --git a/src/core/output.cpp b/src/core/output.cpp index ddd98ab87e..b68156fc9f 100644 --- a/src/core/output.cpp +++ b/src/core/output.cpp @@ -309,7 +309,6 @@ QSize Output::orientateSize(const QSize &size) const void Output::setDpmsMode(DpmsMode mode) { - Q_UNUSED(mode) } Output::DpmsMode Output::dpmsMode() const @@ -395,7 +394,6 @@ Output::RgbRange Output::rgbRange() const void Output::setColorTransformation(const std::shared_ptr &transformation) { - Q_UNUSED(transformation); } ContentType Output::contentType() const diff --git a/src/core/outputlayer.cpp b/src/core/outputlayer.cpp index bedb193c31..9df8176da6 100644 --- a/src/core/outputlayer.cpp +++ b/src/core/outputlayer.cpp @@ -31,12 +31,10 @@ void OutputLayer::resetRepaints() void OutputLayer::aboutToStartPainting(const QRegion &damage) { - Q_UNUSED(damage) } bool OutputLayer::scanout(SurfaceItem *surfaceItem) { - Q_UNUSED(surfaceItem) return false; } diff --git a/src/core/platform.cpp b/src/core/platform.cpp index 793847e371..c95f202771 100644 --- a/src/core/platform.cpp +++ b/src/core/platform.cpp @@ -60,17 +60,11 @@ std::unique_ptr Platform::createQPainterBackend() std::optional Platform::testCreateDmaBuf(const QSize &size, quint32 format, const QVector &modifiers) { - Q_UNUSED(size) - Q_UNUSED(format) - Q_UNUSED(modifiers) return {}; } std::shared_ptr Platform::createDmaBufTexture(const QSize &size, quint32 format, uint64_t modifier) { - Q_UNUSED(size) - Q_UNUSED(format) - Q_UNUSED(modifier) return {}; } @@ -132,9 +126,6 @@ void Platform::setReady(bool ready) Output *Platform::createVirtualOutput(const QString &name, const QSize &size, double scale) { - Q_UNUSED(name); - Q_UNUSED(size); - Q_UNUSED(scale); return nullptr; } @@ -145,7 +136,6 @@ void Platform::removeVirtualOutput(Output *output) void Platform::warpPointer(const QPointF &globalPos) { - Q_UNUSED(globalPos) } bool Platform::supportsNativeFence() const @@ -188,7 +178,6 @@ bool Platform::openGLCompositingIsBroken() const void Platform::createOpenGLSafePoint(OpenGLSafePoint safePoint) { - Q_UNUSED(safePoint) } void Platform::startInteractiveWindowSelection(std::function callback, const QByteArray &cursorName) diff --git a/src/core/session_consolekit.cpp b/src/core/session_consolekit.cpp index 69b21b46b1..94c07642b7 100644 --- a/src/core/session_consolekit.cpp +++ b/src/core/session_consolekit.cpp @@ -327,7 +327,6 @@ void ConsoleKitSession::handleResumeDevice(uint major, uint minor, QDBusUnixFile { // We don't care about the file descriptor as the libinput backend will re-open input devices // and the drm file descriptors remain valid after pausing gpus. - Q_UNUSED(fileDescriptor) Q_EMIT deviceResumed(makedev(major, minor)); } diff --git a/src/core/session_logind.cpp b/src/core/session_logind.cpp index db438d83cf..6087e09fe2 100644 --- a/src/core/session_logind.cpp +++ b/src/core/session_logind.cpp @@ -326,7 +326,6 @@ void LogindSession::handleResumeDevice(uint major, uint minor, QDBusUnixFileDesc { // We don't care about the file descriptor as the libinput backend will re-open input devices // and the drm file descriptors remain valid after pausing gpus. - Q_UNUSED(fileDescriptor) Q_EMIT deviceResumed(makedev(major, minor)); } diff --git a/src/core/session_noop.cpp b/src/core/session_noop.cpp index 13968f971b..82d250059f 100644 --- a/src/core/session_noop.cpp +++ b/src/core/session_noop.cpp @@ -40,18 +40,15 @@ uint NoopSession::terminal() const int NoopSession::openRestricted(const QString &fileName) { - Q_UNUSED(fileName) return -1; } void NoopSession::closeRestricted(int fileDescriptor) { - Q_UNUSED(fileDescriptor) } void NoopSession::switchTo(uint terminal) { - Q_UNUSED(terminal) } } // namespace KWin diff --git a/src/cursor.cpp b/src/cursor.cpp index 7e58a11b9d..15b062db45 100644 --- a/src/cursor.cpp +++ b/src/cursor.cpp @@ -160,7 +160,6 @@ void Cursor::updateTheme(const QString &name, int size) void Cursor::slotKGlobalSettingsNotifyChange(int type, int arg) { // #endif - Q_UNUSED(arg) if (type == 5 /*CursorChanged*/) { InputConfig::self()->inputConfig()->reparseConfiguration(); loadThemeFromKConfig(); diff --git a/src/dbusinterface.cpp b/src/dbusinterface.cpp index d9391ded90..0b6d95d2c5 100644 --- a/src/dbusinterface.cpp +++ b/src/dbusinterface.cpp @@ -114,7 +114,6 @@ bool DBusInterface::startActivity(const QString &in0) } return Workspace::self()->activities()->start(in0); #else - Q_UNUSED(in0) return false; #endif } @@ -127,7 +126,6 @@ bool DBusInterface::stopActivity(const QString &in0) } return Workspace::self()->activities()->stop(in0); #else - Q_UNUSED(in0) return false; #endif } @@ -381,13 +379,10 @@ VirtualDesktopManagerDBusInterface::VirtualDesktopManagerDBusInterface(VirtualDe this); connect(m_manager, &VirtualDesktopManager::currentChanged, this, [this](uint previousDesktop, uint newDesktop) { - Q_UNUSED(previousDesktop); - Q_UNUSED(newDesktop); Q_EMIT currentChanged(m_manager->currentDesktop()->id()); }); connect(m_manager, &VirtualDesktopManager::countChanged, this, [this](uint previousCount, uint newCount) { - Q_UNUSED(previousCount); Q_EMIT countChanged(newCount); Q_EMIT desktopsChanged(desktops()); }); diff --git a/src/debug_console.cpp b/src/debug_console.cpp index 6bda3085d4..61a6f850d3 100644 --- a/src/debug_console.cpp +++ b/src/debug_console.cpp @@ -977,7 +977,6 @@ DebugConsoleModel::~DebugConsoleModel() = default; int DebugConsoleModel::columnCount(const QModelIndex &parent) const { - Q_UNUSED(parent) return 2; } @@ -1130,7 +1129,6 @@ QModelIndex DebugConsoleModel::parent(const QModelIndex &child) const QVariant DebugConsoleModel::propertyData(QObject *object, const QModelIndex &index, int role) const { - Q_UNUSED(role) const auto property = object->metaObject()->property(index.row()); if (index.column() == 0) { return property.name(); @@ -1341,7 +1339,6 @@ SurfaceTreeModel::~SurfaceTreeModel() = default; int SurfaceTreeModel::columnCount(const QModelIndex &parent) const { - Q_UNUSED(parent) return 1; } @@ -1502,7 +1499,6 @@ InputDeviceModel::~InputDeviceModel() = default; int InputDeviceModel::columnCount(const QModelIndex &parent) const { - Q_UNUSED(parent) return 2; } @@ -1609,7 +1605,6 @@ QModelIndex DataSourceModel::index(int row, int column, const QModelIndex &paren QModelIndex DataSourceModel::parent(const QModelIndex &child) const { - Q_UNUSED(child) return QModelIndex(); } diff --git a/src/decorationitem.cpp b/src/decorationitem.cpp index 3f2f71dcc5..e38919eb20 100644 --- a/src/decorationitem.cpp +++ b/src/decorationitem.cpp @@ -199,7 +199,6 @@ void DecorationItem::handleFrameGeometryChanged() void DecorationItem::handleWindowClosed(Window *original, Deleted *deleted) { - Q_UNUSED(original) m_window = deleted; // If the decoration is about to be destroyed, render the decoration for the last time. diff --git a/src/deleted.cpp b/src/deleted.cpp index ec095c540e..ee823750a5 100644 --- a/src/deleted.cpp +++ b/src/deleted.cpp @@ -170,8 +170,6 @@ bool Deleted::isDeleted() const NET::WindowType Deleted::windowType(bool direct, int supportedTypes) const { - Q_UNUSED(direct) - Q_UNUSED(supportedTypes) return m_type; } diff --git a/src/dpmsinputeventfilter.cpp b/src/dpmsinputeventfilter.cpp index 69f2df8827..bbb58aa64f 100644 --- a/src/dpmsinputeventfilter.cpp +++ b/src/dpmsinputeventfilter.cpp @@ -30,15 +30,12 @@ DpmsInputEventFilter::~DpmsInputEventFilter() = default; bool DpmsInputEventFilter::pointerEvent(QMouseEvent *event, quint32 nativeButton) { - Q_UNUSED(event) - Q_UNUSED(nativeButton) notify(); return true; } bool DpmsInputEventFilter::wheelEvent(QWheelEvent *event) { - Q_UNUSED(event) notify(); return true; } @@ -53,8 +50,6 @@ bool DpmsInputEventFilter::keyEvent(QKeyEvent *event) bool DpmsInputEventFilter::touchDown(qint32 id, const QPointF &pos, quint32 time) { - Q_UNUSED(pos) - Q_UNUSED(time) if (m_enableDoubleTap) { if (m_touchPoints.isEmpty()) { if (!m_doubleTapTimer.isValid()) { @@ -96,9 +91,6 @@ bool DpmsInputEventFilter::touchUp(qint32 id, quint32 time) bool DpmsInputEventFilter::touchMotion(qint32 id, const QPointF &pos, quint32 time) { - Q_UNUSED(id) - Q_UNUSED(pos) - Q_UNUSED(time) // ignore the event return true; } diff --git a/src/effects.cpp b/src/effects.cpp index 5276d633d2..ae17476302 100644 --- a/src/effects.cpp +++ b/src/effects.cpp @@ -341,11 +341,9 @@ void EffectsHandlerImpl::setupWindowConnections(Window *window) Q_EMIT windowHidden(window->effectWindow()); }); connect(window, &Window::keepAboveChanged, this, [this, window](bool above) { - Q_UNUSED(above) Q_EMIT windowKeepAboveChanged(window->effectWindow()); }); connect(window, &Window::keepBelowChanged, this, [this, window](bool below) { - Q_UNUSED(below) Q_EMIT windowKeepBelowChanged(window->effectWindow()); }); connect(window, &Window::fullScreenChanged, this, [this, window]() { @@ -755,7 +753,6 @@ bool EffectsHandlerImpl::tabletToolEvent(TabletEvent *event) bool EffectsHandlerImpl::tabletToolButtonEvent(uint button, bool pressed, const TabletToolId &tabletToolId, uint time) { - Q_UNUSED(time) // TODO: reverse call order? for (auto it = loaded_effects.constBegin(); it != loaded_effects.constEnd(); ++it) { if (it->second->tabletToolButtonEvent(button, pressed, tabletToolId.m_uniqueId)) { @@ -767,7 +764,6 @@ bool EffectsHandlerImpl::tabletToolButtonEvent(uint button, bool pressed, const bool EffectsHandlerImpl::tabletPadButtonEvent(uint button, bool pressed, const TabletPadId &tabletPadId, uint time) { - Q_UNUSED(time) // TODO: reverse call order? for (auto it = loaded_effects.constBegin(); it != loaded_effects.constEnd(); ++it) { if (it->second->tabletPadButtonEvent(button, pressed, tabletPadId.data)) { @@ -779,7 +775,6 @@ bool EffectsHandlerImpl::tabletPadButtonEvent(uint button, bool pressed, const T bool EffectsHandlerImpl::tabletPadStripEvent(int number, int position, bool isFinger, const TabletPadId &tabletPadId, uint time) { - Q_UNUSED(time) // TODO: reverse call order? for (auto it = loaded_effects.constBegin(); it != loaded_effects.constEnd(); ++it) { if (it->second->tabletPadStripEvent(number, position, isFinger, tabletPadId.data)) { @@ -791,7 +786,6 @@ bool EffectsHandlerImpl::tabletPadStripEvent(int number, int position, bool isFi bool EffectsHandlerImpl::tabletPadRingEvent(int number, int position, bool isFinger, const TabletPadId &tabletPadId, uint time) { - Q_UNUSED(time) // TODO: reverse call order? for (auto it = loaded_effects.constBegin(); it != loaded_effects.constEnd(); ++it) { if (it->second->tabletPadRingEvent(number, position, isFinger, tabletPadId.data)) { @@ -1180,8 +1174,6 @@ void EffectsHandlerImpl::setTabBoxWindow(EffectWindow *w) if (window->isClient()) { workspace()->tabbox()->setCurrentClient(window); } -#else - Q_UNUSED(w) #endif } @@ -1189,8 +1181,6 @@ void EffectsHandlerImpl::setTabBoxDesktop(int desktop) { #if KWIN_BUILD_TABBOX workspace()->tabbox()->setCurrentDesktop(desktop); -#else - Q_UNUSED(desktop) #endif } @@ -2588,7 +2578,6 @@ const QRect &EffectFrameImpl::geometry() const void EffectFrameImpl::setGeometry(const QRect &geometry, bool force) { - Q_UNUSED(force) m_view->setGeometry(geometry); } @@ -2623,8 +2612,6 @@ void EffectFrameImpl::setPosition(const QPoint &point) void EffectFrameImpl::render(const QRegion ®ion, double opacity, double frameOpacity) { - Q_UNUSED(region); - if (!m_view->rootItem()) { return; } diff --git a/src/effects/blendchanges/blendchanges.cpp b/src/effects/blendchanges/blendchanges.cpp index be075c0e3f..7179a311d2 100644 --- a/src/effects/blendchanges/blendchanges.cpp +++ b/src/effects/blendchanges/blendchanges.cpp @@ -79,9 +79,6 @@ void BlendChanges::postPaintScreen() void BlendChanges::paintWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data) { - Q_UNUSED(w) - Q_UNUSED(mask) - Q_UNUSED(region) data.setCrossFadeProgress(m_timeline.value()); effects->paintWindow(w, mask, region, data); } diff --git a/src/effects/blur/blur.cpp b/src/effects/blur/blur.cpp index 95a94373de..600a145e43 100644 --- a/src/effects/blur/blur.cpp +++ b/src/effects/blur/blur.cpp @@ -264,8 +264,6 @@ void BlurEffect::initBlurStrengthValues() void BlurEffect::reconfigure(ReconfigureFlags flags) { - Q_UNUSED(flags) - BlurConfig::self()->read(); int blurStrength = BlurConfig::blurStrength() - 1; @@ -794,8 +792,6 @@ void BlurEffect::doBlur(const QRegion &shape, const QRect &screen, const float o void BlurEffect::upscaleRenderToScreen(GLVertexBuffer *vbo, int vboStart, int blurRectCount, const QMatrix4x4 &screenProjection, QPoint windowPosition) { - Q_UNUSED(windowPosition) - m_renderTextures[1]->bind(); m_shader->bind(BlurShader::UpSampleType); diff --git a/src/effects/desktopgrid/desktopgrideffect.cpp b/src/effects/desktopgrid/desktopgrideffect.cpp index d571b5658a..ffe4c300f2 100644 --- a/src/effects/desktopgrid/desktopgrideffect.cpp +++ b/src/effects/desktopgrid/desktopgrideffect.cpp @@ -120,8 +120,6 @@ void DesktopGridEffect::reconfigure(ReconfigureFlags) for (const int &border : touchActivateBorders) { m_touchBorderActivate.append(ElectricBorder(border)); effects->registerRealtimeTouchBorder(ElectricBorder(border), m_realtimeToggleAction, [this](ElectricBorder border, const QPointF &deltaProgress, const EffectScreen *screen) { - Q_UNUSED(screen) - if (m_status == Status::Active) { return; } diff --git a/src/effects/diminactive/diminactive.cpp b/src/effects/diminactive/diminactive.cpp index 69e3b692dd..88d27324d0 100644 --- a/src/effects/diminactive/diminactive.cpp +++ b/src/effects/diminactive/diminactive.cpp @@ -58,8 +58,6 @@ DimInactiveEffect::~DimInactiveEffect() void DimInactiveEffect::reconfigure(ReconfigureFlags flags) { - Q_UNUSED(flags) - DimInactiveConfig::self()->read(); // TODO: Use normalized strength param. diff --git a/src/effects/fallapart/fallapart.cpp b/src/effects/fallapart/fallapart.cpp index c6e0db0794..e9a4c95e47 100644 --- a/src/effects/fallapart/fallapart.cpp +++ b/src/effects/fallapart/fallapart.cpp @@ -64,8 +64,6 @@ void FallApartEffect::prePaintWindow(EffectWindow *w, WindowPrePaintData &data, void FallApartEffect::apply(EffectWindow *w, int mask, WindowPaintData &data, WindowQuadList &quads) { - Q_UNUSED(w) - Q_UNUSED(mask) auto animationIt = windows.constFind(w); if (animationIt != windows.constEnd() && isRealWindow(w)) { const qreal t = animationIt->progress; diff --git a/src/effects/glide/glide.cpp b/src/effects/glide/glide.cpp index dbb82c623b..91f2565553 100644 --- a/src/effects/glide/glide.cpp +++ b/src/effects/glide/glide.cpp @@ -75,8 +75,6 @@ GlideEffect::~GlideEffect() = default; void GlideEffect::reconfigure(ReconfigureFlags flags) { - Q_UNUSED(flags) - GlideConfig::self()->read(); m_duration = std::chrono::milliseconds(animationTime(160)); diff --git a/src/effects/kscreen/kscreen.cpp b/src/effects/kscreen/kscreen.cpp index d9fa845323..849406440b 100644 --- a/src/effects/kscreen/kscreen.cpp +++ b/src/effects/kscreen/kscreen.cpp @@ -85,8 +85,6 @@ void KscreenEffect::addScreen(EffectScreen *screen) void KscreenEffect::reconfigure(ReconfigureFlags flags) { - Q_UNUSED(flags) - KscreenConfig::self()->read(); m_xcbState.m_timeLine.setDuration( std::chrono::milliseconds(animationTime(250))); diff --git a/src/effects/magiclamp/magiclamp.cpp b/src/effects/magiclamp/magiclamp.cpp index c0f26d04fe..859e6968c1 100644 --- a/src/effects/magiclamp/magiclamp.cpp +++ b/src/effects/magiclamp/magiclamp.cpp @@ -71,8 +71,6 @@ void MagicLampEffect::prePaintWindow(EffectWindow *w, WindowPrePaintData &data, void MagicLampEffect::apply(EffectWindow *w, int mask, WindowPaintData &data, WindowQuadList &quads) { - Q_UNUSED(mask) - Q_UNUSED(data) auto animationIt = m_animations.constFind(w); if (animationIt != m_animations.constEnd()) { // 0 = not minimized, 1 = fully minimized diff --git a/src/effects/overview/overvieweffect.cpp b/src/effects/overview/overvieweffect.cpp index 209d7e9f93..8452f1dfa7 100644 --- a/src/effects/overview/overvieweffect.cpp +++ b/src/effects/overview/overvieweffect.cpp @@ -116,7 +116,6 @@ void OverviewEffect::reconfigure(ReconfigureFlags) for (const int &border : touchActivateBorders) { m_touchBorderActivate.append(ElectricBorder(border)); effects->registerRealtimeTouchBorder(ElectricBorder(border), m_realtimeToggleAction, [this](ElectricBorder border, const QPointF &deltaProgress, const EffectScreen *screen) { - Q_UNUSED(screen) if (m_status == Status::Active) { return; } diff --git a/src/effects/screenshot/screenshotdbusinterface1.cpp b/src/effects/screenshot/screenshotdbusinterface1.cpp index a65b7f9355..ff876cf4be 100644 --- a/src/effects/screenshot/screenshotdbusinterface1.cpp +++ b/src/effects/screenshot/screenshotdbusinterface1.cpp @@ -298,13 +298,11 @@ ScreenShotSink1::ScreenShotSink1(ScreenShotDBusInterface1 *interface, QDBusMessa void ScreenShotSink1::flush(const QImage &image) { - Q_UNUSED(image) qCWarning(KWIN_SCREENSHOT) << metaObject()->className() << "does not implement" << Q_FUNC_INFO; } void ScreenShotSink1::flushMulti(const QList &images) { - Q_UNUSED(images) qCWarning(KWIN_SCREENSHOT) << metaObject()->className() << "does not implement" << Q_FUNC_INFO; } diff --git a/src/effects/sheet/sheet.cpp b/src/effects/sheet/sheet.cpp index a2c3ec65c5..d0b1a9e6c2 100644 --- a/src/effects/sheet/sheet.cpp +++ b/src/effects/sheet/sheet.cpp @@ -62,8 +62,6 @@ SheetEffect::SheetEffect() void SheetEffect::reconfigure(ReconfigureFlags flags) { - Q_UNUSED(flags) - SheetConfig::self()->read(); // TODO: Rename AnimationTime config key to Duration. diff --git a/src/effects/slide/slide.cpp b/src/effects/slide/slide.cpp index 7257df2c77..23c5b2398a 100644 --- a/src/effects/slide/slide.cpp +++ b/src/effects/slide/slide.cpp @@ -289,8 +289,6 @@ bool SlideEffect::shouldElevate(const EffectWindow *w) const */ void SlideEffect::startAnimation(int old, int current, EffectWindow *movingWindow) { - Q_UNUSED(old) - if (m_state == State::Inactive) { prepareSwitching(); } diff --git a/src/effects/slidingpopups/slidingpopups.cpp b/src/effects/slidingpopups/slidingpopups.cpp index 66ff2b2f16..a7ec168dae 100644 --- a/src/effects/slidingpopups/slidingpopups.cpp +++ b/src/effects/slidingpopups/slidingpopups.cpp @@ -91,7 +91,6 @@ bool SlidingPopupsEffect::supported() void SlidingPopupsEffect::reconfigure(ReconfigureFlags flags) { - Q_UNUSED(flags) SlidingPopupsConfig::self()->read(); m_slideInDuration = std::chrono::milliseconds( static_cast(animationTime(SlidingPopupsConfig::slideInTime() != 0 ? SlidingPopupsConfig::slideInTime() : 150))); diff --git a/src/effects/snaphelper/snaphelper.cpp b/src/effects/snaphelper/snaphelper.cpp index 4d96ddf4b2..61191a4ed4 100644 --- a/src/effects/snaphelper/snaphelper.cpp +++ b/src/effects/snaphelper/snaphelper.cpp @@ -75,8 +75,6 @@ SnapHelperEffect::~SnapHelperEffect() void SnapHelperEffect::reconfigure(ReconfigureFlags flags) { - Q_UNUSED(flags) - m_animation.timeLine.setDuration( std::chrono::milliseconds(static_cast(animationTime(250)))); } diff --git a/src/effects/startupfeedback/startupfeedback.cpp b/src/effects/startupfeedback/startupfeedback.cpp index 33b1d2e536..e2f1cbab86 100644 --- a/src/effects/startupfeedback/startupfeedback.cpp +++ b/src/effects/startupfeedback/startupfeedback.cpp @@ -88,7 +88,6 @@ StartupFeedbackEffect::StartupFeedbackEffect() Q_EMIT effects->startupAdded(id.id(), icon); }); connect(m_startupInfo, &KStartupInfo::gotRemoveStartup, this, [](const KStartupInfoId &id, const KStartupInfoData &data) { - Q_UNUSED(data); Q_EMIT effects->startupRemoved(id.id()); }); connect(m_startupInfo, &KStartupInfo::gotStartupChange, this, [](const KStartupInfoId &id, const KStartupInfoData &data) { @@ -132,7 +131,6 @@ bool StartupFeedbackEffect::supported() void StartupFeedbackEffect::reconfigure(Effect::ReconfigureFlags flags) { - Q_UNUSED(flags) KConfigGroup c = m_configWatcher->config()->group("FeedbackStyle"); const bool busyCursor = c.readEntry("BusyCursor", true); @@ -247,12 +245,6 @@ void StartupFeedbackEffect::postPaintScreen() void StartupFeedbackEffect::slotMouseChanged(const QPoint &pos, const QPoint &oldpos, Qt::MouseButtons buttons, Qt::MouseButtons oldbuttons, Qt::KeyboardModifiers modifiers, Qt::KeyboardModifiers oldmodifiers) { - Q_UNUSED(pos) - Q_UNUSED(oldpos) - Q_UNUSED(buttons) - Q_UNUSED(oldbuttons) - Q_UNUSED(modifiers) - Q_UNUSED(oldmodifiers) if (m_active) { m_dirtyRect |= m_currentGeometry; m_currentGeometry = feedbackRect(); diff --git a/src/effects/touchpoints/touchpoints.cpp b/src/effects/touchpoints/touchpoints.cpp index 1cca14c4f5..62c032c55c 100644 --- a/src/effects/touchpoints/touchpoints.cpp +++ b/src/effects/touchpoints/touchpoints.cpp @@ -56,7 +56,6 @@ Qt::GlobalColor TouchPointsEffect::colorForId(quint32 id) bool TouchPointsEffect::touchDown(qint32 id, const QPointF &pos, quint32 time) { - Q_UNUSED(time) TouchPoint point; point.pos = pos; point.press = true; @@ -69,7 +68,6 @@ bool TouchPointsEffect::touchDown(qint32 id, const QPointF &pos, quint32 time) bool TouchPointsEffect::touchMotion(qint32 id, const QPointF &pos, quint32 time) { - Q_UNUSED(time) TouchPoint point; point.pos = pos; point.press = true; @@ -82,7 +80,6 @@ bool TouchPointsEffect::touchMotion(qint32 id, const QPointF &pos, quint32 time) bool TouchPointsEffect::touchUp(qint32 id, quint32 time) { - Q_UNUSED(time) auto it = m_latestPositions.constFind(id); if (it != m_latestPositions.constEnd()) { TouchPoint point; diff --git a/src/effects/windowview/windowvieweffect.cpp b/src/effects/windowview/windowvieweffect.cpp index 020abce468..004dbaf6a5 100644 --- a/src/effects/windowview/windowvieweffect.cpp +++ b/src/effects/windowview/windowvieweffect.cpp @@ -221,7 +221,6 @@ void WindowViewEffect::reconfigure(ReconfigureFlags) } auto touchCallback = [this](ElectricBorder border, const QPointF &deltaProgress, const EffectScreen *screen) { - Q_UNUSED(screen) if (m_status == Status::Active) { return; } diff --git a/src/effects/wobblywindows/wobblywindows.cpp b/src/effects/wobblywindows/wobblywindows.cpp index 75102a4743..69b8d4998d 100644 --- a/src/effects/wobblywindows/wobblywindows.cpp +++ b/src/effects/wobblywindows/wobblywindows.cpp @@ -322,7 +322,6 @@ void WobblyWindowsEffect::slotWindowStartUserMovedResized(EffectWindow *w) void WobblyWindowsEffect::slotWindowStepUserMovedResized(EffectWindow *w, const QRectF &geometry) { - Q_UNUSED(geometry) if (windows.contains(w)) { WindowWobblyInfos &wwi = windows[w]; const QRectF rect = w->frameGeometry(); @@ -364,8 +363,6 @@ void WobblyWindowsEffect::slotWindowFinishUserMovedResized(EffectWindow *w) void WobblyWindowsEffect::slotWindowMaximizeStateChanged(EffectWindow *w, bool horizontal, bool vertical) { - Q_UNUSED(horizontal) - Q_UNUSED(vertical) if (w->isUserMove() || w->isSpecialWindow()) { return; } diff --git a/src/gestures.cpp b/src/gestures.cpp index 7475e7881a..8c55b25cc5 100644 --- a/src/gestures.cpp +++ b/src/gestures.cpp @@ -329,8 +329,6 @@ int GestureRecognizer::startPinchGesture(uint fingerCount) void GestureRecognizer::updatePinchGesture(qreal scale, qreal angleDelta, const QPointF &posDelta) { - Q_UNUSED(angleDelta); - Q_UNUSED(posDelta); m_currentScale = scale; // Determine the direction of the swipe diff --git a/src/helpers/wayland_wrapper/kwin_wrapper.cpp b/src/helpers/wayland_wrapper/kwin_wrapper.cpp index 85d00c739b..c1ffd77b40 100644 --- a/src/helpers/wayland_wrapper/kwin_wrapper.cpp +++ b/src/helpers/wayland_wrapper/kwin_wrapper.cpp @@ -119,7 +119,6 @@ void KWinWrapper::run() m_kwinProcess->setArguments(args); connect(m_kwinProcess, QOverload::of(&QProcess::finished), this, [this](int exitCode, QProcess::ExitStatus exitStatus) { - Q_UNUSED(exitStatus) if (exitCode == 0) { qApp->quit(); return; diff --git a/src/hide_cursor_spy.cpp b/src/hide_cursor_spy.cpp index 2a1b6d7155..31dff22890 100644 --- a/src/hide_cursor_spy.cpp +++ b/src/hide_cursor_spy.cpp @@ -16,21 +16,16 @@ namespace KWin void HideCursorSpy::pointerEvent(MouseEvent *event) { - Q_UNUSED(event) showCursor(); } void HideCursorSpy::wheelEvent(KWin::WheelEvent *event) { - Q_UNUSED(event) showCursor(); } void HideCursorSpy::touchDown(qint32 id, const QPointF &pos, quint32 time) { - Q_UNUSED(id) - Q_UNUSED(pos) - Q_UNUSED(time) hideCursor(); } diff --git a/src/input.cpp b/src/input.cpp index 2deb393833..b47589530d 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -105,43 +105,31 @@ InputEventFilter::~InputEventFilter() bool InputEventFilter::pointerEvent(QMouseEvent *event, quint32 nativeButton) { - Q_UNUSED(event) - Q_UNUSED(nativeButton) return false; } bool InputEventFilter::wheelEvent(QWheelEvent *event) { - Q_UNUSED(event) return false; } bool InputEventFilter::keyEvent(QKeyEvent *event) { - Q_UNUSED(event) return false; } bool InputEventFilter::touchDown(qint32 id, const QPointF &point, quint32 time) { - Q_UNUSED(id) - Q_UNUSED(point) - Q_UNUSED(time) return false; } bool InputEventFilter::touchMotion(qint32 id, const QPointF &point, quint32 time) { - Q_UNUSED(id) - Q_UNUSED(point) - Q_UNUSED(time) return false; } bool InputEventFilter::touchUp(qint32 id, quint32 time) { - Q_UNUSED(id) - Q_UNUSED(time) return false; } @@ -157,124 +145,86 @@ bool InputEventFilter::touchFrame() bool InputEventFilter::pinchGestureBegin(int fingerCount, quint32 time) { - Q_UNUSED(fingerCount) - Q_UNUSED(time) return false; } bool InputEventFilter::pinchGestureUpdate(qreal scale, qreal angleDelta, const QPointF &delta, quint32 time) { - Q_UNUSED(scale) - Q_UNUSED(angleDelta) - Q_UNUSED(delta) - Q_UNUSED(time) return false; } bool InputEventFilter::pinchGestureEnd(quint32 time) { - Q_UNUSED(time) return false; } bool InputEventFilter::pinchGestureCancelled(quint32 time) { - Q_UNUSED(time) return false; } bool InputEventFilter::swipeGestureBegin(int fingerCount, quint32 time) { - Q_UNUSED(fingerCount) - Q_UNUSED(time) return false; } bool InputEventFilter::swipeGestureUpdate(const QPointF &delta, quint32 time) { - Q_UNUSED(delta) - Q_UNUSED(time) return false; } bool InputEventFilter::swipeGestureEnd(quint32 time) { - Q_UNUSED(time) return false; } bool InputEventFilter::swipeGestureCancelled(quint32 time) { - Q_UNUSED(time) return false; } bool InputEventFilter::holdGestureBegin(int fingerCount, quint32 time) { - Q_UNUSED(fingerCount) - Q_UNUSED(time) return false; } bool InputEventFilter::holdGestureEnd(quint32 time) { - Q_UNUSED(time) return false; } bool InputEventFilter::holdGestureCancelled(quint32 time) { - Q_UNUSED(time) return false; } bool InputEventFilter::switchEvent(SwitchEvent *event) { - Q_UNUSED(event) return false; } bool InputEventFilter::tabletToolEvent(TabletEvent *event) { - Q_UNUSED(event) return false; } bool InputEventFilter::tabletToolButtonEvent(uint button, bool pressed, const TabletToolId &tabletId, uint time) { - Q_UNUSED(button) - Q_UNUSED(pressed) - Q_UNUSED(tabletId) - Q_UNUSED(time) return false; } bool InputEventFilter::tabletPadButtonEvent(uint button, bool pressed, const TabletPadId &tabletPadId, uint time) { - Q_UNUSED(button) - Q_UNUSED(pressed) - Q_UNUSED(tabletPadId) - Q_UNUSED(time) return false; } bool InputEventFilter::tabletPadStripEvent(int number, int position, bool isFinger, const TabletPadId &tabletPadId, uint time) { - Q_UNUSED(number) - Q_UNUSED(position) - Q_UNUSED(isFinger) - Q_UNUSED(tabletPadId) - Q_UNUSED(time) return false; } bool InputEventFilter::tabletPadRingEvent(int number, int position, bool isFinger, const TabletPadId &tabletPadId, uint time) { - Q_UNUSED(number) - Q_UNUSED(position) - Q_UNUSED(isFinger) - Q_UNUSED(tabletPadId) - Q_UNUSED(time) return false; } @@ -477,69 +427,52 @@ public: } bool pinchGestureBegin(int fingerCount, quint32 time) override { - Q_UNUSED(fingerCount) - Q_UNUSED(time) // no touchpad multi-finger gestures on lock screen return waylandServer()->isScreenLocked(); } bool pinchGestureUpdate(qreal scale, qreal angleDelta, const QPointF &delta, quint32 time) override { - Q_UNUSED(scale) - Q_UNUSED(angleDelta) - Q_UNUSED(delta) - Q_UNUSED(time) // no touchpad multi-finger gestures on lock screen return waylandServer()->isScreenLocked(); } bool pinchGestureEnd(quint32 time) override { - Q_UNUSED(time) // no touchpad multi-finger gestures on lock screen return waylandServer()->isScreenLocked(); } bool pinchGestureCancelled(quint32 time) override { - Q_UNUSED(time) // no touchpad multi-finger gestures on lock screen return waylandServer()->isScreenLocked(); } bool swipeGestureBegin(int fingerCount, quint32 time) override { - Q_UNUSED(fingerCount) - Q_UNUSED(time) // no touchpad multi-finger gestures on lock screen return waylandServer()->isScreenLocked(); } bool swipeGestureUpdate(const QPointF &delta, quint32 time) override { - Q_UNUSED(delta) - Q_UNUSED(time) // no touchpad multi-finger gestures on lock screen return waylandServer()->isScreenLocked(); } bool swipeGestureEnd(quint32 time) override { - Q_UNUSED(time) // no touchpad multi-finger gestures on lock screen return waylandServer()->isScreenLocked(); } bool swipeGestureCancelled(quint32 time) override { - Q_UNUSED(time) // no touchpad multi-finger gestures on lock screen return waylandServer()->isScreenLocked(); } bool holdGestureBegin(int fingerCount, quint32 time) override { - Q_UNUSED(fingerCount) - Q_UNUSED(time) // no touchpad multi-finger gestures on lock screen return waylandServer()->isScreenLocked(); } bool holdGestureEnd(quint32 time) override { - Q_UNUSED(time) // no touchpad multi-finger gestures on lock screen return waylandServer()->isScreenLocked(); } @@ -574,7 +507,6 @@ class EffectsFilter : public InputEventFilter public: bool pointerEvent(QMouseEvent *event, quint32 nativeButton) override { - Q_UNUSED(nativeButton) if (!effects) { return false; } @@ -660,7 +592,6 @@ class MoveResizeFilter : public InputEventFilter public: bool pointerEvent(QMouseEvent *event, quint32 nativeButton) override { - Q_UNUSED(nativeButton) Window *window = workspace()->moveResizeWindow(); if (!window) { return false; @@ -681,7 +612,6 @@ public: } bool wheelEvent(QWheelEvent *event) override { - Q_UNUSED(event) // filter out while moving a window return workspace()->moveResizeWindow() != nullptr; } @@ -703,9 +633,6 @@ public: bool touchDown(qint32 id, const QPointF &pos, quint32 time) override { - Q_UNUSED(id) - Q_UNUSED(pos) - Q_UNUSED(time) Window *window = workspace()->moveResizeWindow(); if (!window) { return false; @@ -715,7 +642,6 @@ public: bool touchMotion(qint32 id, const QPointF &pos, quint32 time) override { - Q_UNUSED(time) Window *window = workspace()->moveResizeWindow(); if (!window) { return false; @@ -732,7 +658,6 @@ public: bool touchUp(qint32 id, quint32 time) override { - Q_UNUSED(time) Window *window = workspace()->moveResizeWindow(); if (!window) { return false; @@ -777,7 +702,6 @@ class WindowSelectorFilter : public InputEventFilter public: bool pointerEvent(QMouseEvent *event, quint32 nativeButton) override { - Q_UNUSED(nativeButton) if (!m_active) { return false; } @@ -798,13 +722,11 @@ public: } bool wheelEvent(QWheelEvent *event) override { - Q_UNUSED(event) // filter out while selecting a window return m_active; } bool keyEvent(QKeyEvent *event) override { - Q_UNUSED(event) if (!m_active) { return false; } @@ -846,7 +768,6 @@ public: bool touchDown(qint32 id, const QPointF &pos, quint32 time) override { - Q_UNUSED(time) if (!isActive()) { return false; } @@ -856,7 +777,6 @@ public: bool touchMotion(qint32 id, const QPointF &pos, quint32 time) override { - Q_UNUSED(time) if (!isActive()) { return false; } @@ -869,7 +789,6 @@ public: bool touchUp(qint32 id, quint32 time) override { - Q_UNUSED(time) if (!isActive()) { return false; } @@ -954,7 +873,6 @@ public: bool pointerEvent(QMouseEvent *event, quint32 nativeButton) override { - Q_UNUSED(nativeButton); if (event->type() == QEvent::MouseButtonPress) { if (input()->shortcuts()->processPointerPressed(event->modifiers(), event->buttons())) { return true; @@ -1009,7 +927,6 @@ public: } bool swipeGestureBegin(int fingerCount, quint32 time) override { - Q_UNUSED(time) m_touchpadGestureFingerCount = fingerCount; if (m_touchpadGestureFingerCount >= 3) { input()->shortcuts()->processSwipeStart(DeviceType::Touchpad, fingerCount); @@ -1020,7 +937,6 @@ public: } bool swipeGestureUpdate(const QPointF &delta, quint32 time) override { - Q_UNUSED(time) if (m_touchpadGestureFingerCount >= 3) { input()->shortcuts()->processSwipeUpdate(DeviceType::Touchpad, delta); return true; @@ -1030,7 +946,6 @@ public: } bool swipeGestureCancelled(quint32 time) override { - Q_UNUSED(time) if (m_touchpadGestureFingerCount >= 3) { input()->shortcuts()->processSwipeCancel(DeviceType::Touchpad); return true; @@ -1040,7 +955,6 @@ public: } bool swipeGestureEnd(quint32 time) override { - Q_UNUSED(time) if (m_touchpadGestureFingerCount >= 3) { input()->shortcuts()->processSwipeEnd(DeviceType::Touchpad); return true; @@ -1050,7 +964,6 @@ public: } bool pinchGestureBegin(int fingerCount, quint32 time) override { - Q_UNUSED(time); m_touchpadGestureFingerCount = fingerCount; if (m_touchpadGestureFingerCount >= 3) { input()->shortcuts()->processPinchStart(fingerCount); @@ -1061,7 +974,6 @@ public: } bool pinchGestureUpdate(qreal scale, qreal angleDelta, const QPointF &delta, quint32 time) override { - Q_UNUSED(time); if (m_touchpadGestureFingerCount >= 3) { input()->shortcuts()->processPinchUpdate(scale, angleDelta, delta); return true; @@ -1071,7 +983,6 @@ public: } bool pinchGestureEnd(quint32 time) override { - Q_UNUSED(time); if (m_touchpadGestureFingerCount >= 3) { input()->shortcuts()->processPinchEnd(); return true; @@ -1081,7 +992,6 @@ public: } bool pinchGestureCancelled(quint32 time) override { - Q_UNUSED(time); if (m_touchpadGestureFingerCount >= 3) { input()->shortcuts()->processPinchCancel(); return true; @@ -1135,7 +1045,6 @@ public: bool touchMotion(qint32 id, const QPointF &pos, quint32 time) override { - Q_UNUSED(time); if (m_gestureTaken) { if (m_gestureCancelled) { return true; @@ -1156,7 +1065,6 @@ public: bool touchUp(qint32 id, quint32 time) override { - Q_UNUSED(time); m_touchPoints.remove(id); if (m_gestureTaken) { if (!m_gestureCancelled) { @@ -1267,7 +1175,6 @@ class InternalWindowEventFilter : public InputEventFilter { bool pointerEvent(QMouseEvent *event, quint32 nativeButton) override { - Q_UNUSED(nativeButton) if (!input()->pointer()->focus() || !input()->pointer()->focus()->isInternal()) { return false; } @@ -1438,7 +1345,6 @@ class DecorationEventFilter : public InputEventFilter public: bool pointerEvent(QMouseEvent *event, quint32 nativeButton) override { - Q_UNUSED(nativeButton) auto decoration = input()->pointer()->decoration(); if (!decoration) { return false; @@ -1540,7 +1446,6 @@ public: } bool touchMotion(qint32 id, const QPointF &pos, quint32 time) override { - Q_UNUSED(time) auto decoration = input()->touch()->decoration(); if (!decoration) { return false; @@ -1562,7 +1467,6 @@ public: } bool touchUp(qint32 id, quint32 time) override { - Q_UNUSED(time); auto decoration = input()->touch()->decoration(); if (!decoration) { // can happen when quick tiling @@ -1653,7 +1557,6 @@ class TabBoxInputFilter : public InputEventFilter public: bool pointerEvent(QMouseEvent *event, quint32 button) override { - Q_UNUSED(button) if (!workspace()->tabbox() || !workspace()->tabbox()->isGrabbed()) { return false; } @@ -1693,14 +1596,12 @@ class ScreenEdgeInputFilter : public InputEventFilter public: bool pointerEvent(QMouseEvent *event, quint32 nativeButton) override { - Q_UNUSED(nativeButton) workspace()->screenEdges()->isEntered(event); // always forward return false; } bool touchDown(qint32 id, const QPointF &pos, quint32 time) override { - Q_UNUSED(time) // TODO: better check whether a touch sequence is in progress if (m_touchInProgress || waylandServer()->seat()->isTouchSequence()) { // cancel existing touch @@ -1719,7 +1620,6 @@ public: } bool touchMotion(qint32 id, const QPointF &pos, quint32 time) override { - Q_UNUSED(time) if (m_touchInProgress && m_id == id) { workspace()->screenEdges()->gestureRecognizer()->updateSwipeGesture(pos - m_lastPos); m_lastPos = pos; @@ -1729,7 +1629,6 @@ public: } bool touchUp(qint32 id, quint32 time) override { - Q_UNUSED(time) if (m_touchInProgress && m_id == id) { workspace()->screenEdges()->gestureRecognizer()->endSwipeGesture(); m_touchInProgress = false; @@ -1753,7 +1652,6 @@ class WindowActionInputFilter : public InputEventFilter public: bool pointerEvent(QMouseEvent *event, quint32 nativeButton) override { - Q_UNUSED(nativeButton) if (event->type() != QEvent::MouseButtonPress) { return false; } @@ -1785,8 +1683,6 @@ public: } bool touchDown(qint32 id, const QPointF &pos, quint32 time) override { - Q_UNUSED(id) - Q_UNUSED(time) auto seat = waylandServer()->seat(); if (seat->isTouchSequence()) { return false; @@ -2344,7 +2240,6 @@ public: bool tabletToolButtonEvent(uint button, bool pressed, const TabletToolId &tabletToolId, uint time) override { - Q_UNUSED(time) KWaylandServer::TabletSeatV2Interface *tabletSeat = findTabletSeat(); auto tool = tabletSeat->toolByHardwareSerial(tabletToolId.m_serialId, getType(tabletToolId)); if (!tool) { @@ -2737,7 +2632,6 @@ public: void tabletPadButtonEvent(uint, bool pressed, const KWin::TabletPadId &, uint time) override { - Q_UNUSED(time) if (!pressed) { return; } @@ -2746,7 +2640,6 @@ public: void tabletToolButtonEvent(uint, bool pressed, const KWin::TabletToolId &, uint time) override { - Q_UNUSED(time) if (!pressed) { return; } @@ -2781,144 +2674,96 @@ class UserActivitySpy : public InputEventSpy public: void pointerEvent(MouseEvent *event) override { - Q_UNUSED(event) notifyActivity(); } void wheelEvent(WheelEvent *event) override { - Q_UNUSED(event) notifyActivity(); } void keyEvent(KeyEvent *event) override { - Q_UNUSED(event) notifyActivity(); } void touchDown(qint32 id, const QPointF &pos, quint32 time) override { - Q_UNUSED(id) - Q_UNUSED(pos) - Q_UNUSED(time) notifyActivity(); } void touchMotion(qint32 id, const QPointF &pos, quint32 time) override { - Q_UNUSED(id) - Q_UNUSED(pos) - Q_UNUSED(time) notifyActivity(); } void touchUp(qint32 id, quint32 time) override { - Q_UNUSED(id) - Q_UNUSED(time) notifyActivity(); } void pinchGestureBegin(int fingerCount, quint32 time) override { - Q_UNUSED(fingerCount) - Q_UNUSED(time) notifyActivity(); } void pinchGestureUpdate(qreal scale, qreal angleDelta, const QPointF &delta, quint32 time) override { - Q_UNUSED(scale) - Q_UNUSED(angleDelta) - Q_UNUSED(delta) - Q_UNUSED(time) notifyActivity(); } void pinchGestureEnd(quint32 time) override { - Q_UNUSED(time) notifyActivity(); } void pinchGestureCancelled(quint32 time) override { - Q_UNUSED(time) notifyActivity(); } void swipeGestureBegin(int fingerCount, quint32 time) override { - Q_UNUSED(fingerCount) - Q_UNUSED(time) notifyActivity(); } void swipeGestureUpdate(const QPointF &delta, quint32 time) override { - Q_UNUSED(delta) - Q_UNUSED(time) notifyActivity(); } void swipeGestureEnd(quint32 time) override { - Q_UNUSED(time) notifyActivity(); } void swipeGestureCancelled(quint32 time) override { - Q_UNUSED(time) notifyActivity(); } void holdGestureBegin(int fingerCount, quint32 time) override { - Q_UNUSED(fingerCount) - Q_UNUSED(time) notifyActivity(); } void holdGestureEnd(quint32 time) override { - Q_UNUSED(time) notifyActivity(); } void holdGestureCancelled(quint32 time) override { - Q_UNUSED(time) notifyActivity(); } void tabletToolEvent(TabletEvent *event) override { - Q_UNUSED(event) notifyActivity(); } void tabletToolButtonEvent(uint button, bool pressed, const TabletToolId &tabletToolId, uint time) override { - Q_UNUSED(button) - Q_UNUSED(pressed) - Q_UNUSED(tabletToolId) - Q_UNUSED(time) notifyActivity(); } void tabletPadButtonEvent(uint button, bool pressed, const TabletPadId &tabletPadId, uint time) override { - Q_UNUSED(button) - Q_UNUSED(pressed) - Q_UNUSED(tabletPadId) - Q_UNUSED(time) notifyActivity(); } void tabletPadStripEvent(int number, int position, bool isFinger, const TabletPadId &tabletPadId, uint time) override { - Q_UNUSED(number) - Q_UNUSED(position) - Q_UNUSED(isFinger) - Q_UNUSED(tabletPadId) - Q_UNUSED(time) notifyActivity(); } void tabletPadRingEvent(int number, int position, bool isFinger, const TabletPadId &tabletPadId, uint time) override { - Q_UNUSED(number) - Q_UNUSED(position) - Q_UNUSED(isFinger) - Q_UNUSED(tabletPadId) - Q_UNUSED(time) notifyActivity(); } diff --git a/src/input_event_spy.cpp b/src/input_event_spy.cpp index 1413641311..f6881555e2 100644 --- a/src/input_event_spy.cpp +++ b/src/input_event_spy.cpp @@ -25,142 +25,93 @@ InputEventSpy::~InputEventSpy() void InputEventSpy::pointerEvent(MouseEvent *event) { - Q_UNUSED(event) } void InputEventSpy::wheelEvent(WheelEvent *event) { - Q_UNUSED(event) } void InputEventSpy::keyEvent(KeyEvent *event) { - Q_UNUSED(event) } void InputEventSpy::touchDown(qint32 id, const QPointF &point, quint32 time) { - Q_UNUSED(id) - Q_UNUSED(point) - Q_UNUSED(time) } void InputEventSpy::touchMotion(qint32 id, const QPointF &point, quint32 time) { - Q_UNUSED(id) - Q_UNUSED(point) - Q_UNUSED(time) } void InputEventSpy::touchUp(qint32 id, quint32 time) { - Q_UNUSED(id) - Q_UNUSED(time) } void InputEventSpy::pinchGestureBegin(int fingerCount, quint32 time) { - Q_UNUSED(fingerCount) - Q_UNUSED(time) } void InputEventSpy::pinchGestureUpdate(qreal scale, qreal angleDelta, const QPointF &delta, quint32 time) { - Q_UNUSED(scale) - Q_UNUSED(angleDelta) - Q_UNUSED(delta) - Q_UNUSED(time) } void InputEventSpy::pinchGestureEnd(quint32 time) { - Q_UNUSED(time) } void InputEventSpy::pinchGestureCancelled(quint32 time) { - Q_UNUSED(time) } void InputEventSpy::swipeGestureBegin(int fingerCount, quint32 time) { - Q_UNUSED(fingerCount) - Q_UNUSED(time) } void InputEventSpy::swipeGestureUpdate(const QPointF &delta, quint32 time) { - Q_UNUSED(delta) - Q_UNUSED(time) } void InputEventSpy::swipeGestureEnd(quint32 time) { - Q_UNUSED(time) } void InputEventSpy::swipeGestureCancelled(quint32 time) { - Q_UNUSED(time) } void InputEventSpy::holdGestureBegin(int fingerCount, quint32 time) { - Q_UNUSED(fingerCount) - Q_UNUSED(time) } void InputEventSpy::holdGestureEnd(quint32 time) { - Q_UNUSED(time) } void InputEventSpy::holdGestureCancelled(quint32 time) { - Q_UNUSED(time) } void InputEventSpy::switchEvent(SwitchEvent *event) { - Q_UNUSED(event) } void InputEventSpy::tabletToolEvent(TabletEvent *event) { - Q_UNUSED(event) } void InputEventSpy::tabletToolButtonEvent(uint button, bool pressed, const TabletToolId &tabletToolId, uint time) { - Q_UNUSED(button) - Q_UNUSED(pressed) - Q_UNUSED(tabletToolId) - Q_UNUSED(time) } void InputEventSpy::tabletPadButtonEvent(uint button, bool pressed, const TabletPadId &tabletPadId, uint time) { - Q_UNUSED(button) - Q_UNUSED(pressed) - Q_UNUSED(tabletPadId) - Q_UNUSED(time) } void InputEventSpy::tabletPadStripEvent(int number, int position, bool isFinger, const TabletPadId &tabletPadId, uint time) { - Q_UNUSED(number) - Q_UNUSED(position) - Q_UNUSED(isFinger) - Q_UNUSED(tabletPadId) - Q_UNUSED(time) } void InputEventSpy::tabletPadRingEvent(int number, int position, bool isFinger, const TabletPadId &tabletPadId, uint time) { - Q_UNUSED(number) - Q_UNUSED(position) - Q_UNUSED(isFinger) - Q_UNUSED(tabletPadId) - Q_UNUSED(time) } } diff --git a/src/inputmethod.cpp b/src/inputmethod.cpp index d3d62f26a3..afda4c4237 100644 --- a/src/inputmethod.cpp +++ b/src/inputmethod.cpp @@ -314,7 +314,6 @@ void InputMethod::textInputInterfaceV2StateUpdated(quint32 serial, KWaylandServe if (!m_enabled) { return; } - Q_UNUSED(serial); auto t2 = waylandServer()->seat()->textInputV2(); auto inputContext = waylandServer()->inputMethod()->context(); @@ -434,8 +433,6 @@ static quint32 keysymToKeycode(quint32 sym) void InputMethod::keysymReceived(quint32 serial, quint32 time, quint32 sym, bool pressed, quint32 modifiers) { - Q_UNUSED(serial) - Q_UNUSED(time) auto t2 = waylandServer()->seat()->textInputV2(); if (t2 && t2->isEnabled()) { if (pressed) { @@ -457,7 +454,6 @@ void InputMethod::keysymReceived(quint32 serial, quint32 time, quint32 sym, bool void InputMethod::commitString(qint32 serial, const QString &text) { - Q_UNUSED(serial) if (auto t2 = waylandServer()->seat()->textInputV2(); t2 && t2->isEnabled()) { t2->commitString(text.toUtf8()); t2->preEdit({}, {}); @@ -533,7 +529,6 @@ void InputMethod::setCursorPosition(qint32 index, qint32 anchor) void InputMethod::setLanguage(uint32_t serial, const QString &language) { - Q_UNUSED(serial) auto t2 = waylandServer()->seat()->textInputV2(); if (t2 && t2->isEnabled()) { t2->setLanguage(language.toUtf8()); @@ -542,7 +537,6 @@ void InputMethod::setLanguage(uint32_t serial, const QString &language) void InputMethod::setTextDirection(uint32_t serial, Qt::LayoutDirection direction) { - Q_UNUSED(serial) auto t2 = waylandServer()->seat()->textInputV2(); if (t2 && t2->isEnabled()) { t2->setTextDirection(direction); @@ -578,7 +572,6 @@ void InputMethod::setPreeditStyling(quint32 index, quint32 length, quint32 style void InputMethod::setPreeditString(uint32_t serial, const QString &text, const QString &commit) { - Q_UNUSED(serial) auto t2 = waylandServer()->seat()->textInputV2(); if (t2 && t2->isEnabled()) { t2->preEdit(text.toUtf8(), commit.toUtf8()); @@ -626,7 +619,6 @@ void InputMethod::key(quint32 /*serial*/, quint32 /*time*/, quint32 keyCode, boo void InputMethod::modifiers(quint32 serial, quint32 mods_depressed, quint32 mods_latched, quint32 mods_locked, quint32 group) { - Q_UNUSED(serial) auto xkb = input()->keyboard()->xkb(); xkb->updateModifiers(mods_depressed, mods_latched, mods_locked, group); } diff --git a/src/inputpanelv1window.cpp b/src/inputpanelv1window.cpp index 719aaf028d..279801dfe9 100644 --- a/src/inputpanelv1window.cpp +++ b/src/inputpanelv1window.cpp @@ -52,7 +52,6 @@ void InputPanelV1Window::showOverlayPanel() void InputPanelV1Window::showTopLevel(OutputInterface *output, InputPanelSurfaceV1Interface::Position position) { - Q_UNUSED(position); m_mode = Mode::VirtualKeyboard; setOutput(output); maybeShow(); @@ -191,7 +190,6 @@ void InputPanelV1Window::setOutput(OutputInterface *outputIface) void InputPanelV1Window::moveResizeInternal(const QRectF &rect, MoveResizeMode mode) { - Q_UNUSED(mode) updateGeometry(rect); } diff --git a/src/internalwindow.cpp b/src/internalwindow.cpp index b17535b66f..4aed3e9d47 100644 --- a/src/internalwindow.cpp +++ b/src/internalwindow.cpp @@ -160,8 +160,6 @@ QSizeF InternalWindow::maxSize() const NET::WindowType InternalWindow::windowType(bool direct, int supported_types) const { - Q_UNUSED(direct) - Q_UNUSED(supported_types) return m_windowType; } @@ -295,7 +293,6 @@ void InternalWindow::moveResizeInternal(const QRectF &rect, MoveResizeMode mode) Window *InternalWindow::findModal(bool allow_itself) { - Q_UNUSED(allow_itself) return nullptr; } @@ -435,7 +432,6 @@ bool InternalWindow::acceptsFocus() const bool InternalWindow::belongsToSameApplication(const Window *other, SameApplicationChecks checks) const { - Q_UNUSED(checks) const InternalWindow *otherInternal = qobject_cast(other); if (!otherInternal) { return false; diff --git a/src/kcmkwin/common/effectsmodel.cpp b/src/kcmkwin/common/effectsmodel.cpp index a7e9597252..5f46b781d8 100644 --- a/src/kcmkwin/common/effectsmodel.cpp +++ b/src/kcmkwin/common/effectsmodel.cpp @@ -113,13 +113,11 @@ QModelIndex EffectsModel::index(int row, int column, const QModelIndex &parent) QModelIndex EffectsModel::parent(const QModelIndex &child) const { - Q_UNUSED(child) return {}; } int EffectsModel::columnCount(const QModelIndex &parent) const { - Q_UNUSED(parent) return 1; } @@ -651,7 +649,6 @@ void EffectsModel::requestConfigure(const QModelIndex &index, QWindow *transient bool EffectsModel::shouldStore(const EffectData &data) const { - Q_UNUSED(data) return true; } diff --git a/src/kcmkwin/kwindecoration/declarative-plugin/previewclient.cpp b/src/kcmkwin/kwindecoration/declarative-plugin/previewclient.cpp index 1e92a3bf61..ab73da9593 100644 --- a/src/kcmkwin/kwindecoration/declarative-plugin/previewclient.cpp +++ b/src/kcmkwin/kwindecoration/declarative-plugin/previewclient.cpp @@ -339,7 +339,6 @@ void PreviewClient::setBordersTopEdge(bool enabled) void PreviewClient::requestShowToolTip(const QString &text) { - Q_UNUSED(text); } void PreviewClient::requestHideToolTip() @@ -385,19 +384,15 @@ void PreviewClient::requestToggleKeepBelow() void PreviewClient::requestShowWindowMenu(const QRect &rect) { - Q_UNUSED(rect) Q_EMIT showWindowMenuRequested(); } void PreviewClient::requestShowApplicationMenu(const QRect &rect, int actionId) { - Q_UNUSED(rect); - Q_UNUSED(actionId); } void PreviewClient::showApplicationMenu(int actionId) { - Q_UNUSED(actionId) } void PreviewClient::requestToggleOnAllDesktops() diff --git a/src/kcmkwin/kwinrules/rulebookmodel.cpp b/src/kcmkwin/kwinrules/rulebookmodel.cpp index 26dc070683..8bb4f98fe6 100644 --- a/src/kcmkwin/kwinrules/rulebookmodel.cpp +++ b/src/kcmkwin/kwinrules/rulebookmodel.cpp @@ -28,7 +28,6 @@ QHash RuleBookModel::roleNames() const int RuleBookModel::rowCount(const QModelIndex &parent) const { - Q_UNUSED(parent) return m_ruleBook->ruleCount(); } diff --git a/src/kcmkwin/kwinscreenedges/monitor.cpp b/src/kcmkwin/kwinscreenedges/monitor.cpp index 2318253c60..9e41c34828 100644 --- a/src/kcmkwin/kwinscreenedges/monitor.cpp +++ b/src/kcmkwin/kwinscreenedges/monitor.cpp @@ -255,9 +255,6 @@ void Monitor::Corner::mousePressEvent(QGraphicsSceneMouseEvent *e) void Monitor::Corner::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { - Q_UNUSED(option) - Q_UNUSED(widget) - if (m_hover) { button->setElementPrefix("normal"); @@ -290,14 +287,12 @@ void Monitor::Corner::paint(QPainter *painter, const QStyleOptionGraphicsItem *o void Monitor::Corner::hoverEnterEvent(QGraphicsSceneHoverEvent *e) { - Q_UNUSED(e); m_hover = true; update(); } void Monitor::Corner::hoverLeaveEvent(QGraphicsSceneHoverEvent *e) { - Q_UNUSED(e); m_hover = false; update(); } diff --git a/src/kcmkwin/kwinscreenedges/screenpreviewwidget.cpp b/src/kcmkwin/kwinscreenedges/screenpreviewwidget.cpp index b792664899..db8aa35313 100644 --- a/src/kcmkwin/kwinscreenedges/screenpreviewwidget.cpp +++ b/src/kcmkwin/kwinscreenedges/screenpreviewwidget.cpp @@ -107,13 +107,11 @@ QRect ScreenPreviewWidget::previewRect() const void ScreenPreviewWidget::resizeEvent(QResizeEvent *e) { - Q_UNUSED(e) d->updateScreenGraphics(); } void ScreenPreviewWidget::paintEvent(QPaintEvent *event) { - Q_UNUSED(event) if (d->monitorRect.size().isEmpty()) { return; } diff --git a/src/kcmkwin/kwintabbox/layoutpreview.cpp b/src/kcmkwin/kwintabbox/layoutpreview.cpp index 59779770de..63f3b5fb85 100644 --- a/src/kcmkwin/kwintabbox/layoutpreview.cpp +++ b/src/kcmkwin/kwintabbox/layoutpreview.cpp @@ -182,7 +182,6 @@ QString ExampleClientModel::longestCaption() const int ExampleClientModel::rowCount(const QModelIndex &parent) const { - Q_UNUSED(parent) return m_thumbnails.size(); } diff --git a/src/kcmkwin/kwintabbox/thumbnailitem.cpp b/src/kcmkwin/kwintabbox/thumbnailitem.cpp index 5efb49df97..ea34086a2b 100644 --- a/src/kcmkwin/kwintabbox/thumbnailitem.cpp +++ b/src/kcmkwin/kwintabbox/thumbnailitem.cpp @@ -42,7 +42,6 @@ void WindowThumbnailItem::setWId(qulonglong wId) void WindowThumbnailItem::setClipTo(QQuickItem *clip) { - Q_UNUSED(clip) qWarning() << "ThumbnailItem.clipTo is removed and it has no replacements"; } @@ -83,7 +82,6 @@ void WindowThumbnailItem::findImage() QSGNode *WindowThumbnailItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData) { - Q_UNUSED(updatePaintNodeData) auto *node = static_cast(oldNode); if (!node) { node = window()->createImageNode(); @@ -120,13 +118,11 @@ QSize WindowThumbnailItem::sourceSize() const void WindowThumbnailItem::setBrightness(qreal brightness) { - Q_UNUSED(brightness) qWarning() << "ThumbnailItem.brightness is removed. Use a shader effect to change brightness"; } void WindowThumbnailItem::setSaturation(qreal saturation) { - Q_UNUSED(saturation) qWarning() << "ThumbnailItem.saturation is removed. Use a shader effect to change saturation"; } diff --git a/src/kcmkwin/kwinvirtualkeyboard/kcmvirtualkeyboard.cpp b/src/kcmkwin/kwinvirtualkeyboard/kcmvirtualkeyboard.cpp index 77f293dcc7..42289bd8df 100644 --- a/src/kcmkwin/kwinvirtualkeyboard/kcmvirtualkeyboard.cpp +++ b/src/kcmkwin/kwinvirtualkeyboard/kcmvirtualkeyboard.cpp @@ -23,8 +23,6 @@ KcmVirtualKeyboard::KcmVirtualKeyboard(QObject *parent, const QVariantList &args , m_data(new VirtualKeyboardData(this)) , m_model(new VirtualKeyboardsModel(this)) { - Q_UNUSED(args) - qmlRegisterAnonymousType("org.kde.kwin.virtualkeyboardsettings", 1); setAboutData(new KAboutData(QStringLiteral("kcm_virtualkeyboard"), diff --git a/src/keyboard_layout_switching.cpp b/src/keyboard_layout_switching.cpp index dc59484435..e5faa1f210 100644 --- a/src/keyboard_layout_switching.cpp +++ b/src/keyboard_layout_switching.cpp @@ -79,7 +79,6 @@ GlobalPolicy::GlobalPolicy(Xkb *xkb, KeyboardLayout *_layout, const KConfigGroup : Policy(xkb, _layout, config) { connect(workspace()->sessionManager(), &SessionManager::prepareSessionSaveRequested, this, [this, xkb](const QString &name) { - Q_UNUSED(name) clearLayouts(); if (const uint layout = xkb->currentLayout()) { m_config.writeEntry(defaultLayoutEntryKey(), layout); @@ -87,7 +86,6 @@ GlobalPolicy::GlobalPolicy(Xkb *xkb, KeyboardLayout *_layout, const KConfigGroup }); connect(workspace()->sessionManager(), &SessionManager::loadSessionRequested, this, [this, xkb](const QString &name) { - Q_UNUSED(name) if (xkb->numberOfLayouts() > 1) { setLayout(m_config.readEntry(defaultLayoutEntryKey(), 0)); } @@ -103,7 +101,6 @@ VirtualDesktopPolicy::VirtualDesktopPolicy(Xkb *xkb, KeyboardLayout *layout, con this, &VirtualDesktopPolicy::desktopChanged); connect(workspace()->sessionManager(), &SessionManager::prepareSessionSaveRequested, this, [this](const QString &name) { - Q_UNUSED(name) clearLayouts(); for (auto i = m_layouts.constBegin(); i != m_layouts.constEnd(); ++i) { @@ -114,7 +111,6 @@ VirtualDesktopPolicy::VirtualDesktopPolicy(Xkb *xkb, KeyboardLayout *layout, con }); connect(workspace()->sessionManager(), &SessionManager::loadSessionRequested, this, [this, xkb](const QString &name) { - Q_UNUSED(name) if (xkb->numberOfLayouts() > 1) { const auto &desktops = VirtualDesktopManager::self()->desktops(); for (KWin::VirtualDesktop *const desktop : desktops) { @@ -236,7 +232,6 @@ ApplicationPolicy::ApplicationPolicy(KWin::Xkb *xkb, KWin::KeyboardLayout *layou connect(workspace(), &Workspace::windowActivated, this, &ApplicationPolicy::windowActivated); connect(workspace()->sessionManager(), &SessionManager::prepareSessionSaveRequested, this, [this](const QString &name) { - Q_UNUSED(name) clearLayouts(); for (auto i = m_layouts.constBegin(); i != m_layouts.constEnd(); ++i) { @@ -250,7 +245,6 @@ ApplicationPolicy::ApplicationPolicy(KWin::Xkb *xkb, KWin::KeyboardLayout *layou }); connect(workspace()->sessionManager(), &SessionManager::loadSessionRequested, this, [this, xkb](const QString &name) { - Q_UNUSED(name) if (xkb->numberOfLayouts() > 1) { const QString keyPrefix = defaultLayoutEntryKey(); const QStringList keyList = m_config.keyList().filter(keyPrefix); diff --git a/src/keyboard_layout_switching.h b/src/keyboard_layout_switching.h index 4e740fee85..9ed0a0553d 100644 --- a/src/keyboard_layout_switching.h +++ b/src/keyboard_layout_switching.h @@ -71,7 +71,6 @@ protected: } void layoutChanged(uint index) override { - Q_UNUSED(index) } private: diff --git a/src/libkwineffects/kwinanimationeffect.cpp b/src/libkwineffects/kwinanimationeffect.cpp index 6c78ea13b9..bd2de8ec9d 100644 --- a/src/libkwineffects/kwinanimationeffect.cpp +++ b/src/libkwineffects/kwinanimationeffect.cpp @@ -431,6 +431,14 @@ bool AnimationEffect::cancel(quint64 animationId) return false; } +void AnimationEffect::animationEnded(EffectWindow *w, Attribute a, uint meta) +{ +} + +void AnimationEffect::genericAnimation(EffectWindow *w, WindowPaintData &data, float progress, uint meta) +{ +} + void AnimationEffect::prePaintScreen(ScreenPrePaintData &data, std::chrono::milliseconds presentTime) { Q_D(AnimationEffect); diff --git a/src/libkwineffects/kwinanimationeffect.h b/src/libkwineffects/kwinanimationeffect.h index c938566d0a..f666e8c19a 100644 --- a/src/libkwineffects/kwinanimationeffect.h +++ b/src/libkwineffects/kwinanimationeffect.h @@ -466,12 +466,7 @@ protected: * @param meta Originally supplied metadata to animate() or set(). * @since 4.8 */ - virtual void animationEnded(EffectWindow *w, Attribute a, uint meta) - { - Q_UNUSED(w); - Q_UNUSED(a); - Q_UNUSED(meta); - } + virtual void animationEnded(EffectWindow *w, Attribute a, uint meta); /** * Cancels a running animation. @@ -499,13 +494,7 @@ protected: * @param meta The metadata. * @since 4.8 */ - virtual void genericAnimation(EffectWindow *w, WindowPaintData &data, float progress, uint meta) - { - Q_UNUSED(w); - Q_UNUSED(data); - Q_UNUSED(progress); - Q_UNUSED(meta); - } + virtual void genericAnimation(EffectWindow *w, WindowPaintData &data, float progress, uint meta); /** * @internal diff --git a/src/libkwineffects/kwineffects.cpp b/src/libkwineffects/kwineffects.cpp index d03ff725d1..9d527812e6 100644 --- a/src/libkwineffects/kwineffects.cpp +++ b/src/libkwineffects/kwineffects.cpp @@ -602,71 +602,46 @@ xcb_window_t Effect::x11RootWindow() const bool Effect::touchDown(qint32 id, const QPointF &pos, quint32 time) { - Q_UNUSED(id) - Q_UNUSED(pos) - Q_UNUSED(time) return false; } bool Effect::touchMotion(qint32 id, const QPointF &pos, quint32 time) { - Q_UNUSED(id) - Q_UNUSED(pos) - Q_UNUSED(time) return false; } bool Effect::touchUp(qint32 id, quint32 time) { - Q_UNUSED(id) - Q_UNUSED(time) return false; } bool Effect::perform(Feature feature, const QVariantList &arguments) { - Q_UNUSED(feature) - Q_UNUSED(arguments) return false; } bool Effect::tabletToolEvent(QTabletEvent *event) { - Q_UNUSED(event) return false; } bool Effect::tabletToolButtonEvent(uint button, bool pressed, quint64 tabletToolId) { - Q_UNUSED(button) - Q_UNUSED(pressed) - Q_UNUSED(tabletToolId) return false; } bool Effect::tabletPadButtonEvent(uint button, bool pressed, void *tabletPadId) { - Q_UNUSED(button) - Q_UNUSED(pressed) - Q_UNUSED(tabletPadId) return false; } bool Effect::tabletPadStripEvent(int number, int position, bool isFinger, void *tabletPadId) { - Q_UNUSED(number) - Q_UNUSED(position) - Q_UNUSED(isFinger) - Q_UNUSED(tabletPadId) return false; } bool Effect::tabletPadRingEvent(int number, int position, bool isFinger, void *tabletPadId) { - Q_UNUSED(number) - Q_UNUSED(position) - Q_UNUSED(isFinger) - Q_UNUSED(tabletPadId) return false; } @@ -1474,7 +1449,6 @@ QRectF WindowMotionManager::targetGeometry(EffectWindow *w) const EffectWindow *WindowMotionManager::windowAtPoint(QPoint point, bool useStackingOrder) const { - Q_UNUSED(useStackingOrder); // TODO: Stacking order uses EffectsHandler::stackingOrder() then filters by m_managedWindows QHash::ConstIterator it = m_managedWindows.constBegin(); while (it != m_managedWindows.constEnd()) { diff --git a/src/libkwineffects/kwinglutils.cpp b/src/libkwineffects/kwinglutils.cpp index cf1534492e..82e09a4d19 100644 --- a/src/libkwineffects/kwinglutils.cpp +++ b/src/libkwineffects/kwinglutils.cpp @@ -86,9 +86,6 @@ static void initDebugOutput() GLenum severity, GLsizei length, const GLchar *message, const GLvoid *userParam) { - Q_UNUSED(source) - Q_UNUSED(severity) - Q_UNUSED(userParam) while (length && std::isspace(message[length - 1])) { --length; } @@ -303,7 +300,6 @@ bool GLShader::link() const QByteArray GLShader::prepareSource(GLenum shaderType, const QByteArray &source) const { - Q_UNUSED(shaderType) // Prepare the source code QByteArray ba; if (GLPlatform::instance()->isGLES() && GLPlatform::instance()->glslVersion() < kVersionNumber(3, 0)) { diff --git a/src/libkwineffects/kwinglutils_funcs.cpp b/src/libkwineffects/kwinglutils_funcs.cpp index 96ae0ca06a..9fb7508861 100644 --- a/src/libkwineffects/kwinglutils_funcs.cpp +++ b/src/libkwineffects/kwinglutils_funcs.cpp @@ -77,13 +77,11 @@ static GLenum GetGraphicsResetStatus() static void ReadnPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *data) { - Q_UNUSED(bufSize) glReadPixels(x, y, width, height, format, type, data); } static void GetnUniformfv(GLuint program, GLint location, GLsizei bufSize, GLfloat *params) { - Q_UNUSED(bufSize) glGetUniformfv(program, location, params); } diff --git a/src/libkwineffects/kwinoffscreeneffect.cpp b/src/libkwineffects/kwinoffscreeneffect.cpp index 7444a3d2e7..3f699356ed 100644 --- a/src/libkwineffects/kwinoffscreeneffect.cpp +++ b/src/libkwineffects/kwinoffscreeneffect.cpp @@ -77,10 +77,6 @@ void OffscreenEffect::unredirect(EffectWindow *window) void OffscreenEffect::apply(EffectWindow *window, int mask, WindowPaintData &data, WindowQuadList &quads) { - Q_UNUSED(window) - Q_UNUSED(mask) - Q_UNUSED(data) - Q_UNUSED(quads) } void OffscreenData::maybeRender(EffectWindow *window) @@ -279,8 +275,6 @@ CrossFadeEffect::~CrossFadeEffect() void CrossFadeEffect::drawWindow(EffectWindow *window, int mask, const QRegion ®ion, WindowPaintData &data) { - Q_UNUSED(mask) - CrossFadeWindowData *offscreenData = d->windows.value(window); // paint the new window (if applicable) underneath diff --git a/src/libkwineffects/kwinquickeffect.cpp b/src/libkwineffects/kwinquickeffect.cpp index 1cff338108..7e46c7117e 100644 --- a/src/libkwineffects/kwinquickeffect.cpp +++ b/src/libkwineffects/kwinquickeffect.cpp @@ -299,8 +299,6 @@ void QuickSceneEffect::activateView(QuickSceneView *view) // Screen views are repainted just before kwin performs its compositing cycle to avoid stalling for vblank void QuickSceneEffect::prePaintScreen(ScreenPrePaintData &data, std::chrono::milliseconds presentTime) { - Q_UNUSED(presentTime) - if (effects->waylandDisplay()) { QuickSceneView *screenView = d->views.value(data.screen); if (screenView && screenView->isDirty()) { @@ -319,9 +317,6 @@ void QuickSceneEffect::prePaintScreen(ScreenPrePaintData &data, std::chrono::mil void QuickSceneEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintData &data) { - Q_UNUSED(mask) - Q_UNUSED(region) - if (effects->waylandDisplay()) { QuickSceneView *screenView = d->views.value(data.screen()); if (screenView) { @@ -341,7 +336,6 @@ bool QuickSceneEffect::isActive() const QVariantMap QuickSceneEffect::initialProperties(EffectScreen *screen) { - Q_UNUSED(screen) return QVariantMap(); } diff --git a/src/linux_dmabuf.cpp b/src/linux_dmabuf.cpp index f02d9c8f29..03dffffc2c 100644 --- a/src/linux_dmabuf.cpp +++ b/src/linux_dmabuf.cpp @@ -39,9 +39,6 @@ LinuxDmaBufV1RendererInterface::~LinuxDmaBufV1RendererInterface() KWaylandServer::LinuxDmaBufV1ClientBuffer *LinuxDmaBufV1RendererInterface::importBuffer(DmaBufAttributes &&attrs, quint32 flags) { - Q_UNUSED(attrs) - Q_UNUSED(flags) - return nullptr; } diff --git a/src/main.cpp b/src/main.cpp index 1a2641372f..7259309e88 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -574,7 +574,6 @@ bool XcbEventFilter::nativeEventFilter(const QByteArray &eventType, void *messag bool XcbEventFilter::nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) #endif { - Q_UNUSED(result) if (eventType == "xcb_generic_event_t") { return kwinApp()->dispatchEvent(static_cast(message)); } diff --git a/src/modifier_only_shortcuts.cpp b/src/modifier_only_shortcuts.cpp index 32c8a85d9c..09e28134fe 100644 --- a/src/modifier_only_shortcuts.cpp +++ b/src/modifier_only_shortcuts.cpp @@ -89,7 +89,6 @@ void ModifierOnlyShortcuts::pointerEvent(MouseEvent *event) void ModifierOnlyShortcuts::wheelEvent(WheelEvent *event) { - Q_UNUSED(event) reset(); } diff --git a/src/netinfo.cpp b/src/netinfo.cpp index 5957efdbb3..13f58d524e 100644 --- a/src/netinfo.cpp +++ b/src/netinfo.cpp @@ -217,7 +217,6 @@ void RootInfo::moveResizeWindow(xcb_window_t w, int flags, int x, int y, int wid void RootInfo::showWindowMenu(xcb_window_t w, int device_id, int x_root, int y_root) { - Q_UNUSED(device_id); if (X11Window *c = Workspace::self()->findClient(Predicate::WindowMatch, w)) { c->GTKShowWindowMenu(Xcb::fromXNative(x_root), Xcb::fromXNative(y_root)); } diff --git a/src/placeholderinputeventfilter.cpp b/src/placeholderinputeventfilter.cpp index 73b4ba632f..4a43246bc2 100644 --- a/src/placeholderinputeventfilter.cpp +++ b/src/placeholderinputeventfilter.cpp @@ -14,43 +14,31 @@ namespace KWin bool PlaceholderInputEventFilter::pointerEvent(QMouseEvent *event, quint32 nativeButton) { - Q_UNUSED(event) - Q_UNUSED(nativeButton) return true; } bool PlaceholderInputEventFilter::wheelEvent(QWheelEvent *event) { - Q_UNUSED(event) return true; } bool PlaceholderInputEventFilter::keyEvent(QKeyEvent *event) { - Q_UNUSED(event) return true; } bool PlaceholderInputEventFilter::touchDown(qint32 id, const QPointF &pos, quint32 time) { - Q_UNUSED(id) - Q_UNUSED(pos) - Q_UNUSED(time) return true; } bool PlaceholderInputEventFilter::touchMotion(qint32 id, const QPointF &pos, quint32 time) { - Q_UNUSED(id) - Q_UNUSED(pos) - Q_UNUSED(time) return true; } bool PlaceholderInputEventFilter::touchUp(qint32 id, quint32 time) { - Q_UNUSED(id) - Q_UNUSED(time) return true; } diff --git a/src/platformsupport/scenes/opengl/openglbackend.cpp b/src/platformsupport/scenes/opengl/openglbackend.cpp index 025d9bb8ff..738a94735e 100644 --- a/src/platformsupport/scenes/opengl/openglbackend.cpp +++ b/src/platformsupport/scenes/opengl/openglbackend.cpp @@ -59,25 +59,21 @@ void OpenGLBackend::copyPixels(const QRegion ®ion, const QSize &screenSize) std::shared_ptr OpenGLBackend::textureForOutput(Output *output) const { - Q_UNUSED(output) return {}; } std::unique_ptr OpenGLBackend::createSurfaceTextureInternal(SurfacePixmapInternal *pixmap) { - Q_UNUSED(pixmap) return nullptr; } std::unique_ptr OpenGLBackend::createSurfaceTextureX11(SurfacePixmapX11 *pixmap) { - Q_UNUSED(pixmap) return nullptr; } std::unique_ptr OpenGLBackend::createSurfaceTextureWayland(SurfacePixmapWayland *pixmap) { - Q_UNUSED(pixmap) return nullptr; } diff --git a/src/platformsupport/scenes/qpainter/qpaintersurfacetexture_internal.cpp b/src/platformsupport/scenes/qpainter/qpaintersurfacetexture_internal.cpp index 8ba5f58d4b..3eed474035 100644 --- a/src/platformsupport/scenes/qpainter/qpaintersurfacetexture_internal.cpp +++ b/src/platformsupport/scenes/qpainter/qpaintersurfacetexture_internal.cpp @@ -25,7 +25,6 @@ bool QPainterSurfaceTextureInternal::create() void QPainterSurfaceTextureInternal::update(const QRegion ®ion) { - Q_UNUSED(region) m_image = m_pixmap->image(); } diff --git a/src/plugins/buttonrebinds/buttonrebindsfilter.cpp b/src/plugins/buttonrebinds/buttonrebindsfilter.cpp index d3af6cfe9f..5224e588de 100644 --- a/src/plugins/buttonrebinds/buttonrebindsfilter.cpp +++ b/src/plugins/buttonrebinds/buttonrebindsfilter.cpp @@ -40,12 +40,10 @@ KWin::LEDs InputDevice::leds() const void InputDevice::setLeds(KWin::LEDs leds) { - Q_UNUSED(leds) } void InputDevice::setEnabled(bool enabled) { - Q_UNUSED(enabled) } bool InputDevice::isEnabled() const @@ -159,8 +157,6 @@ void ButtonRebindsFilter::loadConfig(const KConfigGroup &group) bool ButtonRebindsFilter::pointerEvent(QMouseEvent *event, quint32 nativeButton) { - Q_UNUSED(nativeButton); - if (event->type() != QEvent::MouseButtonPress && event->type() != QEvent::MouseButtonRelease) { return false; } diff --git a/src/plugins/kdecorations/aurorae/src/aurorae.cpp b/src/plugins/kdecorations/aurorae/src/aurorae.cpp index 1ad23f0834..1ca1b890ad 100644 --- a/src/plugins/kdecorations/aurorae/src/aurorae.cpp +++ b/src/plugins/kdecorations/aurorae/src/aurorae.cpp @@ -409,7 +409,6 @@ void Decoration::updateBorders() void Decoration::paint(QPainter *painter, const QRect &repaintRegion) { - Q_UNUSED(repaintRegion) if (!m_view) { return; } diff --git a/src/plugins/kdecorations/aurorae/themes/plastik/code/plastikbutton.cpp b/src/plugins/kdecorations/aurorae/themes/plastik/code/plastikbutton.cpp index 39e3a655e5..1a20964d48 100644 --- a/src/plugins/kdecorations/aurorae/themes/plastik/code/plastikbutton.cpp +++ b/src/plugins/kdecorations/aurorae/themes/plastik/code/plastikbutton.cpp @@ -102,7 +102,6 @@ QPixmap PlastikButtonProvider::requestPixmap(const QString &id, QSize *size, con QPixmap PlastikButtonProvider::icon(ButtonIcon icon, int size, bool active, bool shadow) { - Q_UNUSED(active); if (size % 2 == 0) { --size; } diff --git a/src/plugins/kglobalaccel/kglobalaccel_plugin.cpp b/src/plugins/kglobalaccel/kglobalaccel_plugin.cpp index 7b4e2c9db7..122f95ec40 100644 --- a/src/plugins/kglobalaccel/kglobalaccel_plugin.cpp +++ b/src/plugins/kglobalaccel/kglobalaccel_plugin.cpp @@ -21,8 +21,6 @@ KGlobalAccelImpl::~KGlobalAccelImpl() = default; bool KGlobalAccelImpl::grabKey(int key, bool grab) { - Q_UNUSED(key) - Q_UNUSED(grab) return true; } diff --git a/src/plugins/krunner-integration/windowsrunnerinterface.cpp b/src/plugins/krunner-integration/windowsrunnerinterface.cpp index 4f8ec47dc7..6ec495de01 100644 --- a/src/plugins/krunner-integration/windowsrunnerinterface.cpp +++ b/src/plugins/krunner-integration/windowsrunnerinterface.cpp @@ -194,7 +194,6 @@ RemoteMatches WindowsRunner::Match(const QString &searchTerm) void WindowsRunner::Run(const QString &id, const QString &actionId) { - Q_UNUSED(actionId) // Split id to get actionId and realId. We don't use actionId because our actions list is not constant const QStringList parts = id.split(QLatin1Char('_')); auto action = WindowsRunnerAction(parts[0].toInt()); diff --git a/src/plugins/qpa/backingstore.cpp b/src/plugins/qpa/backingstore.cpp index d37377c2df..55862c3424 100644 --- a/src/plugins/qpa/backingstore.cpp +++ b/src/plugins/qpa/backingstore.cpp @@ -33,8 +33,6 @@ QPaintDevice *BackingStore::paintDevice() void BackingStore::resize(const QSize &size, const QRegion &staticContents) { - Q_UNUSED(staticContents) - if (m_backBuffer.size() == size) { return; } @@ -64,8 +62,6 @@ static void blitImage(const QImage &source, QImage &target, const QRegion ®io void BackingStore::flush(QWindow *window, const QRegion ®ion, const QPoint &offset) { - Q_UNUSED(offset) - Window *platformWindow = static_cast(window->handle()); InternalWindow *internalWindow = platformWindow->internalWindow(); if (!internalWindow) { diff --git a/src/plugins/qpa/main.cpp b/src/plugins/qpa/main.cpp index efd236b3a7..1aa3382d8f 100644 --- a/src/plugins/qpa/main.cpp +++ b/src/plugins/qpa/main.cpp @@ -22,7 +22,6 @@ public: QPlatformIntegration *KWinIntegrationPlugin::create(const QString &system, const QStringList ¶mList) { - Q_UNUSED(paramList) if (!QCoreApplication::applicationFilePath().endsWith(QLatin1String("kwin_wayland")) && !qEnvironmentVariableIsSet("KWIN_FORCE_OWN_QPA")) { // Not KWin return nullptr; diff --git a/src/plugins/qpa/platformcursor.cpp b/src/plugins/qpa/platformcursor.cpp index 017ebb85a2..2359fc91ad 100644 --- a/src/plugins/qpa/platformcursor.cpp +++ b/src/plugins/qpa/platformcursor.cpp @@ -33,8 +33,6 @@ void PlatformCursor::setPos(const QPoint &pos) void PlatformCursor::changeCursor(QCursor *windowCursor, QWindow *window) { - Q_UNUSED(windowCursor) - Q_UNUSED(window) // TODO: implement } diff --git a/src/plugins/screencast/pipewirecore.cpp b/src/plugins/screencast/pipewirecore.cpp index 96eaeeddb8..6677791e7a 100644 --- a/src/plugins/screencast/pipewirecore.cpp +++ b/src/plugins/screencast/pipewirecore.cpp @@ -45,8 +45,6 @@ PipeWireCore::~PipeWireCore() void PipeWireCore::onCoreError(void *data, uint32_t id, int seq, int res, const char *message) { - Q_UNUSED(seq) - qCWarning(KWIN_SCREENCAST) << "PipeWire remote error: " << message; if (id == PW_ID_CORE && res == -EPIPE) { PipeWireCore *pw = static_cast(data); diff --git a/src/plugins/windowsystem/windoweffects.cpp b/src/plugins/windowsystem/windoweffects.cpp index e153c031b1..d211a1a392 100644 --- a/src/plugins/windowsystem/windoweffects.cpp +++ b/src/plugins/windowsystem/windoweffects.cpp @@ -72,7 +72,6 @@ void WindowEffects::slideWindow(WId id, KWindowEffects::SlideFromLocation locati #if KWINDOWSYSTEM_BUILD_DEPRECATED_SINCE(5, 81) QList WindowEffects::windowSizes(const QList &ids) { - Q_UNUSED(ids) return {}; } #endif @@ -80,24 +79,18 @@ QList WindowEffects::windowSizes(const QList &ids) #if KWINDOWSYSTEM_BUILD_DEPRECATED_SINCE(5, 82) void WindowEffects::presentWindows(WId controller, const QList &ids) { - Q_UNUSED(controller) - Q_UNUSED(ids) } #endif #if KWINDOWSYSTEM_BUILD_DEPRECATED_SINCE(5, 82) void WindowEffects::presentWindows(WId controller, int desktop) { - Q_UNUSED(controller) - Q_UNUSED(desktop) } #endif #if KWINDOWSYSTEM_BUILD_DEPRECATED_SINCE(5, 82) void WindowEffects::highlightWindows(WId controller, const QList &ids) { - Q_UNUSED(controller) - Q_UNUSED(ids) } #endif @@ -136,7 +129,6 @@ void WindowEffects::enableBackgroundContrast(WId window, bool enable, qreal cont #if KWINDOWSYSTEM_BUILD_DEPRECATED_SINCE(5, 67) void WindowEffects::markAsDashboard(WId window) { - Q_UNUSED(window) } #endif diff --git a/src/plugins/windowsystem/windowsystem.cpp b/src/plugins/windowsystem/windowsystem.cpp index a6e8929d23..33fb6f8e68 100644 --- a/src/plugins/windowsystem/windowsystem.cpp +++ b/src/plugins/windowsystem/windowsystem.cpp @@ -29,15 +29,11 @@ WindowSystem::WindowSystem() void WindowSystem::activateWindow(WId win, long int time) { - Q_UNUSED(win) - Q_UNUSED(time) // KWin cannot activate own windows } void WindowSystem::forceActiveWindow(WId win, long int time) { - Q_UNUSED(win) - Q_UNUSED(time) // KWin cannot activate own windows } @@ -54,7 +50,6 @@ bool WindowSystem::allowedActionsSupported() void WindowSystem::allowExternalProcessWindowActivation(int pid) { - Q_UNUSED(pid) } bool WindowSystem::compositingActive() @@ -65,12 +60,10 @@ bool WindowSystem::compositingActive() void WindowSystem::connectNotify(const QMetaMethod &signal) { - Q_UNUSED(signal) } QPoint WindowSystem::constrainViewportRelativePosition(const QPoint &pos) { - Q_UNUSED(pos) return QPoint(); } @@ -82,27 +75,21 @@ int WindowSystem::currentDesktop() void WindowSystem::demandAttention(WId win, bool set) { - Q_UNUSED(win) - Q_UNUSED(set) } QString WindowSystem::desktopName(int desktop) { - Q_UNUSED(desktop) return QString(); } QPoint WindowSystem::desktopToViewport(int desktop, bool absolute) { - Q_UNUSED(desktop) - Q_UNUSED(absolute) return QPoint(); } #if KWINDOWSYSTEM_BUILD_DEPRECATED_SINCE(5, 0) WId WindowSystem::groupLeader(WId window) { - Q_UNUSED(window) return 0; } #endif @@ -114,17 +101,11 @@ bool WindowSystem::icccmCompliantMappingState() QPixmap WindowSystem::icon(WId win, int width, int height, bool scale, int flags) { - Q_UNUSED(win) - Q_UNUSED(width) - Q_UNUSED(height) - Q_UNUSED(scale) - Q_UNUSED(flags) return QPixmap(); } void WindowSystem::lowerWindow(WId win) { - Q_UNUSED(win) } bool WindowSystem::mapViewport() @@ -134,12 +115,10 @@ bool WindowSystem::mapViewport() void WindowSystem::minimizeWindow(WId win) { - Q_UNUSED(win) } void WindowSystem::unminimizeWindow(WId win) { - Q_UNUSED(win) } int WindowSystem::numberOfDesktops() @@ -150,104 +129,64 @@ int WindowSystem::numberOfDesktops() void WindowSystem::raiseWindow(WId win) { - Q_UNUSED(win) } QString WindowSystem::readNameProperty(WId window, long unsigned int atom) { - Q_UNUSED(window) - Q_UNUSED(atom) return QString(); } void WindowSystem::setBlockingCompositing(WId window, bool active) { - Q_UNUSED(window) - Q_UNUSED(active) } void WindowSystem::setCurrentDesktop(int desktop) { - Q_UNUSED(desktop) // KWin internal should not use KWindowSystem to set current desktop } void WindowSystem::setDesktopName(int desktop, const QString &name) { - Q_UNUSED(desktop) - Q_UNUSED(name) // KWin internal should not use KWindowSystem to set desktop name } void WindowSystem::setExtendedStrut(WId win, int left_width, int left_start, int left_end, int right_width, int right_start, int right_end, int top_width, int top_start, int top_end, int bottom_width, int bottom_start, int bottom_end) { - Q_UNUSED(win) - Q_UNUSED(left_width) - Q_UNUSED(left_start) - Q_UNUSED(left_end) - Q_UNUSED(right_width) - Q_UNUSED(right_start) - Q_UNUSED(right_end) - Q_UNUSED(top_width) - Q_UNUSED(top_start) - Q_UNUSED(top_end) - Q_UNUSED(bottom_width) - Q_UNUSED(bottom_start) - Q_UNUSED(bottom_end) } void WindowSystem::setStrut(WId win, int left, int right, int top, int bottom) { - Q_UNUSED(win) - Q_UNUSED(left) - Q_UNUSED(right) - Q_UNUSED(top) - Q_UNUSED(bottom) } void WindowSystem::setIcons(WId win, const QPixmap &icon, const QPixmap &miniIcon) { - Q_UNUSED(win) - Q_UNUSED(icon) - Q_UNUSED(miniIcon) } void WindowSystem::setOnActivities(WId win, const QStringList &activities) { - Q_UNUSED(win) - Q_UNUSED(activities) } void WindowSystem::setOnAllDesktops(WId win, bool b) { - Q_UNUSED(win) - Q_UNUSED(b) } void WindowSystem::setOnDesktop(WId win, int desktop) { - Q_UNUSED(win) - Q_UNUSED(desktop) } void WindowSystem::setShowingDesktop(bool showing) { - Q_UNUSED(showing) // KWin should not use KWindowSystem to set showing desktop state } void WindowSystem::clearState(WId win, NET::States state) { // KWin's windows don't support state - Q_UNUSED(win) - Q_UNUSED(state) } void WindowSystem::setState(WId win, NET::States state) { // KWin's windows don't support state - Q_UNUSED(win) - Q_UNUSED(state) } void WindowSystem::setType(WId win, NET::WindowType windowType) @@ -265,8 +204,6 @@ void WindowSystem::setType(WId win, NET::WindowType windowType) void WindowSystem::setUserTime(WId win, long int time) { - Q_UNUSED(win) - Q_UNUSED(time) } bool WindowSystem::showingDesktop() @@ -284,20 +221,17 @@ QList WindowSystem::stackingOrder() #if KWINDOWSYSTEM_BUILD_DEPRECATED_SINCE(5, 0) WId WindowSystem::transientFor(WId window) { - Q_UNUSED(window) return 0; } #endif int WindowSystem::viewportToDesktop(const QPoint &pos) { - Q_UNUSED(pos) return 0; } int WindowSystem::viewportWindowToDesktop(const QRect &r) { - Q_UNUSED(r) return 0; } @@ -308,21 +242,16 @@ QList WindowSystem::windows() QRect WindowSystem::workArea(const QList &excludes, int desktop) { - Q_UNUSED(excludes) - Q_UNUSED(desktop) return {}; } QRect WindowSystem::workArea(int desktop) { - Q_UNUSED(desktop) return {}; } void WindowSystem::requestToken(QWindow *win, uint32_t serial, const QString &appId) { - Q_UNUSED(win); // it's coming from within kwin, it doesn't matter the window - auto seat = KWin::waylandServer()->seat(); auto token = KWin::waylandServer()->xdgActivationIntegration()->requestPrivilegedToken(nullptr, seat->display()->serial(), seat, appId); // Ensure that xdgActivationTokenArrived is always emitted asynchronously @@ -333,7 +262,6 @@ void WindowSystem::requestToken(QWindow *win, uint32_t serial, const QString &ap void WindowSystem::setCurrentToken(const QString &token) { - Q_UNUSED(token) // KWin cannot activate own windows } diff --git a/src/pointer_input.cpp b/src/pointer_input.cpp index bcae21f007..11e6e48533 100644 --- a/src/pointer_input.cpp +++ b/src/pointer_input.cpp @@ -312,7 +312,6 @@ void PointerInputRedirection::processAxis(InputRedirection::PointerAxis axis, qr void PointerInputRedirection::processSwipeGestureBegin(int fingerCount, quint32 time, KWin::InputDevice *device) { input()->setLastInputHandler(this); - Q_UNUSED(device) if (!inited()) { return; } @@ -324,7 +323,6 @@ void PointerInputRedirection::processSwipeGestureBegin(int fingerCount, quint32 void PointerInputRedirection::processSwipeGestureUpdate(const QPointF &delta, quint32 time, KWin::InputDevice *device) { input()->setLastInputHandler(this); - Q_UNUSED(device) if (!inited()) { return; } @@ -337,7 +335,6 @@ void PointerInputRedirection::processSwipeGestureUpdate(const QPointF &delta, qu void PointerInputRedirection::processSwipeGestureEnd(quint32 time, KWin::InputDevice *device) { input()->setLastInputHandler(this); - Q_UNUSED(device) if (!inited()) { return; } @@ -350,7 +347,6 @@ void PointerInputRedirection::processSwipeGestureEnd(quint32 time, KWin::InputDe void PointerInputRedirection::processSwipeGestureCancelled(quint32 time, KWin::InputDevice *device) { input()->setLastInputHandler(this); - Q_UNUSED(device) if (!inited()) { return; } @@ -363,7 +359,6 @@ void PointerInputRedirection::processSwipeGestureCancelled(quint32 time, KWin::I void PointerInputRedirection::processPinchGestureBegin(int fingerCount, quint32 time, KWin::InputDevice *device) { input()->setLastInputHandler(this); - Q_UNUSED(device) if (!inited()) { return; } @@ -376,7 +371,6 @@ void PointerInputRedirection::processPinchGestureBegin(int fingerCount, quint32 void PointerInputRedirection::processPinchGestureUpdate(qreal scale, qreal angleDelta, const QPointF &delta, quint32 time, KWin::InputDevice *device) { input()->setLastInputHandler(this); - Q_UNUSED(device) if (!inited()) { return; } @@ -389,7 +383,6 @@ void PointerInputRedirection::processPinchGestureUpdate(qreal scale, qreal angle void PointerInputRedirection::processPinchGestureEnd(quint32 time, KWin::InputDevice *device) { input()->setLastInputHandler(this); - Q_UNUSED(device) if (!inited()) { return; } @@ -402,7 +395,6 @@ void PointerInputRedirection::processPinchGestureEnd(quint32 time, KWin::InputDe void PointerInputRedirection::processPinchGestureCancelled(quint32 time, KWin::InputDevice *device) { input()->setLastInputHandler(this); - Q_UNUSED(device) if (!inited()) { return; } @@ -414,7 +406,6 @@ void PointerInputRedirection::processPinchGestureCancelled(quint32 time, KWin::I void PointerInputRedirection::processHoldGestureBegin(int fingerCount, quint32 time, KWin::InputDevice *device) { - Q_UNUSED(device) if (!inited()) { return; } @@ -426,7 +417,6 @@ void PointerInputRedirection::processHoldGestureBegin(int fingerCount, quint32 t void PointerInputRedirection::processHoldGestureEnd(quint32 time, KWin::InputDevice *device) { - Q_UNUSED(device) if (!inited()) { return; } @@ -438,7 +428,6 @@ void PointerInputRedirection::processHoldGestureEnd(quint32 time, KWin::InputDev void PointerInputRedirection::processHoldGestureCancelled(quint32 time, KWin::InputDevice *device) { - Q_UNUSED(device) if (!inited()) { return; } diff --git a/src/popup_input_filter.cpp b/src/popup_input_filter.cpp index 40e4723432..7698199d6c 100644 --- a/src/popup_input_filter.cpp +++ b/src/popup_input_filter.cpp @@ -43,7 +43,6 @@ void PopupInputFilter::handleWindowRemoved(Window *window) } bool PopupInputFilter::pointerEvent(QMouseEvent *event, quint32 nativeButton) { - Q_UNUSED(nativeButton) if (m_popupWindows.isEmpty()) { return false; } @@ -91,8 +90,6 @@ bool PopupInputFilter::keyEvent(QKeyEvent *event) bool PopupInputFilter::touchDown(qint32 id, const QPointF &pos, quint32 time) { - Q_UNUSED(id) - Q_UNUSED(time) if (m_popupWindows.isEmpty()) { return false; } diff --git a/src/scene.cpp b/src/scene.cpp index a89e1c104e..4cfeb2571f 100644 --- a/src/scene.cpp +++ b/src/scene.cpp @@ -610,19 +610,16 @@ QVector Scene::openGLPlatformInterfaceExtensions() const std::unique_ptr Scene::createSurfaceTextureInternal(SurfacePixmapInternal *pixmap) { - Q_UNUSED(pixmap) return nullptr; } std::unique_ptr Scene::createSurfaceTextureX11(SurfacePixmapX11 *pixmap) { - Q_UNUSED(pixmap) return nullptr; } std::unique_ptr Scene::createSurfaceTextureWayland(SurfacePixmapWayland *pixmap) { - Q_UNUSED(pixmap) return nullptr; } diff --git a/src/scene.h b/src/scene.h index fd4a5ade89..160add93f6 100644 --- a/src/scene.h +++ b/src/scene.h @@ -159,7 +159,6 @@ public: virtual std::shared_ptr textureForOutput(Output *output) const { - Q_UNUSED(output); return {}; } diff --git a/src/scenes/opengl/scene_opengl.cpp b/src/scenes/opengl/scene_opengl.cpp index 2012bd53ff..960f053b86 100644 --- a/src/scenes/opengl/scene_opengl.cpp +++ b/src/scenes/opengl/scene_opengl.cpp @@ -85,7 +85,6 @@ bool SceneOpenGL::initFailed() const void SceneOpenGL::paint(RenderTarget *renderTarget, const QRegion ®ion) { - Q_UNUSED(renderTarget) GLVertexBuffer::streamingBuffer()->beginFrame(); paintScreen(region); GLVertexBuffer::streamingBuffer()->endOfFrame(); diff --git a/src/screenlockerwatcher.cpp b/src/screenlockerwatcher.cpp index 03fc16546a..26f02bf403 100644 --- a/src/screenlockerwatcher.cpp +++ b/src/screenlockerwatcher.cpp @@ -46,9 +46,6 @@ void ScreenLockerWatcher::initialize() void ScreenLockerWatcher::serviceOwnerChanged(const QString &serviceName, const QString &oldOwner, const QString &newOwner) { - Q_UNUSED(oldOwner) - Q_UNUSED(serviceName) - m_locked = false; if (!newOwner.isEmpty()) { diff --git a/src/scripting/genericscriptedconfig.cpp b/src/scripting/genericscriptedconfig.cpp index dec9139b44..0a5d3c650f 100644 --- a/src/scripting/genericscriptedconfig.cpp +++ b/src/scripting/genericscriptedconfig.cpp @@ -29,10 +29,6 @@ namespace KWin QObject *GenericScriptedConfigFactory::create(const char *iface, QWidget *parentWidget, QObject *parent, const QVariantList &args, const QString &keyword) { - Q_UNUSED(iface) - Q_UNUSED(parent) - Q_UNUSED(keyword) - // the plugin id is in the args when created by desktop effects kcm or EffectsModel in general QString pluginId = args.isEmpty() ? QString() : args.first().toString(); diff --git a/src/scripting/scripting.cpp b/src/scripting/scripting.cpp index 79870d8381..f3389ba6d6 100644 --- a/src/scripting/scripting.cpp +++ b/src/scripting/scripting.cpp @@ -691,8 +691,6 @@ void KWin::Scripting::init() qmlRegisterUncreatableType("org.kde.kwin", 3, 0, "SceneView", QStringLiteral("Can't instantiate an object of type SceneView")); qmlRegisterSingletonType("org.kde.kwin", 3, 0, "Workspace", [](QQmlEngine *qmlEngine, QJSEngine *jsEngine) { - Q_UNUSED(qmlEngine) - Q_UNUSED(jsEngine) return new DeclarativeScriptWorkspaceWrapper(); }); qmlRegisterSingletonInstance("org.kde.kwin", 3, 0, "Options", options); diff --git a/src/scripting/v2/clientmodel.cpp b/src/scripting/v2/clientmodel.cpp index 4e97247592..aff60db5c8 100644 --- a/src/scripting/v2/clientmodel.cpp +++ b/src/scripting/v2/clientmodel.cpp @@ -497,8 +497,6 @@ void ForkLevel::activityAdded(const QString &activityId) childLevel->init(); addChild(childLevel); Q_EMIT endInsert(); -#else - Q_UNUSED(activityId) #endif } @@ -516,8 +514,6 @@ void ForkLevel::activityRemoved(const QString &activityId) break; } } -#else - Q_UNUSED(activityId) #endif } @@ -696,7 +692,6 @@ QVariant ClientModel::data(const QModelIndex &index, int role) const int ClientModel::columnCount(const QModelIndex &parent) const { - Q_UNUSED(parent) return 1; } diff --git a/src/scripting/windowthumbnailitem.cpp b/src/scripting/windowthumbnailitem.cpp index 0cb3d721bd..8d0c1f0a68 100644 --- a/src/scripting/windowthumbnailitem.cpp +++ b/src/scripting/windowthumbnailitem.cpp @@ -262,7 +262,6 @@ qreal WindowThumbnailItem::saturation() const void WindowThumbnailItem::setSaturation(qreal saturation) { - Q_UNUSED(saturation) qCWarning(KWIN_SCRIPTING) << "ThumbnailItem.saturation is removed. Use a shader effect to change saturation"; } @@ -273,7 +272,6 @@ qreal WindowThumbnailItem::brightness() const void WindowThumbnailItem::setBrightness(qreal brightness) { - Q_UNUSED(brightness) qCWarning(KWIN_SCRIPTING) << "ThumbnailItem.brightness is removed. Use a shader effect to change brightness"; } @@ -284,7 +282,6 @@ QQuickItem *WindowThumbnailItem::clipTo() const void WindowThumbnailItem::setClipTo(QQuickItem *clip) { - Q_UNUSED(clip) qCWarning(KWIN_SCRIPTING) << "ThumbnailItem.clipTo is removed and it has no replacements"; } diff --git a/src/scripting/workspace_wrapper.cpp b/src/scripting/workspace_wrapper.cpp index 47c1a5973f..25f41f4faf 100644 --- a/src/scripting/workspace_wrapper.cpp +++ b/src/scripting/workspace_wrapper.cpp @@ -123,8 +123,6 @@ void WorkspaceWrapper::setCurrentActivity(QString activity) if (Workspace::self()->activities()) { Workspace::self()->activities()->setCurrent(activity); } -#else - Q_UNUSED(activity) #endif } @@ -480,7 +478,6 @@ int DeclarativeScriptWorkspaceWrapper::countClientList(QQmlListProperty *clients) #endif { - Q_UNUSED(clients) return workspace()->allClientList().size(); } @@ -490,7 +487,6 @@ KWin::Window *DeclarativeScriptWorkspaceWrapper::atClientList(QQmlListProperty *clients, qsizetype index) #endif { - Q_UNUSED(clients) return workspace()->allClientList().at(index); } diff --git a/src/shadowitem.cpp b/src/shadowitem.cpp index 9efae2ebfd..52f29804a7 100644 --- a/src/shadowitem.cpp +++ b/src/shadowitem.cpp @@ -52,7 +52,6 @@ void ShadowItem::handleTextureChanged() void ShadowItem::handleWindowClosed(Window *original, Deleted *deleted) { - Q_UNUSED(original) m_window = deleted; } diff --git a/src/surfaceitem.cpp b/src/surfaceitem.cpp index b29693dd66..fa6eaaecc8 100644 --- a/src/surfaceitem.cpp +++ b/src/surfaceitem.cpp @@ -24,7 +24,6 @@ Window *SurfaceItem::window() const void SurfaceItem::handleWindowClosed(Window *original, Deleted *deleted) { - Q_UNUSED(original) m_window = deleted; } diff --git a/src/tabbox/clientmodel.cpp b/src/tabbox/clientmodel.cpp index cb9c841c02..c94e1b1e23 100644 --- a/src/tabbox/clientmodel.cpp +++ b/src/tabbox/clientmodel.cpp @@ -96,7 +96,6 @@ QString ClientModel::longestCaption() const int ClientModel::columnCount(const QModelIndex &parent) const { - Q_UNUSED(parent) return 1; } @@ -110,7 +109,6 @@ int ClientModel::rowCount(const QModelIndex &parent) const QModelIndex ClientModel::parent(const QModelIndex &child) const { - Q_UNUSED(child) return QModelIndex(); } diff --git a/src/tabbox/desktopchain.cpp b/src/tabbox/desktopchain.cpp index 7f86323624..8bde2928c8 100644 --- a/src/tabbox/desktopchain.cpp +++ b/src/tabbox/desktopchain.cpp @@ -99,7 +99,6 @@ void DesktopChainManager::resize(uint previousSize, uint newSize) void DesktopChainManager::addDesktop(uint previousDesktop, uint currentDesktop) { - Q_UNUSED(previousDesktop) m_currentChain.value().add(currentDesktop); } diff --git a/src/tabbox/desktopmodel.cpp b/src/tabbox/desktopmodel.cpp index 1e2d2d68a5..d1f430ce43 100644 --- a/src/tabbox/desktopmodel.cpp +++ b/src/tabbox/desktopmodel.cpp @@ -72,7 +72,6 @@ QString DesktopModel::longestCaption() const int DesktopModel::columnCount(const QModelIndex &parent) const { - Q_UNUSED(parent) return 1; } diff --git a/src/tablet_input.cpp b/src/tablet_input.cpp index 485a4a4b9a..7758d1febc 100644 --- a/src/tablet_input.cpp +++ b/src/tablet_input.cpp @@ -189,9 +189,6 @@ void TabletInputRedirection::cleanupDecoration(Decoration::DecoratedClientImpl * void TabletInputRedirection::focusUpdate(Window *focusOld, Window *focusNow) { - Q_UNUSED(focusOld) - Q_UNUSED(focusNow) - // This method is left blank intentionally. } diff --git a/src/touch_input.cpp b/src/touch_input.cpp index 69132b976c..34771fa10e 100644 --- a/src/touch_input.cpp +++ b/src/touch_input.cpp @@ -125,15 +125,11 @@ void TouchInputRedirection::focusUpdate(Window *focusOld, Window *focusNow) void TouchInputRedirection::cleanupDecoration(Decoration::DecoratedClientImpl *old, Decoration::DecoratedClientImpl *now) { - Q_UNUSED(old); - Q_UNUSED(now); - // nothing to do } void TouchInputRedirection::processDown(qint32 id, const QPointF &pos, quint32 time, InputDevice *device) { - Q_UNUSED(device) if (!inited()) { return; } @@ -151,7 +147,6 @@ void TouchInputRedirection::processDown(qint32 id, const QPointF &pos, quint32 t void TouchInputRedirection::processUp(qint32 id, quint32 time, InputDevice *device) { - Q_UNUSED(device) if (!inited()) { return; } @@ -170,7 +165,6 @@ void TouchInputRedirection::processUp(qint32 id, quint32 time, InputDevice *devi void TouchInputRedirection::processMotion(qint32 id, const QPointF &pos, quint32 time, InputDevice *device) { - Q_UNUSED(device) if (!inited()) { return; } diff --git a/src/unmanaged.cpp b/src/unmanaged.cpp index d80d7f5e07..472e50c4fe 100644 --- a/src/unmanaged.cpp +++ b/src/unmanaged.cpp @@ -194,7 +194,6 @@ NET::WindowType Unmanaged::windowType(bool direct, int supportedTypes) const { // for unmanaged windows the direct does not make any difference // as there are no rules to check and no hacks to apply - Q_UNUSED(direct) if (supportedTypes == 0) { supportedTypes = SUPPORTED_UNMANAGED_WINDOW_TYPES_MASK; } diff --git a/src/useractions.cpp b/src/useractions.cpp index 450ba76392..500e276192 100644 --- a/src/useractions.cpp +++ b/src/useractions.cpp @@ -823,9 +823,6 @@ void UserActionsMenu::slotToggleOnActivity(QAction *action) } } } - -#else - Q_UNUSED(action) #endif } diff --git a/src/virtualdesktops.cpp b/src/virtualdesktops.cpp index 322d6f3fbd..6c072419e2 100644 --- a/src/virtualdesktops.cpp +++ b/src/virtualdesktops.cpp @@ -761,7 +761,8 @@ QString VirtualDesktopManager::defaultName(int desktop) const void VirtualDesktopManager::setNETDesktopLayout(Qt::Orientation orientation, uint width, uint height, int startingCorner) { - Q_UNUSED(startingCorner); // Not really worth implementing right now. + // startingCorner is not really worth implementing right now. + const uint count = m_desktops.count(); // Calculate valid grid size diff --git a/src/was_user_interaction_x11_filter.cpp b/src/was_user_interaction_x11_filter.cpp index 602df95554..1d1b89bb5e 100644 --- a/src/was_user_interaction_x11_filter.cpp +++ b/src/was_user_interaction_x11_filter.cpp @@ -19,7 +19,6 @@ WasUserInteractionX11Filter::WasUserInteractionX11Filter() bool WasUserInteractionX11Filter::event(xcb_generic_event_t *event) { - Q_UNUSED(event); workspace()->setWasUserInteraction(); return false; } diff --git a/src/wayland/abstract_data_source.h b/src/wayland/abstract_data_source.h index 09cf576af3..e077b91ef4 100644 --- a/src/wayland/abstract_data_source.h +++ b/src/wayland/abstract_data_source.h @@ -36,7 +36,6 @@ public: virtual void accept(const QString &mimeType) { - Q_UNUSED(mimeType); }; virtual void requestData(const QString &mimeType, qint32 fd) = 0; virtual void cancel() = 0; @@ -68,7 +67,6 @@ public: */ virtual void dndAction(DataDeviceManagerInterface::DnDAction action) { - Q_UNUSED(action); }; /** diff --git a/src/wayland/appmenu_interface.cpp b/src/wayland/appmenu_interface.cpp index d84759e5f3..5e78cd76fa 100644 --- a/src/wayland/appmenu_interface.cpp +++ b/src/wayland/appmenu_interface.cpp @@ -78,13 +78,11 @@ AppMenuInterfacePrivate::AppMenuInterfacePrivate(AppMenuInterface *_q, SurfaceIn void AppMenuInterfacePrivate::org_kde_kwin_appmenu_destroy_resource(QtWaylandServer::org_kde_kwin_appmenu::Resource *resource) { - Q_UNUSED(resource) delete q; } void AppMenuInterfacePrivate::org_kde_kwin_appmenu_set_address(Resource *resource, const QString &service_name, const QString &object_path) { - Q_UNUSED(resource) if (address.serviceName == service_name && address.objectPath == object_path) { return; } diff --git a/src/wayland/autotests/server/test_datacontrol_interface.cpp b/src/wayland/autotests/server/test_datacontrol_interface.cpp index 1bd77a5370..c6d352b1ce 100644 --- a/src/wayland/autotests/server/test_datacontrol_interface.cpp +++ b/src/wayland/autotests/server/test_datacontrol_interface.cpp @@ -119,8 +119,6 @@ public: } void requestData(const QString &mimeType, qint32 fd) override { - Q_UNUSED(mimeType); - Q_UNUSED(fd); }; void cancel() override { diff --git a/src/wayland/autotests/server/test_inputmethod_interface.cpp b/src/wayland/autotests/server/test_inputmethod_interface.cpp index 913b5eb0b6..5191b15c46 100644 --- a/src/wayland/autotests/server/test_inputmethod_interface.cpp +++ b/src/wayland/autotests/server/test_inputmethod_interface.cpp @@ -133,7 +133,6 @@ protected: }; void zwp_input_method_v1_deactivate(struct ::zwp_input_method_context_v1 *context) override { - Q_UNUSED(context) delete m_context; m_context = nullptr; Q_EMIT deactivated(); diff --git a/src/wayland/autotests/server/test_screencast.cpp b/src/wayland/autotests/server/test_screencast.cpp index 8630afadb6..926b423e3d 100644 --- a/src/wayland/autotests/server/test_screencast.cpp +++ b/src/wayland/autotests/server/test_screencast.cpp @@ -123,7 +123,6 @@ void TestScreencastV1Interface::initTestCase() &KWaylandServer::ScreencastV1Interface::windowScreencastRequested, this, [this](KWaylandServer::ScreencastStreamV1Interface *stream, const QString &winid) { - Q_UNUSED(winid); stream->sendCreated(123); m_triggered = stream; }); diff --git a/src/wayland/blur_interface.cpp b/src/wayland/blur_interface.cpp index 46c6ba4820..85979f0413 100644 --- a/src/wayland/blur_interface.cpp +++ b/src/wayland/blur_interface.cpp @@ -42,7 +42,6 @@ void BlurManagerInterfacePrivate::org_kde_kwin_blur_manager_destroy_global() void BlurManagerInterfacePrivate::org_kde_kwin_blur_manager_unset(Resource *resource, wl_resource *surface) { - Q_UNUSED(resource); SurfaceInterface *s = SurfaceInterface::get(surface); if (!s) { return; @@ -101,13 +100,11 @@ protected: void BlurInterfacePrivate::org_kde_kwin_blur_commit(Resource *resource) { - Q_UNUSED(resource) currentRegion = pendingRegion; } void BlurInterfacePrivate::org_kde_kwin_blur_set_region(Resource *resource, wl_resource *region) { - Q_UNUSED(resource) RegionInterface *r = RegionInterface::get(region); if (r) { pendingRegion = r->region(); @@ -123,7 +120,6 @@ void BlurInterfacePrivate::org_kde_kwin_blur_release(Resource *resource) void BlurInterfacePrivate::org_kde_kwin_blur_destroy_resource(Resource *resource) { - Q_UNUSED(resource) delete q; } diff --git a/src/wayland/clientbufferintegration.cpp b/src/wayland/clientbufferintegration.cpp index 6a7dbcf644..888301a1e6 100644 --- a/src/wayland/clientbufferintegration.cpp +++ b/src/wayland/clientbufferintegration.cpp @@ -33,7 +33,6 @@ Display *ClientBufferIntegration::display() const ClientBuffer *ClientBufferIntegration::createBuffer(wl_resource *resource) { - Q_UNUSED(resource) return nullptr; } diff --git a/src/wayland/clientconnection.cpp b/src/wayland/clientconnection.cpp index b145e32f57..120e59b3a0 100644 --- a/src/wayland/clientconnection.cpp +++ b/src/wayland/clientconnection.cpp @@ -60,7 +60,6 @@ ClientConnectionPrivate::~ClientConnectionPrivate() void ClientConnectionPrivate::destroyListenerCallback(wl_listener *listener, void *data) { - Q_UNUSED(listener) wl_client *client = reinterpret_cast(data); auto it = std::find_if(s_allClients.constBegin(), s_allClients.constEnd(), [client](ClientConnectionPrivate *c) { return c->client == client; diff --git a/src/wayland/contrast_interface.cpp b/src/wayland/contrast_interface.cpp index a9338af8f8..3d564f18c0 100644 --- a/src/wayland/contrast_interface.cpp +++ b/src/wayland/contrast_interface.cpp @@ -114,7 +114,6 @@ protected: void ContrastInterfacePrivate::org_kde_kwin_contrast_commit(Resource *resource) { - Q_UNUSED(resource) currentRegion = pendingRegion; currentContrast = pendingContrast; currentIntensity = pendingIntensity; @@ -124,7 +123,6 @@ void ContrastInterfacePrivate::org_kde_kwin_contrast_commit(Resource *resource) void ContrastInterfacePrivate::org_kde_kwin_contrast_set_region(Resource *resource, wl_resource *region) { - Q_UNUSED(resource) RegionInterface *r = RegionInterface::get(region); if (r) { pendingRegion = r->region(); @@ -135,33 +133,26 @@ void ContrastInterfacePrivate::org_kde_kwin_contrast_set_region(Resource *resour void ContrastInterfacePrivate::org_kde_kwin_contrast_set_contrast(Resource *resource, wl_fixed_t contrast) { - Q_UNUSED(resource) pendingContrast = wl_fixed_to_double(contrast); } void ContrastInterfacePrivate::org_kde_kwin_contrast_set_intensity(Resource *resource, wl_fixed_t intensity) { - Q_UNUSED(resource) pendingIntensity = wl_fixed_to_double(intensity); } void ContrastInterfacePrivate::org_kde_kwin_contrast_set_saturation(Resource *resource, wl_fixed_t saturation) { - Q_UNUSED(resource) pendingSaturation = wl_fixed_to_double(saturation); } void ContrastInterfacePrivate::org_kde_kwin_contrast_set_frost(Resource *resource, int r, int g, int b, int a) { - Q_UNUSED(resource) - pendingFrost = QColor(r, g, b, a); } void ContrastInterfacePrivate::org_kde_kwin_contrast_unset_frost(Resource *resource) { - Q_UNUSED(resource) - pendingFrost = {}; } @@ -172,7 +163,6 @@ void ContrastInterfacePrivate::org_kde_kwin_contrast_release(Resource *resource) void ContrastInterfacePrivate::org_kde_kwin_contrast_destroy_resource(Resource *resource) { - Q_UNUSED(resource) delete q; } diff --git a/src/wayland/datacontroldevice_v1_interface.cpp b/src/wayland/datacontroldevice_v1_interface.cpp index ca20ff7279..64ca3944b6 100644 --- a/src/wayland/datacontroldevice_v1_interface.cpp +++ b/src/wayland/datacontroldevice_v1_interface.cpp @@ -107,7 +107,6 @@ DataControlOfferV1Interface *DataControlDeviceV1InterfacePrivate::createDataOffe void DataControlDeviceV1InterfacePrivate::zwlr_data_control_device_v1_destroy_resource(QtWaylandServer::zwlr_data_control_device_v1::Resource *resource) { - Q_UNUSED(resource) delete q; } diff --git a/src/wayland/datacontroloffer_v1_interface.cpp b/src/wayland/datacontroloffer_v1_interface.cpp index b71974d2c8..6bbf1b1e7c 100644 --- a/src/wayland/datacontroloffer_v1_interface.cpp +++ b/src/wayland/datacontroloffer_v1_interface.cpp @@ -44,13 +44,11 @@ void DataControlOfferV1InterfacePrivate::zwlr_data_control_offer_v1_destroy(QtWa void DataControlOfferV1InterfacePrivate::zwlr_data_control_offer_v1_destroy_resource(QtWaylandServer::zwlr_data_control_offer_v1::Resource *resource) { - Q_UNUSED(resource) delete q; } void DataControlOfferV1InterfacePrivate::zwlr_data_control_offer_v1_receive(Resource *resource, const QString &mimeType, qint32 fd) { - Q_UNUSED(resource) if (!source) { close(fd); return; diff --git a/src/wayland/datacontrolsource_v1_interface.cpp b/src/wayland/datacontrolsource_v1_interface.cpp index db63d88510..c27107cf79 100644 --- a/src/wayland/datacontrolsource_v1_interface.cpp +++ b/src/wayland/datacontrolsource_v1_interface.cpp @@ -38,7 +38,6 @@ DataControlSourceV1InterfacePrivate::DataControlSourceV1InterfacePrivate(DataCon void DataControlSourceV1InterfacePrivate::zwlr_data_control_source_v1_destroy_resource(QtWaylandServer::zwlr_data_control_source_v1::Resource *resource) { - Q_UNUSED(resource) Q_EMIT q->aboutToBeDestroyed(); delete q; } diff --git a/src/wayland/datadevice_interface.cpp b/src/wayland/datadevice_interface.cpp index 2397536375..1136483431 100644 --- a/src/wayland/datadevice_interface.cpp +++ b/src/wayland/datadevice_interface.cpp @@ -112,8 +112,6 @@ void DataDeviceInterfacePrivate::data_device_start_drag(Resource *resource, void DataDeviceInterfacePrivate::data_device_set_selection(Resource *resource, wl_resource *source, uint32_t serial) { - Q_UNUSED(resource) - Q_UNUSED(serial) DataSourceInterface *dataSource = DataSourceInterface::get(source); if (dataSource && dataSource->supportedDragAndDropActions() && wl_resource_get_version(dataSource->resource()) >= WL_DATA_SOURCE_ACTION_SINCE_VERSION) { @@ -162,7 +160,6 @@ DataOfferInterface *DataDeviceInterfacePrivate::createDataOffer(AbstractDataSour void DataDeviceInterfacePrivate::data_device_destroy_resource(QtWaylandServer::wl_data_device::Resource *resource) { - Q_UNUSED(resource) Q_EMIT q->aboutToBeDestroyed(); delete q; } @@ -294,7 +291,6 @@ void DataDeviceInterface::updateDragTarget(SurfaceInterface *surface, quint32 se } d->drag.posConnection = connect(d->seat, &SeatInterface::touchMoved, this, [this](qint32 id, quint32 serial, const QPointF &globalPosition) { - Q_UNUSED(id); if (serial != d->drag.serial) { // different touch down has been moved return; diff --git a/src/wayland/dataoffer_interface.cpp b/src/wayland/dataoffer_interface.cpp index d8119e816e..b2278d893e 100644 --- a/src/wayland/dataoffer_interface.cpp +++ b/src/wayland/dataoffer_interface.cpp @@ -51,8 +51,6 @@ DataOfferInterfacePrivate::DataOfferInterfacePrivate(AbstractDataSource *_source void DataOfferInterfacePrivate::data_offer_accept(Resource *resource, uint32_t serial, const QString &mime_type) { - Q_UNUSED(resource) - Q_UNUSED(serial) if (!source) { return; } @@ -61,7 +59,6 @@ void DataOfferInterfacePrivate::data_offer_accept(Resource *resource, uint32_t s void DataOfferInterfacePrivate::data_offer_receive(Resource *resource, const QString &mime_type, int32_t fd) { - Q_UNUSED(resource) if (!source) { close(fd); return; @@ -76,7 +73,6 @@ void DataOfferInterfacePrivate::data_offer_destroy(QtWaylandServer::wl_data_offe void DataOfferInterfacePrivate::data_offer_finish(Resource *resource) { - Q_UNUSED(resource) if (!source) { return; } @@ -154,7 +150,6 @@ void DataOfferInterface::sendSourceActions() void DataOfferInterfacePrivate::data_offer_destroy_resource(QtWaylandServer::wl_data_offer::Resource *resource) { - Q_UNUSED(resource) delete q; } diff --git a/src/wayland/datasource_interface.cpp b/src/wayland/datasource_interface.cpp index 33aa7420d9..f5e3efb9c9 100644 --- a/src/wayland/datasource_interface.cpp +++ b/src/wayland/datasource_interface.cpp @@ -46,14 +46,12 @@ DataSourceInterfacePrivate::DataSourceInterfacePrivate(DataSourceInterface *_q, void DataSourceInterfacePrivate::data_source_destroy_resource(Resource *resource) { - Q_UNUSED(resource) Q_EMIT q->aboutToBeDestroyed(); delete q; } void DataSourceInterfacePrivate::data_source_offer(QtWaylandServer::wl_data_source::Resource *resource, const QString &mime_type) { - Q_UNUSED(resource) mimeTypes << mime_type; Q_EMIT q->mimeTypeOffered(mime_type); } diff --git a/src/wayland/dpms_interface.cpp b/src/wayland/dpms_interface.cpp index 7153e939a0..866c3ec9ec 100644 --- a/src/wayland/dpms_interface.cpp +++ b/src/wayland/dpms_interface.cpp @@ -101,13 +101,11 @@ void DpmsInterface::org_kde_kwin_dpms_release(Resource *resource) void DpmsInterface::org_kde_kwin_dpms_destroy_resource(Resource *resource) { - Q_UNUSED(resource) delete this; } void DpmsInterface::org_kde_kwin_dpms_set(Resource *resource, uint32_t mode) { - Q_UNUSED(resource) if (!m_output || m_output->isRemoved()) { return; } diff --git a/src/wayland/drmlease_v1_interface.cpp b/src/wayland/drmlease_v1_interface.cpp index 4645a2049f..d4a155808d 100644 --- a/src/wayland/drmlease_v1_interface.cpp +++ b/src/wayland/drmlease_v1_interface.cpp @@ -328,7 +328,6 @@ void DrmLeaseRequestV1Interface::invalidate() void DrmLeaseRequestV1Interface::wp_drm_lease_request_v1_request_connector(Resource *resource, struct ::wl_resource *connector_handle) { - Q_UNUSED(resource); if (auto connector = resource_cast(connector_handle)) { if (connector->device() != m_device) { wl_resource_post_error(resource->handle, WP_DRM_LEASE_REQUEST_V1_ERROR_WRONG_DEVICE, "Requested connector from invalid lease device"); @@ -378,7 +377,6 @@ void DrmLeaseRequestV1Interface::wp_drm_lease_request_v1_submit(Resource *resour void DrmLeaseRequestV1Interface::wp_drm_lease_request_v1_destroy_resource(Resource *resource) { - Q_UNUSED(resource) delete this; } @@ -444,7 +442,6 @@ void DrmLeaseV1Interface::wp_drm_lease_v1_destroy(Resource *resource) void DrmLeaseV1Interface::wp_drm_lease_v1_destroy_resource(Resource *resource) { - Q_UNUSED(resource) delete this; } diff --git a/src/wayland/idle_interface.cpp b/src/wayland/idle_interface.cpp index e894dc0f5f..38ed66645f 100644 --- a/src/wayland/idle_interface.cpp +++ b/src/wayland/idle_interface.cpp @@ -63,13 +63,11 @@ void IdleTimeoutInterface::org_kde_kwin_idle_timeout_release(Resource *resource) void IdleTimeoutInterface::org_kde_kwin_idle_timeout_destroy_resource(Resource *resource) { - Q_UNUSED(resource) delete this; } void IdleTimeoutInterface::org_kde_kwin_idle_timeout_simulate_user_activity(Resource *resource) { - Q_UNUSED(resource) input()->simulateUserActivity(); } diff --git a/src/wayland/idleinhibit_v1_interface.cpp b/src/wayland/idleinhibit_v1_interface.cpp index b4f52ca630..5bbce53c11 100644 --- a/src/wayland/idleinhibit_v1_interface.cpp +++ b/src/wayland/idleinhibit_v1_interface.cpp @@ -64,7 +64,6 @@ void IdleInhibitorV1Interface::zwp_idle_inhibitor_v1_destroy(Resource *resource) void IdleInhibitorV1Interface::zwp_idle_inhibitor_v1_destroy_resource(Resource *resource) { - Q_UNUSED(resource) delete this; } diff --git a/src/wayland/idlenotify_v1_interface.cpp b/src/wayland/idlenotify_v1_interface.cpp index 73bce6c9ff..06fae97b5b 100644 --- a/src/wayland/idlenotify_v1_interface.cpp +++ b/src/wayland/idlenotify_v1_interface.cpp @@ -52,7 +52,6 @@ void IdleNotifyV1InterfacePrivate::ext_idle_notifier_v1_destroy(Resource *resour void IdleNotifyV1InterfacePrivate::ext_idle_notifier_v1_get_idle_notification(Resource *resource, uint32_t id, uint32_t timeout, struct ::wl_resource *seat) { - Q_UNUSED(seat) new IdleNotificationV1Interface(resource->client(), resource->version(), id, std::chrono::milliseconds(timeout)); } @@ -70,7 +69,6 @@ IdleNotificationV1Interface::IdleNotificationV1Interface(wl_client *client, int void IdleNotificationV1Interface::ext_idle_notification_v1_destroy_resource(Resource *resource) { - Q_UNUSED(resource) delete this; } diff --git a/src/wayland/inputmethod_v1_interface.cpp b/src/wayland/inputmethod_v1_interface.cpp index 2877cc3416..413ce0d239 100644 --- a/src/wayland/inputmethod_v1_interface.cpp +++ b/src/wayland/inputmethod_v1_interface.cpp @@ -315,7 +315,6 @@ public: , SurfaceRole(surface, QByteArrayLiteral("input_panel_surface_v1")) , q(q) { - Q_UNUSED(id) } void zwp_input_panel_surface_v1_set_overlay_panel(Resource *) override diff --git a/src/wayland/keyboard_shortcuts_inhibit_v1_interface.cpp b/src/wayland/keyboard_shortcuts_inhibit_v1_interface.cpp index b845959809..e839034e0b 100644 --- a/src/wayland/keyboard_shortcuts_inhibit_v1_interface.cpp +++ b/src/wayland/keyboard_shortcuts_inhibit_v1_interface.cpp @@ -80,7 +80,6 @@ void KeyboardShortcutsInhibitorV1InterfacePrivate::zwp_keyboard_shortcuts_inhibi void KeyboardShortcutsInhibitorV1InterfacePrivate::zwp_keyboard_shortcuts_inhibitor_v1_destroy_resource(Resource *resource) { - Q_UNUSED(resource) // Ensure manager don't track anymore this inhibitor if (m_manager) { m_manager->removeInhibitor(m_surface, m_seat); diff --git a/src/wayland/layershell_v1_interface.cpp b/src/wayland/layershell_v1_interface.cpp index 447c238d96..64c8cb5796 100644 --- a/src/wayland/layershell_v1_interface.cpp +++ b/src/wayland/layershell_v1_interface.cpp @@ -156,14 +156,12 @@ LayerSurfaceV1InterfacePrivate::LayerSurfaceV1InterfacePrivate(LayerSurfaceV1Int void LayerSurfaceV1InterfacePrivate::zwlr_layer_surface_v1_destroy_resource(Resource *resource) { - Q_UNUSED(resource) Q_EMIT q->aboutToBeDestroyed(); delete q; } void LayerSurfaceV1InterfacePrivate::zwlr_layer_surface_v1_set_size(Resource *resource, uint32_t width, uint32_t height) { - Q_UNUSED(resource) pending.desiredSize = QSize(width, height); } @@ -206,7 +204,6 @@ void LayerSurfaceV1InterfacePrivate::zwlr_layer_surface_v1_set_margin(Resource * void LayerSurfaceV1InterfacePrivate::zwlr_layer_surface_v1_set_keyboard_interactivity(Resource *resource, uint32_t keyboard_interactivity) { - Q_UNUSED(resource) pending.acceptsFocus = keyboard_interactivity; } diff --git a/src/wayland/linuxdmabufv1clientbuffer.cpp b/src/wayland/linuxdmabufv1clientbuffer.cpp index 29cee42e81..90a29f5f0d 100644 --- a/src/wayland/linuxdmabufv1clientbuffer.cpp +++ b/src/wayland/linuxdmabufv1clientbuffer.cpp @@ -91,7 +91,6 @@ LinuxDmaBufParamsV1::LinuxDmaBufParamsV1(LinuxDmaBufV1ClientBufferIntegration *i void LinuxDmaBufParamsV1::zwp_linux_buffer_params_v1_destroy_resource(Resource *resource) { - Q_UNUSED(resource) delete this; } diff --git a/src/wayland/outputmanagement_v2_interface.cpp b/src/wayland/outputmanagement_v2_interface.cpp index 0c3dc5bb63..060e23931a 100644 --- a/src/wayland/outputmanagement_v2_interface.cpp +++ b/src/wayland/outputmanagement_v2_interface.cpp @@ -89,15 +89,12 @@ OutputConfigurationV2Interface::OutputConfigurationV2Interface(wl_resource *reso void OutputConfigurationV2Interface::kde_output_configuration_v2_enable(Resource *resource, wl_resource *outputdevice, int32_t enable) { - Q_UNUSED(resource) - OutputDeviceV2Interface *output = OutputDeviceV2Interface::get(outputdevice); config.changeSet(output->handle())->enabled = enable; } void OutputConfigurationV2Interface::kde_output_configuration_v2_mode(Resource *resource, wl_resource *outputdevice, wl_resource *modeResource) { - Q_UNUSED(resource) OutputDeviceV2Interface *output = OutputDeviceV2Interface::get(outputdevice); OutputDeviceModeV2Interface *mode = OutputDeviceModeV2Interface::get(modeResource); if (!mode) { @@ -109,7 +106,6 @@ void OutputConfigurationV2Interface::kde_output_configuration_v2_mode(Resource * void OutputConfigurationV2Interface::kde_output_configuration_v2_transform(Resource *resource, wl_resource *outputdevice, int32_t transform) { - Q_UNUSED(resource) auto toTransform = [transform]() { switch (transform) { case WL_OUTPUT_TRANSFORM_90: @@ -138,14 +134,12 @@ void OutputConfigurationV2Interface::kde_output_configuration_v2_transform(Resou void OutputConfigurationV2Interface::kde_output_configuration_v2_position(Resource *resource, wl_resource *outputdevice, int32_t x, int32_t y) { - Q_UNUSED(resource) OutputDeviceV2Interface *output = OutputDeviceV2Interface::get(outputdevice); config.changeSet(output->handle())->pos = QPoint(x, y); } void OutputConfigurationV2Interface::kde_output_configuration_v2_scale(Resource *resource, wl_resource *outputdevice, wl_fixed_t scale) { - Q_UNUSED(resource) const qreal doubleScale = wl_fixed_to_double(scale); if (doubleScale <= 0) { @@ -159,7 +153,6 @@ void OutputConfigurationV2Interface::kde_output_configuration_v2_scale(Resource void OutputConfigurationV2Interface::kde_output_configuration_v2_overscan(Resource *resource, wl_resource *outputdevice, uint32_t overscan) { - Q_UNUSED(resource) if (overscan > 100) { qCWarning(KWIN_CORE) << "Invalid overscan requested:" << overscan; return; @@ -170,7 +163,6 @@ void OutputConfigurationV2Interface::kde_output_configuration_v2_overscan(Resour void OutputConfigurationV2Interface::kde_output_configuration_v2_set_vrr_policy(Resource *resource, wl_resource *outputdevice, uint32_t policy) { - Q_UNUSED(resource) if (policy > static_cast(RenderLoop::VrrPolicy::Automatic)) { qCWarning(KWIN_CORE) << "Invalid Vrr Policy requested:" << policy; return; @@ -181,7 +173,6 @@ void OutputConfigurationV2Interface::kde_output_configuration_v2_set_vrr_policy( void OutputConfigurationV2Interface::kde_output_configuration_v2_set_rgb_range(Resource *resource, wl_resource *outputdevice, uint32_t rgbRange) { - Q_UNUSED(resource) if (rgbRange > static_cast(Output::RgbRange::Limited)) { qCWarning(KWIN_CORE) << "Invalid Rgb Range requested:" << rgbRange; return; @@ -192,7 +183,6 @@ void OutputConfigurationV2Interface::kde_output_configuration_v2_set_rgb_range(R void OutputConfigurationV2Interface::kde_output_configuration_v2_set_primary_output(Resource *resource, struct ::wl_resource *output) { - Q_UNUSED(resource); primaryOutput = OutputDeviceV2Interface::get(output); } @@ -203,7 +193,6 @@ void OutputConfigurationV2Interface::kde_output_configuration_v2_destroy(Resourc void OutputConfigurationV2Interface::kde_output_configuration_v2_destroy_resource(Resource *resource) { - Q_UNUSED(resource) delete this; } diff --git a/src/wayland/plasmashell_interface.cpp b/src/wayland/plasmashell_interface.cpp index fb9a9b705c..45b04a13b9 100644 --- a/src/wayland/plasmashell_interface.cpp +++ b/src/wayland/plasmashell_interface.cpp @@ -127,20 +127,16 @@ void PlasmaShellSurfaceInterfacePrivate::org_kde_plasma_surface_destroy(Resource void PlasmaShellSurfaceInterfacePrivate::org_kde_plasma_surface_destroy_resource(Resource *resource) { - Q_UNUSED(resource) delete q; } void PlasmaShellSurfaceInterfacePrivate::org_kde_plasma_surface_set_output(Resource *resource, struct ::wl_resource *output) { - Q_UNUSED(resource) - Q_UNUSED(output) // TODO: implement } void PlasmaShellSurfaceInterfacePrivate::org_kde_plasma_surface_set_position(Resource *resource, int32_t x, int32_t y) { - Q_UNUSED(resource); QPoint globalPos(x, y); if (m_globalPos == globalPos && m_positionSet) { return; @@ -161,8 +157,6 @@ void PlasmaShellSurfaceInterfacePrivate::org_kde_plasma_surface_open_under_curso void PlasmaShellSurfaceInterfacePrivate::org_kde_plasma_surface_set_role(Resource *resource, uint32_t role) { - Q_UNUSED(resource) - PlasmaShellSurfaceInterface::Role r = PlasmaShellSurfaceInterface::Role::Normal; switch (role) { case role_desktop: @@ -200,8 +194,6 @@ void PlasmaShellSurfaceInterfacePrivate::org_kde_plasma_surface_set_role(Resourc void PlasmaShellSurfaceInterfacePrivate::org_kde_plasma_surface_set_panel_behavior(Resource *resource, uint32_t flag) { - Q_UNUSED(resource) - PlasmaShellSurfaceInterface::PanelBehavior newBehavior = PlasmaShellSurfaceInterface::PanelBehavior::AlwaysVisible; switch (flag) { case panel_behavior_auto_hide: @@ -226,16 +218,12 @@ void PlasmaShellSurfaceInterfacePrivate::org_kde_plasma_surface_set_panel_behavi void PlasmaShellSurfaceInterfacePrivate::org_kde_plasma_surface_set_skip_taskbar(Resource *resource, uint32_t skip) { - Q_UNUSED(resource) - m_skipTaskbar = (bool)skip; Q_EMIT q->skipTaskbarChanged(); } void PlasmaShellSurfaceInterfacePrivate::org_kde_plasma_surface_set_skip_switcher(Resource *resource, uint32_t skip) { - Q_UNUSED(resource) - m_skipSwitcher = (bool)skip; Q_EMIT q->skipSwitcherChanged(); } @@ -262,8 +250,6 @@ void PlasmaShellSurfaceInterfacePrivate::org_kde_plasma_surface_panel_auto_hide_ void PlasmaShellSurfaceInterfacePrivate::org_kde_plasma_surface_set_panel_takes_focus(Resource *resource, uint32_t takesFocus) { - Q_UNUSED(resource) - if (m_panelTakesFocus == takesFocus) { return; } diff --git a/src/wayland/plasmavirtualdesktop_interface.cpp b/src/wayland/plasmavirtualdesktop_interface.cpp index 22a8742a81..23e1cd6616 100644 --- a/src/wayland/plasmavirtualdesktop_interface.cpp +++ b/src/wayland/plasmavirtualdesktop_interface.cpp @@ -84,14 +84,12 @@ void PlasmaVirtualDesktopManagementInterfacePrivate::org_kde_plasma_virtual_desk const QString &name, uint32_t position) { - Q_UNUSED(resource) Q_EMIT q->desktopCreateRequested(name, qBound(0, position, (quint32)desktops.count())); } void PlasmaVirtualDesktopManagementInterfacePrivate::org_kde_plasma_virtual_desktop_management_request_remove_virtual_desktop(Resource *resource, const QString &desktop_id) { - Q_UNUSED(resource) Q_EMIT q->desktopRemoveRequested(desktop_id); } @@ -222,7 +220,6 @@ void PlasmaVirtualDesktopManagementInterface::sendDone() void PlasmaVirtualDesktopInterfacePrivate::org_kde_plasma_virtual_desktop_request_activate(Resource *resource) { - Q_UNUSED(resource) Q_EMIT q->activateRequested(); } diff --git a/src/wayland/plasmawindowmanagement_interface.cpp b/src/wayland/plasmawindowmanagement_interface.cpp index eb0111b24d..1e9badebae 100644 --- a/src/wayland/plasmawindowmanagement_interface.cpp +++ b/src/wayland/plasmawindowmanagement_interface.cpp @@ -200,7 +200,6 @@ void PlasmaWindowManagementInterfacePrivate::org_kde_plasma_window_management_bi void PlasmaWindowManagementInterfacePrivate::org_kde_plasma_window_management_show_desktop(Resource *resource, uint32_t state) { - Q_UNUSED(resource) PlasmaWindowManagementInterface::ShowingDesktopState s = PlasmaWindowManagementInterface::ShowingDesktopState::Disabled; switch (state) { case ORG_KDE_PLASMA_WINDOW_MANAGEMENT_SHOW_DESKTOP_ENABLED: @@ -454,7 +453,6 @@ void PlasmaWindowInterfacePrivate::setResourceName(const QString &resourceName) void PlasmaWindowInterfacePrivate::org_kde_plasma_window_get_icon(Resource *resource, int32_t fd) { - Q_UNUSED(resource) QtConcurrent::run( [fd](const QIcon &icon) { QFile file; @@ -468,37 +466,31 @@ void PlasmaWindowInterfacePrivate::org_kde_plasma_window_get_icon(Resource *reso void PlasmaWindowInterfacePrivate::org_kde_plasma_window_request_enter_virtual_desktop(Resource *resource, const QString &id) { - Q_UNUSED(resource) Q_EMIT q->enterPlasmaVirtualDesktopRequested(id); } void PlasmaWindowInterfacePrivate::org_kde_plasma_window_request_enter_new_virtual_desktop(Resource *resource) { - Q_UNUSED(resource) Q_EMIT q->enterNewPlasmaVirtualDesktopRequested(); } void PlasmaWindowInterfacePrivate::org_kde_plasma_window_request_leave_virtual_desktop(Resource *resource, const QString &id) { - Q_UNUSED(resource) Q_EMIT q->leavePlasmaVirtualDesktopRequested(id); } void PlasmaWindowInterfacePrivate::org_kde_plasma_window_request_enter_activity(Resource *resource, const QString &id) { - Q_UNUSED(resource) Q_EMIT q->enterPlasmaActivityRequested(id); } void PlasmaWindowInterfacePrivate::org_kde_plasma_window_request_leave_activity(Resource *resource, const QString &id) { - Q_UNUSED(resource) Q_EMIT q->leavePlasmaActivityRequested(id); } void PlasmaWindowInterfacePrivate::org_kde_plasma_window_send_to_output(Resource *resource, struct wl_resource *output) { - Q_UNUSED(resource) Q_EMIT q->sendToOutput(KWaylandServer::OutputInterface::get(output)); } @@ -624,33 +616,26 @@ void PlasmaWindowInterfacePrivate::setApplicationMenuPaths(const QString &servic void PlasmaWindowInterfacePrivate::org_kde_plasma_window_close(Resource *resource) { - Q_UNUSED(resource) Q_EMIT q->closeRequested(); } void PlasmaWindowInterfacePrivate::org_kde_plasma_window_request_move(Resource *resource) { - Q_UNUSED(resource) Q_EMIT q->moveRequested(); } void PlasmaWindowInterfacePrivate::org_kde_plasma_window_request_resize(Resource *resource) { - Q_UNUSED(resource) Q_EMIT q->resizeRequested(); } void PlasmaWindowInterfacePrivate::org_kde_plasma_window_set_virtual_desktop(Resource *resource, uint32_t number) { - Q_UNUSED(resource) - Q_UNUSED(number) - // This method is intentionally left blank. } void PlasmaWindowInterfacePrivate::org_kde_plasma_window_set_state(Resource *resource, uint32_t flags, uint32_t state) { - Q_UNUSED(resource) if (flags & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_ACTIVE) { Q_EMIT q->activeRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_ACTIVE); } @@ -714,7 +699,6 @@ void PlasmaWindowInterfacePrivate::org_kde_plasma_window_set_minimized_geometry( uint32_t width, uint32_t height) { - Q_UNUSED(resource) SurfaceInterface *panelSurface = SurfaceInterface::get(panel); if (!panelSurface) { @@ -736,7 +720,6 @@ void PlasmaWindowInterfacePrivate::org_kde_plasma_window_set_minimized_geometry( void PlasmaWindowInterfacePrivate::org_kde_plasma_window_unset_minimized_geometry(Resource *resource, wl_resource *panel) { - Q_UNUSED(resource) SurfaceInterface *panelSurface = SurfaceInterface::get(panel); if (!panelSurface) { diff --git a/src/wayland/pointerconstraints_v1_interface.cpp b/src/wayland/pointerconstraints_v1_interface.cpp index 87983ce2d2..35aef57da2 100644 --- a/src/wayland/pointerconstraints_v1_interface.cpp +++ b/src/wayland/pointerconstraints_v1_interface.cpp @@ -162,7 +162,6 @@ void LockedPointerV1InterfacePrivate::commit() void LockedPointerV1InterfacePrivate::zwp_locked_pointer_v1_destroy_resource(Resource *resource) { - Q_UNUSED(resource) Q_EMIT q->aboutToBeDestroyed(); delete q; } @@ -174,14 +173,12 @@ void LockedPointerV1InterfacePrivate::zwp_locked_pointer_v1_destroy(Resource *re void LockedPointerV1InterfacePrivate::zwp_locked_pointer_v1_set_cursor_position_hint(Resource *resource, wl_fixed_t surface_x, wl_fixed_t surface_y) { - Q_UNUSED(resource) pendingHint = QPointF(wl_fixed_to_double(surface_x), wl_fixed_to_double(surface_y)); hasPendingHint = true; } void LockedPointerV1InterfacePrivate::zwp_locked_pointer_v1_set_region(Resource *resource, ::wl_resource *region_resource) { - Q_UNUSED(resource) pendingRegion = regionFromResource(region_resource); hasPendingRegion = true; } @@ -263,7 +260,6 @@ void ConfinedPointerV1InterfacePrivate::commit() void ConfinedPointerV1InterfacePrivate::zwp_confined_pointer_v1_destroy_resource(Resource *resource) { - Q_UNUSED(resource) delete q; } @@ -274,7 +270,6 @@ void ConfinedPointerV1InterfacePrivate::zwp_confined_pointer_v1_destroy(Resource void ConfinedPointerV1InterfacePrivate::zwp_confined_pointer_v1_set_region(Resource *resource, ::wl_resource *region_resource) { - Q_UNUSED(resource) pendingRegion = regionFromResource(region_resource); hasPendingRegion = true; } diff --git a/src/wayland/primaryselectiondevice_v1_interface.cpp b/src/wayland/primaryselectiondevice_v1_interface.cpp index 6721f960c9..e37b257325 100644 --- a/src/wayland/primaryselectiondevice_v1_interface.cpp +++ b/src/wayland/primaryselectiondevice_v1_interface.cpp @@ -47,8 +47,6 @@ PrimarySelectionDeviceV1InterfacePrivate::PrimarySelectionDeviceV1InterfacePriva void PrimarySelectionDeviceV1InterfacePrivate::zwp_primary_selection_device_v1_set_selection(Resource *resource, wl_resource *source, uint32_t serial) { - Q_UNUSED(resource) - Q_UNUSED(serial) PrimarySelectionSourceV1Interface *dataSource = nullptr; if (source) { @@ -95,7 +93,6 @@ PrimarySelectionOfferV1Interface *PrimarySelectionDeviceV1InterfacePrivate::crea void PrimarySelectionDeviceV1InterfacePrivate::zwp_primary_selection_device_v1_destroy_resource( QtWaylandServer::zwp_primary_selection_device_v1::Resource *resource) { - Q_UNUSED(resource) delete q; } diff --git a/src/wayland/primaryselectionoffer_v1_interface.cpp b/src/wayland/primaryselectionoffer_v1_interface.cpp index b813ad9ad3..fcc5a7093c 100644 --- a/src/wayland/primaryselectionoffer_v1_interface.cpp +++ b/src/wayland/primaryselectionoffer_v1_interface.cpp @@ -46,13 +46,11 @@ void PrimarySelectionOfferV1InterfacePrivate::zwp_primary_selection_offer_v1_des void PrimarySelectionOfferV1InterfacePrivate::zwp_primary_selection_offer_v1_destroy_resource( QtWaylandServer::zwp_primary_selection_offer_v1::Resource *resource) { - Q_UNUSED(resource) delete q; } void PrimarySelectionOfferV1InterfacePrivate::zwp_primary_selection_offer_v1_receive(Resource *resource, const QString &mimeType, qint32 fd) { - Q_UNUSED(resource) if (!source) { close(fd); return; diff --git a/src/wayland/primaryselectionsource_v1_interface.cpp b/src/wayland/primaryselectionsource_v1_interface.cpp index a38ffbd7de..8d4e74ba68 100644 --- a/src/wayland/primaryselectionsource_v1_interface.cpp +++ b/src/wayland/primaryselectionsource_v1_interface.cpp @@ -39,7 +39,6 @@ PrimarySelectionSourceV1InterfacePrivate::PrimarySelectionSourceV1InterfacePriva void PrimarySelectionSourceV1InterfacePrivate::zwp_primary_selection_source_v1_destroy_resource( QtWaylandServer::zwp_primary_selection_source_v1::Resource *resource) { - Q_UNUSED(resource) Q_EMIT q->aboutToBeDestroyed(); delete q; } diff --git a/src/wayland/screencast_v1_interface.cpp b/src/wayland/screencast_v1_interface.cpp index 69adc97d89..e6767e1db0 100644 --- a/src/wayland/screencast_v1_interface.cpp +++ b/src/wayland/screencast_v1_interface.cpp @@ -27,7 +27,6 @@ public: void zkde_screencast_stream_unstable_v1_destroy_resource(Resource *resource) override { - Q_UNUSED(resource); if (!stopped) { Q_EMIT q->finished(); } @@ -37,7 +36,6 @@ public: void zkde_screencast_stream_unstable_v1_close(Resource *resource) override { - Q_UNUSED(resource); Q_EMIT q->finished(); stopped = true; wl_resource_destroy(resource->handle); diff --git a/src/wayland/seat_interface.cpp b/src/wayland/seat_interface.cpp index db8832b347..44280ffa7f 100644 --- a/src/wayland/seat_interface.cpp +++ b/src/wayland/seat_interface.cpp @@ -224,7 +224,6 @@ void SeatInterfacePrivate::registerDataControlDevice(DataControlDeviceV1Interfac }); QObject::connect(dataDevice, &DataControlDeviceV1Interface::selectionCleared, q, [this, dataDevice] { - Q_UNUSED(dataDevice); q->setSelection(nullptr); }); diff --git a/src/wayland/server_decoration_interface.cpp b/src/wayland/server_decoration_interface.cpp index edce6a05ff..0e0541bbdd 100644 --- a/src/wayland/server_decoration_interface.cpp +++ b/src/wayland/server_decoration_interface.cpp @@ -135,7 +135,6 @@ QVector ServerSideDecorationInterfacePri void ServerSideDecorationInterfacePrivate::org_kde_kwin_server_decoration_request_mode(Resource *resource, uint32_t mode) { - Q_UNUSED(resource) ServerSideDecorationManagerInterface::Mode m = ServerSideDecorationManagerInterface::Mode::None; switch (mode) { case ServerSideDecorationManagerInterfacePrivate::mode_None: @@ -163,7 +162,6 @@ void ServerSideDecorationInterfacePrivate::org_kde_kwin_server_decoration_releas void ServerSideDecorationInterfacePrivate::org_kde_kwin_server_decoration_destroy_resource(Resource *resource) { - Q_UNUSED(resource) delete q; } diff --git a/src/wayland/server_decoration_palette_interface.cpp b/src/wayland/server_decoration_palette_interface.cpp index 2b017d5a13..1ec3b73933 100644 --- a/src/wayland/server_decoration_palette_interface.cpp +++ b/src/wayland/server_decoration_palette_interface.cpp @@ -100,8 +100,6 @@ void ServerSideDecorationPaletteInterfacePrivate::org_kde_kwin_server_decoration void ServerSideDecorationPaletteInterfacePrivate::org_kde_kwin_server_decoration_palette_set_palette(Resource *resource, const QString &palette) { - Q_UNUSED(resource) - if (this->palette == palette) { return; } @@ -111,7 +109,6 @@ void ServerSideDecorationPaletteInterfacePrivate::org_kde_kwin_server_decoration void ServerSideDecorationPaletteInterfacePrivate::org_kde_kwin_server_decoration_palette_destroy_resource(Resource *resource) { - Q_UNUSED(resource) delete q; } diff --git a/src/wayland/shadow_interface.cpp b/src/wayland/shadow_interface.cpp index 1c3a162415..b2cb1a3628 100644 --- a/src/wayland/shadow_interface.cpp +++ b/src/wayland/shadow_interface.cpp @@ -62,7 +62,6 @@ void ShadowManagerInterfacePrivate::org_kde_kwin_shadow_manager_create(Resource void ShadowManagerInterfacePrivate::org_kde_kwin_shadow_manager_unset(Resource *resource, wl_resource *surface) { - Q_UNUSED(resource) SurfaceInterface *s = SurfaceInterface::get(surface); if (!s) { wl_resource_post_error(resource->handle, 0, "Invalid surface"); @@ -145,7 +144,6 @@ protected: void ShadowInterfacePrivate::org_kde_kwin_shadow_commit(Resource *resource) { - Q_UNUSED(resource) #define BUFFER(__FLAG__, __PART__) \ if (pending.flags & State::Flags::__FLAG__##Buffer) { \ if (current.__PART__) { \ @@ -214,82 +212,69 @@ void ShadowInterfacePrivate::org_kde_kwin_shadow_destroy(Resource *resource) void ShadowInterfacePrivate::org_kde_kwin_shadow_destroy_resource(Resource *resource) { - Q_UNUSED(resource) delete q; } void ShadowInterfacePrivate::org_kde_kwin_shadow_attach_left(Resource *resource, wl_resource *buffer) { - Q_UNUSED(resource) attach(State::LeftBuffer, buffer); } void ShadowInterfacePrivate::org_kde_kwin_shadow_attach_top_left(Resource *resource, wl_resource *buffer) { - Q_UNUSED(resource) attach(State::TopLeftBuffer, buffer); } void ShadowInterfacePrivate::org_kde_kwin_shadow_attach_top(Resource *resource, wl_resource *buffer) { - Q_UNUSED(resource) attach(State::TopBuffer, buffer); } void ShadowInterfacePrivate::org_kde_kwin_shadow_attach_top_right(Resource *resource, wl_resource *buffer) { - Q_UNUSED(resource) attach(State::TopRightBuffer, buffer); } void ShadowInterfacePrivate::org_kde_kwin_shadow_attach_right(Resource *resource, wl_resource *buffer) { - Q_UNUSED(resource) attach(State::RightBuffer, buffer); } void ShadowInterfacePrivate::org_kde_kwin_shadow_attach_bottom_right(Resource *resource, wl_resource *buffer) { - Q_UNUSED(resource) attach(State::BottomRightBuffer, buffer); } void ShadowInterfacePrivate::org_kde_kwin_shadow_attach_bottom(Resource *resource, wl_resource *buffer) { - Q_UNUSED(resource) attach(State::BottomBuffer, buffer); } void ShadowInterfacePrivate::org_kde_kwin_shadow_attach_bottom_left(Resource *resource, wl_resource *buffer) { - Q_UNUSED(resource) attach(State::BottomLeftBuffer, buffer); } void ShadowInterfacePrivate::org_kde_kwin_shadow_set_left_offset(Resource *resource, wl_fixed_t offset) { - Q_UNUSED(resource) pending.flags = State::Flags(pending.flags | State::Offset); pending.offset.setLeft(wl_fixed_to_double(offset)); } void ShadowInterfacePrivate::org_kde_kwin_shadow_set_top_offset(Resource *resource, wl_fixed_t offset) { - Q_UNUSED(resource) pending.flags = State::Flags(pending.flags | State::Offset); pending.offset.setTop(wl_fixed_to_double(offset)); } void ShadowInterfacePrivate::org_kde_kwin_shadow_set_right_offset(Resource *resource, wl_fixed_t offset) { - Q_UNUSED(resource) pending.flags = State::Flags(pending.flags | State::Offset); pending.offset.setRight(wl_fixed_to_double(offset)); } void ShadowInterfacePrivate::org_kde_kwin_shadow_set_bottom_offset(Resource *resource, wl_fixed_t offset) { - Q_UNUSED(resource) pending.flags = State::Flags(pending.flags | State::Offset); pending.offset.setBottom(wl_fixed_to_double(offset)); } diff --git a/src/wayland/shmclientbuffer.cpp b/src/wayland/shmclientbuffer.cpp index b9cefced2d..48bfd46b7d 100644 --- a/src/wayland/shmclientbuffer.cpp +++ b/src/wayland/shmclientbuffer.cpp @@ -50,8 +50,6 @@ static void cleanupShmPool(void *poolHandle) void ShmClientBufferPrivate::buffer_destroy_callback(wl_listener *listener, void *data) { - Q_UNUSED(data) - auto bufferPrivate = reinterpret_cast(listener)->receiver; wl_shm_buffer *buffer = wl_shm_buffer_get(bufferPrivate->q->resource()); wl_shm_pool *pool = wl_shm_buffer_ref_pool(buffer); diff --git a/src/wayland/slide_interface.cpp b/src/wayland/slide_interface.cpp index 4ba68d847e..00d6008d86 100644 --- a/src/wayland/slide_interface.cpp +++ b/src/wayland/slide_interface.cpp @@ -103,20 +103,17 @@ protected: void SlideInterfacePrivate::org_kde_kwin_slide_commit(Resource *resource) { - Q_UNUSED(resource) currentLocation = pendingLocation; currentOffset = pendingOffset; } void SlideInterfacePrivate::org_kde_kwin_slide_set_location(Resource *resource, uint32_t location) { - Q_UNUSED(resource) pendingLocation = (SlideInterface::Location)location; } void SlideInterfacePrivate::org_kde_kwin_slide_set_offset(Resource *resource, int32_t offset) { - Q_UNUSED(resource) pendingOffset = offset; } @@ -127,7 +124,6 @@ void SlideInterfacePrivate::org_kde_kwin_slide_release(Resource *resource) void SlideInterfacePrivate::org_kde_kwin_slide_destroy_resource(Resource *resource) { - Q_UNUSED(resource) delete q; } diff --git a/src/wayland/subcompositor_interface.cpp b/src/wayland/subcompositor_interface.cpp index 985172c7cb..e71397337f 100644 --- a/src/wayland/subcompositor_interface.cpp +++ b/src/wayland/subcompositor_interface.cpp @@ -92,7 +92,6 @@ SubSurfaceInterfacePrivate::SubSurfaceInterfacePrivate(SubSurfaceInterface *q, S void SubSurfaceInterfacePrivate::subsurface_destroy_resource(Resource *resource) { - Q_UNUSED(resource) delete q; } @@ -103,7 +102,6 @@ void SubSurfaceInterfacePrivate::subsurface_destroy(Resource *resource) void SubSurfaceInterfacePrivate::subsurface_set_position(Resource *resource, int32_t x, int32_t y) { - Q_UNUSED(resource) if (pendingPosition == QPoint(x, y)) { return; } diff --git a/src/wayland/surface_interface.cpp b/src/wayland/surface_interface.cpp index ef0ff6a1db..bdcde29887 100644 --- a/src/wayland/surface_interface.cpp +++ b/src/wayland/surface_interface.cpp @@ -295,7 +295,6 @@ void SurfaceInterfacePrivate::surface_frame(Resource *resource, uint32_t callbac void SurfaceInterfacePrivate::surface_set_opaque_region(Resource *resource, struct ::wl_resource *region) { - Q_UNUSED(resource) RegionInterface *r = RegionInterface::get(region); pending.opaque = r ? r->region() : QRegion(); pending.opaqueIsSet = true; @@ -303,7 +302,6 @@ void SurfaceInterfacePrivate::surface_set_opaque_region(Resource *resource, stru void SurfaceInterfacePrivate::surface_set_input_region(Resource *resource, struct ::wl_resource *region) { - Q_UNUSED(resource) RegionInterface *r = RegionInterface::get(region); pending.input = r ? r->region() : infiniteRegion(); pending.inputIsSet = true; @@ -311,7 +309,6 @@ void SurfaceInterfacePrivate::surface_set_input_region(Resource *resource, struc void SurfaceInterfacePrivate::surface_commit(Resource *resource) { - Q_UNUSED(resource) if (subSurface) { commitSubSurface(); } else { @@ -341,13 +338,11 @@ void SurfaceInterfacePrivate::surface_set_buffer_scale(Resource *resource, int32 void SurfaceInterfacePrivate::surface_damage_buffer(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) { - Q_UNUSED(resource) pending.bufferDamage |= QRect(x, y, width, height); } void SurfaceInterfacePrivate::surface_offset(Resource *resource, int32_t x, int32_t y) { - Q_UNUSED(resource) pending.offset = QPoint(x, y); } diff --git a/src/wayland/tablet_v2_interface.cpp b/src/wayland/tablet_v2_interface.cpp index 2995877884..761366b329 100644 --- a/src/wayland/tablet_v2_interface.cpp +++ b/src/wayland/tablet_v2_interface.cpp @@ -760,7 +760,6 @@ TabletPadV2Interface *TabletSeatV2Interface::addTabletPad(const QString &sysname quint32 currentMode, TabletV2Interface *tablet) { - Q_UNUSED(name); auto iface = new TabletPadV2Interface(paths.at(0), buttons, rings, strips, modes, currentMode, d->m_display, this); iface->d->m_seat = this; for (auto r : d->resourceMap()) { diff --git a/src/wayland/tests/paneltest.cpp b/src/wayland/tests/paneltest.cpp index 9de4da734e..7d999e5be4 100644 --- a/src/wayland/tests/paneltest.cpp +++ b/src/wayland/tests/paneltest.cpp @@ -163,8 +163,6 @@ void PanelTest::setupRegistry(Registry *registry) } auto p = m_seat->createPointer(this); connect(p, &Pointer::buttonStateChanged, this, [this](quint32 serial, quint32 time, quint32 button, KWayland::Client::Pointer::ButtonState state) { - Q_UNUSED(time) - Q_UNUSED(serial) if (!m_windowManagement) { return; } @@ -178,7 +176,6 @@ void PanelTest::setupRegistry(Registry *registry) } }); connect(p, &Pointer::entered, this, [this, p](quint32 serial, const QPointF &relativeToSurface) { - Q_UNUSED(serial) if (p->enteredSurface() == m_surface) { showTooltip(relativeToSurface); } diff --git a/src/wayland/tests/touchclienttest.cpp b/src/wayland/tests/touchclienttest.cpp index 46bd94e635..abfe426ed7 100644 --- a/src/wayland/tests/touchclienttest.cpp +++ b/src/wayland/tests/touchclienttest.cpp @@ -124,8 +124,6 @@ void WaylandClientTest::setupRegistry(Registry *registry) } Pointer *p = s->createPointer(this); connect(p, &Pointer::buttonStateChanged, this, [this](quint32 serial, quint32 time, quint32 button, Pointer::ButtonState state) { - Q_UNUSED(serial) - Q_UNUSED(time) if (state == Pointer::ButtonState::Released) { if (button == BTN_LEFT) { if (m_timer->isActive()) { diff --git a/src/wayland/tests/xdgforeigntest.cpp b/src/wayland/tests/xdgforeigntest.cpp index 560cffe329..386203c5ee 100644 --- a/src/wayland/tests/xdgforeigntest.cpp +++ b/src/wayland/tests/xdgforeigntest.cpp @@ -118,7 +118,7 @@ void XdgForeignTest::setupRegistry(Registry *registry) m_surface = m_compositor->createSurface(this); Q_ASSERT(m_surface); auto parentDeco = m_decoration->create(m_surface, this); - Q_UNUSED(parentDeco) + Q_ASSERT(parentDeco); m_shellSurface = m_shell->createSurface(m_surface, this); Q_ASSERT(m_shellSurface); connect(m_shellSurface, &XdgShellSurface::sizeChanged, this, &XdgForeignTest::render); @@ -126,7 +126,7 @@ void XdgForeignTest::setupRegistry(Registry *registry) m_childSurface = m_compositor->createSurface(this); Q_ASSERT(m_childSurface); auto childDeco = m_decoration->create(m_childSurface, this); - Q_UNUSED(childDeco) + Q_ASSERT(childDeco); m_childShellSurface = m_shell->createSurface(m_childSurface, this); Q_ASSERT(m_childShellSurface); connect(m_childShellSurface, &XdgShellSurface::sizeChanged, this, &XdgForeignTest::render); diff --git a/src/wayland/tests/xdgtest.cpp b/src/wayland/tests/xdgtest.cpp index 357d1c9c87..90647ac01a 100644 --- a/src/wayland/tests/xdgtest.cpp +++ b/src/wayland/tests/xdgtest.cpp @@ -106,8 +106,6 @@ void XdgTest::setupRegistry(Registry *registry) &XdgShellSurface::configureRequested, this, [this](const QSize &size, KWayland::Client::XdgShellSurface::States states, int serial) { - Q_UNUSED(size); - Q_UNUSED(states); m_xdgShellSurface->ackConfigure(serial); render(); }); @@ -124,9 +122,6 @@ void XdgTest::setupRegistry(Registry *registry) } Pointer *p = s->createPointer(this); connect(p, &Pointer::buttonStateChanged, this, [this](quint32 serial, quint32 time, quint32 button, Pointer::ButtonState state) { - Q_UNUSED(button) - Q_UNUSED(serial) - Q_UNUSED(time) if (state == Pointer::ButtonState::Released) { if (m_popupSurface) { m_popupSurface->deleteLater(); diff --git a/src/wayland/textinput_v2_interface.cpp b/src/wayland/textinput_v2_interface.cpp index 8d296f87ed..68c33630e5 100644 --- a/src/wayland/textinput_v2_interface.cpp +++ b/src/wayland/textinput_v2_interface.cpp @@ -336,7 +336,6 @@ TextInputV2InterfacePrivate::TextInputV2InterfacePrivate(SeatInterface *seat, Te void TextInputV2InterfacePrivate::zwp_text_input_v2_enable(Resource *resource, wl_resource *s) { - Q_UNUSED(resource) EnabledEmitter emitter(q); auto enabledSurface = SurfaceInterface::get(s); if (m_enabledSurfaces.contains(enabledSurface)) { @@ -351,7 +350,6 @@ void TextInputV2InterfacePrivate::zwp_text_input_v2_enable(Resource *resource, w void TextInputV2InterfacePrivate::zwp_text_input_v2_disable(Resource *resource, wl_resource *s) { - Q_UNUSED(resource) EnabledEmitter emitter(q); auto disabledSurface = SurfaceInterface::get(s); QObject::disconnect(disabledSurface, &SurfaceInterface::aboutToBeDestroyed, q, nullptr); @@ -363,19 +361,16 @@ void TextInputV2InterfacePrivate::zwp_text_input_v2_disable(Resource *resource, void TextInputV2InterfacePrivate::zwp_text_input_v2_update_state(Resource *resource, uint32_t serial, uint32_t reason) { - Q_UNUSED(resource) Q_EMIT q->stateUpdated(serial, TextInputV2Interface::UpdateReason(reason)); } void TextInputV2InterfacePrivate::zwp_text_input_v2_hide_input_panel(Resource *resource) { - Q_UNUSED(resource) Q_EMIT q->requestHideInputPanel(); } void TextInputV2InterfacePrivate::zwp_text_input_v2_set_surrounding_text(Resource *resource, const QString &text, int32_t cursor, int32_t anchor) { - Q_UNUSED(resource) surroundingText = text; surroundingTextCursorPosition = cursor; surroundingTextSelectionAnchor = anchor; @@ -384,7 +379,6 @@ void TextInputV2InterfacePrivate::zwp_text_input_v2_set_surrounding_text(Resourc void TextInputV2InterfacePrivate::zwp_text_input_v2_set_content_type(Resource *resource, uint32_t hint, uint32_t purpose) { - Q_UNUSED(resource) const auto contentHints = convertContentHint(hint); const auto contentPurpose = convertContentPurpose(purpose); if (this->contentHints != contentHints || this->contentPurpose != contentPurpose) { @@ -396,7 +390,6 @@ void TextInputV2InterfacePrivate::zwp_text_input_v2_set_content_type(Resource *r void TextInputV2InterfacePrivate::zwp_text_input_v2_set_cursor_rectangle(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) { - Q_UNUSED(resource) const QRect rect = QRect(x, y, width, height); if (cursorRectangle != rect) { cursorRectangle = rect; @@ -406,7 +399,6 @@ void TextInputV2InterfacePrivate::zwp_text_input_v2_set_cursor_rectangle(Resourc void TextInputV2InterfacePrivate::zwp_text_input_v2_set_preferred_language(Resource *resource, const QString &language) { - Q_UNUSED(resource) if (preferredLanguage != language) { preferredLanguage = language; Q_EMIT q->preferredLanguageChanged(preferredLanguage); @@ -415,7 +407,6 @@ void TextInputV2InterfacePrivate::zwp_text_input_v2_set_preferred_language(Resou void TextInputV2InterfacePrivate::zwp_text_input_v2_show_input_panel(Resource *resource) { - Q_UNUSED(resource) Q_EMIT q->requestShowInputPanel(); } diff --git a/src/wayland/textinput_v3_interface.cpp b/src/wayland/textinput_v3_interface.cpp index ea7ce620bf..f98887ac22 100644 --- a/src/wayland/textinput_v3_interface.cpp +++ b/src/wayland/textinput_v3_interface.cpp @@ -291,7 +291,6 @@ bool TextInputV3InterfacePrivate::isEnabled() const void TextInputV3InterfacePrivate::zwp_text_input_v3_enable(Resource *resource) { // reset pending state to default - Q_UNUSED(resource) defaultPending(); pending.enabled = true; } @@ -299,7 +298,6 @@ void TextInputV3InterfacePrivate::zwp_text_input_v3_enable(Resource *resource) void TextInputV3InterfacePrivate::zwp_text_input_v3_disable(Resource *resource) { // reset pending state to default - Q_UNUSED(resource) defaultPending(); preeditText = QString(); preeditCursorBegin = 0; @@ -308,7 +306,6 @@ void TextInputV3InterfacePrivate::zwp_text_input_v3_disable(Resource *resource) void TextInputV3InterfacePrivate::zwp_text_input_v3_set_surrounding_text(Resource *resource, const QString &text, int32_t cursor, int32_t anchor) { - Q_UNUSED(resource) // zwp_text_input_v3_set_surrounding_text is no-op if enabled request is not pending if (!pending.enabled) { return; @@ -320,7 +317,6 @@ void TextInputV3InterfacePrivate::zwp_text_input_v3_set_surrounding_text(Resourc void TextInputV3InterfacePrivate::zwp_text_input_v3_set_content_type(Resource *resource, uint32_t hint, uint32_t purpose) { - Q_UNUSED(resource) // zwp_text_input_v3_set_content_type is no-op if enabled request is not pending if (!pending.enabled) { return; @@ -331,7 +327,6 @@ void TextInputV3InterfacePrivate::zwp_text_input_v3_set_content_type(Resource *r void TextInputV3InterfacePrivate::zwp_text_input_v3_set_cursor_rectangle(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) { - Q_UNUSED(resource) // zwp_text_input_v3_set_cursor_rectangle is no-op if enabled request is not pending if (!pending.enabled) { return; @@ -341,7 +336,6 @@ void TextInputV3InterfacePrivate::zwp_text_input_v3_set_cursor_rectangle(Resourc void TextInputV3InterfacePrivate::zwp_text_input_v3_set_text_change_cause(Resource *resource, uint32_t cause) { - Q_UNUSED(resource) // zwp_text_input_v3_set_text_change_cause is no-op if enabled request is not pending if (!pending.enabled) { return; diff --git a/src/wayland/viewporter_interface.cpp b/src/wayland/viewporter_interface.cpp index e604f79476..f63a04c231 100644 --- a/src/wayland/viewporter_interface.cpp +++ b/src/wayland/viewporter_interface.cpp @@ -63,7 +63,6 @@ ViewportInterface *ViewportInterface::get(SurfaceInterface *surface) void ViewportInterface::wp_viewport_destroy_resource(Resource *resource) { - Q_UNUSED(resource) delete this; } diff --git a/src/wayland/xdgactivation_v1_interface.cpp b/src/wayland/xdgactivation_v1_interface.cpp index 103bec9ca8..5eea33dbcb 100644 --- a/src/wayland/xdgactivation_v1_interface.cpp +++ b/src/wayland/xdgactivation_v1_interface.cpp @@ -44,20 +44,17 @@ protected: void XdgActivationTokenV1Interface::xdg_activation_token_v1_set_serial(Resource *resource, uint32_t serial, struct ::wl_resource *seat) { - Q_UNUSED(resource); m_serial = serial; m_seat = seat; } void XdgActivationTokenV1Interface::xdg_activation_token_v1_set_app_id(Resource *resource, const QString &app_id) { - Q_UNUSED(resource); m_appId = app_id; } void XdgActivationTokenV1Interface::xdg_activation_token_v1_set_surface(Resource *resource, struct ::wl_resource *surface) { - Q_UNUSED(resource); m_surface = SurfaceInterface::get(surface); } @@ -82,7 +79,6 @@ void XdgActivationTokenV1Interface::xdg_activation_token_v1_destroy(Resource *re void XdgActivationTokenV1Interface::xdg_activation_token_v1_destroy_resource(Resource *resource) { - Q_UNUSED(resource); delete this; } @@ -114,7 +110,6 @@ void XdgActivationV1InterfacePrivate::xdg_activation_v1_get_activation_token(Res void XdgActivationV1InterfacePrivate::xdg_activation_v1_activate(Resource *resource, const QString &token, struct ::wl_resource *surface) { - Q_UNUSED(resource); Q_EMIT q->activateRequested(SurfaceInterface::get(surface), token); } diff --git a/src/wayland/xdgdecoration_v1_interface.cpp b/src/wayland/xdgdecoration_v1_interface.cpp index b28737ce49..867c2dc241 100644 --- a/src/wayland/xdgdecoration_v1_interface.cpp +++ b/src/wayland/xdgdecoration_v1_interface.cpp @@ -66,7 +66,6 @@ XdgToplevelDecorationV1InterfacePrivate::XdgToplevelDecorationV1InterfacePrivate void XdgToplevelDecorationV1InterfacePrivate::zxdg_toplevel_decoration_v1_destroy_resource(Resource *resource) { - Q_UNUSED(resource) delete q; } @@ -77,8 +76,6 @@ void XdgToplevelDecorationV1InterfacePrivate::zxdg_toplevel_decoration_v1_destro void XdgToplevelDecorationV1InterfacePrivate::zxdg_toplevel_decoration_v1_set_mode(Resource *resource, uint32_t mode) { - Q_UNUSED(resource) - switch (mode) { case mode_client_side: preferredMode = XdgToplevelDecorationV1Interface::Mode::Client; @@ -96,7 +93,6 @@ void XdgToplevelDecorationV1InterfacePrivate::zxdg_toplevel_decoration_v1_set_mo void XdgToplevelDecorationV1InterfacePrivate::zxdg_toplevel_decoration_v1_unset_mode(Resource *resource) { - Q_UNUSED(resource) preferredMode = XdgToplevelDecorationV1Interface::Mode::Undefined; Q_EMIT q->preferredModeChanged(preferredMode); } diff --git a/src/wayland/xdgforeign_v2_interface.cpp b/src/wayland/xdgforeign_v2_interface.cpp index 57478d9e56..d740483f0a 100644 --- a/src/wayland/xdgforeign_v2_interface.cpp +++ b/src/wayland/xdgforeign_v2_interface.cpp @@ -194,7 +194,6 @@ void XdgExportedV2Interface::zxdg_exported_v2_destroy(Resource *resource) void XdgExportedV2Interface::zxdg_exported_v2_destroy_resource(Resource *resource) { - Q_UNUSED(resource) delete this; } @@ -215,7 +214,6 @@ void XdgDummyImportedV2Interface::zxdg_imported_v2_destroy(Resource *resource) void XdgDummyImportedV2Interface::zxdg_imported_v2_destroy_resource(Resource *resource) { - Q_UNUSED(resource) delete this; } @@ -238,7 +236,6 @@ SurfaceInterface *XdgImportedV2Interface::surface() const void XdgImportedV2Interface::zxdg_imported_v2_set_parent_of(Resource *resource, wl_resource *surface) { - Q_UNUSED(resource) SurfaceInterface *surf = SurfaceInterface::get(surface); if (!surf) { @@ -256,7 +253,6 @@ void XdgImportedV2Interface::zxdg_imported_v2_destroy(Resource *resource) void XdgImportedV2Interface::zxdg_imported_v2_destroy_resource(Resource *resource) { - Q_UNUSED(resource) delete this; } diff --git a/src/wayland/xdgshell_interface.cpp b/src/wayland/xdgshell_interface.cpp index 4e5c1ea320..0cf7d60971 100644 --- a/src/wayland/xdgshell_interface.cpp +++ b/src/wayland/xdgshell_interface.cpp @@ -91,7 +91,6 @@ void XdgShellInterfacePrivate::xdg_wm_base_get_xdg_surface(Resource *resource, u void XdgShellInterfacePrivate::xdg_wm_base_pong(Resource *resource, uint32_t serial) { - Q_UNUSED(resource) if (QTimer *timer = pings.take(serial)) { delete timer; } @@ -168,7 +167,6 @@ XdgSurfaceInterfacePrivate *XdgSurfaceInterfacePrivate::get(XdgSurfaceInterface void XdgSurfaceInterfacePrivate::xdg_surface_destroy_resource(Resource *resource) { - Q_UNUSED(resource) Q_EMIT q->aboutToBeDestroyed(); XdgShellInterfacePrivate::get(shell)->unregisterXdgSurface(q); delete q; @@ -243,7 +241,6 @@ void XdgSurfaceInterfacePrivate::xdg_surface_set_window_geometry(Resource *resou void XdgSurfaceInterfacePrivate::xdg_surface_ack_configure(Resource *resource, uint32_t serial) { - Q_UNUSED(resource) next.acknowledgedConfigure = serial; next.acknowledgedConfigureIsSet = true; } @@ -343,7 +340,6 @@ void XdgToplevelInterfacePrivate::reset() void XdgToplevelInterfacePrivate::xdg_toplevel_destroy_resource(Resource *resource) { - Q_UNUSED(resource) Q_EMIT q->aboutToBeDestroyed(); delete q; } @@ -355,7 +351,6 @@ void XdgToplevelInterfacePrivate::xdg_toplevel_destroy(Resource *resource) void XdgToplevelInterfacePrivate::xdg_toplevel_set_parent(Resource *resource, ::wl_resource *parentResource) { - Q_UNUSED(resource) XdgToplevelInterface *parent = XdgToplevelInterface::get(parentResource); if (parentXdgToplevel == parent) { return; @@ -366,7 +361,6 @@ void XdgToplevelInterfacePrivate::xdg_toplevel_set_parent(Resource *resource, :: void XdgToplevelInterfacePrivate::xdg_toplevel_set_title(Resource *resource, const QString &title) { - Q_UNUSED(resource) if (windowTitle == title) { return; } @@ -376,7 +370,6 @@ void XdgToplevelInterfacePrivate::xdg_toplevel_set_title(Resource *resource, con void XdgToplevelInterfacePrivate::xdg_toplevel_set_app_id(Resource *resource, const QString &app_id) { - Q_UNUSED(resource) if (windowClass == app_id) { return; } @@ -443,32 +436,27 @@ void XdgToplevelInterfacePrivate::xdg_toplevel_set_min_size(Resource *resource, void XdgToplevelInterfacePrivate::xdg_toplevel_set_maximized(Resource *resource) { - Q_UNUSED(resource) Q_EMIT q->maximizeRequested(); } void XdgToplevelInterfacePrivate::xdg_toplevel_unset_maximized(Resource *resource) { - Q_UNUSED(resource) Q_EMIT q->unmaximizeRequested(); } void XdgToplevelInterfacePrivate::xdg_toplevel_set_fullscreen(Resource *resource, ::wl_resource *outputResource) { - Q_UNUSED(resource) OutputInterface *output = OutputInterface::get(outputResource); Q_EMIT q->fullscreenRequested(output); } void XdgToplevelInterfacePrivate::xdg_toplevel_unset_fullscreen(Resource *resource) { - Q_UNUSED(resource) Q_EMIT q->unfullscreenRequested(); } void XdgToplevelInterfacePrivate::xdg_toplevel_set_minimized(Resource *resource) { - Q_UNUSED(resource) Q_EMIT q->minimizeRequested(); } @@ -647,7 +635,6 @@ void XdgPopupInterfacePrivate::reset() void XdgPopupInterfacePrivate::xdg_popup_destroy_resource(Resource *resource) { - Q_UNUSED(resource) Q_EMIT q->aboutToBeDestroyed(); delete q; } @@ -672,7 +659,6 @@ void XdgPopupInterfacePrivate::xdg_popup_grab(Resource *resource, ::wl_resource void XdgPopupInterfacePrivate::xdg_popup_reposition(Resource *resource, ::wl_resource *positionerResource, uint32_t token) { - Q_UNUSED(resource) positioner = XdgPositioner::get(positionerResource); Q_EMIT q->repositionRequested(token); } @@ -759,7 +745,6 @@ XdgPositionerPrivate *XdgPositionerPrivate::get(wl_resource *resource) void XdgPositionerPrivate::xdg_positioner_destroy_resource(Resource *resource) { - Q_UNUSED(resource) delete this; } @@ -826,19 +811,16 @@ void XdgPositionerPrivate::xdg_positioner_set_anchor(Resource *resource, uint32_ void XdgPositionerPrivate::xdg_positioner_set_parent_size(Resource *resource, int32_t width, int32_t height) { - Q_UNUSED(resource) data->parentSize = QSize(width, height); } void XdgPositionerPrivate::xdg_positioner_set_reactive(Resource *resource) { - Q_UNUSED(resource) data->isReactive = true; } void XdgPositionerPrivate::xdg_positioner_set_parent_configure(Resource *resource, uint32_t serial) { - Q_UNUSED(resource) data->parentConfigure = serial; } @@ -882,8 +864,6 @@ void XdgPositionerPrivate::xdg_positioner_set_gravity(Resource *resource, uint32 void XdgPositionerPrivate::xdg_positioner_set_constraint_adjustment(Resource *resource, uint32_t constraint_adjustment) { - Q_UNUSED(resource) - if (constraint_adjustment & constraint_adjustment_flip_x) { data->flipConstraintAdjustments |= Qt::Horizontal; } else { @@ -923,7 +903,6 @@ void XdgPositionerPrivate::xdg_positioner_set_constraint_adjustment(Resource *re void XdgPositionerPrivate::xdg_positioner_set_offset(Resource *resource, int32_t x, int32_t y) { - Q_UNUSED(resource) data->offset = QPoint(x, y); } diff --git a/src/wayland/xwaylandkeyboardgrab_v1_interface.cpp b/src/wayland/xwaylandkeyboardgrab_v1_interface.cpp index 46e9306c6f..e74e04a2d8 100644 --- a/src/wayland/xwaylandkeyboardgrab_v1_interface.cpp +++ b/src/wayland/xwaylandkeyboardgrab_v1_interface.cpp @@ -95,7 +95,6 @@ void XWaylandKeyboardGrabV1InterfacePrivate::zwp_xwayland_keyboard_grab_v1_destr void XWaylandKeyboardGrabV1InterfacePrivate::zwp_xwayland_keyboard_grab_v1_destroy_resource(Resource *resource) { - Q_UNUSED(resource) delete q; } diff --git a/src/waylandwindow.cpp b/src/waylandwindow.cpp index 217b866573..42dc13148b 100644 --- a/src/waylandwindow.cpp +++ b/src/waylandwindow.cpp @@ -90,7 +90,6 @@ bool WaylandWindow::isLocalhost() const Window *WaylandWindow::findModal(bool allow_itself) { - Q_UNUSED(allow_itself) return nullptr; } diff --git a/src/window.cpp b/src/window.cpp index 28b594cea6..320ecd2051 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -107,7 +107,6 @@ Window::Window() // replace on-screen-display on size changes connect(this, &Window::frameGeometryChanged, this, [this](Window *c, const QRectF &old) { - Q_UNUSED(c) if (isOnScreenDisplay() && !frameGeometry().isEmpty() && old.size() != frameGeometry().size() && isPlaceable()) { GeometryUpdatesBlocker blocker(this); workspace()->placement()->place(this, workspace()->clientArea(PlacementArea, this, workspace()->activeOutput())); @@ -1162,7 +1161,6 @@ void Window::doSetDesktop() void Window::doSetOnActivities(const QStringList &activityList) { - Q_UNUSED(activityList); } void Window::enterDesktop(VirtualDesktop *virtualDesktop) @@ -1293,7 +1291,6 @@ void Window::setShade(ShadeMode mode) void Window::doSetShade(ShadeMode previousShadeMode) { - Q_UNUSED(previousShadeMode) } void Window::shadeHover() @@ -1582,7 +1579,6 @@ void Window::blockGeometryUpdates(bool block) void Window::maximize(MaximizeMode mode) { - Q_UNUSED(mode) qCWarning(KWIN_CORE, "%s doesn't support setting maximized state", metaObject()->className()); } @@ -2137,7 +2133,6 @@ void Window::handleInteractiveMoveResize(int x, int y, int x_root, int y_root) StrutRect Window::strutRect(StrutArea area) const { - Q_UNUSED(area) return StrutRect(); } @@ -2218,7 +2213,6 @@ void Window::setupWindowManagementInterface() w->setMinimized(isMinimized()); }); connect(this, static_cast(&Window::clientMaximizedStateChanged), w, [w](KWin::Window *c, MaximizeMode mode) { - Q_UNUSED(c); w->setMaximized(mode == KWin::MaximizeFull); }); connect(this, &Window::demandsAttentionChanged, w, [w, this] { @@ -2610,14 +2604,12 @@ bool Window::hasTransientPlacementHint() const QRectF Window::transientPlacement(const QRectF &bounds) const { - Q_UNUSED(bounds); Q_UNREACHABLE(); return QRectF(); } bool Window::hasTransient(const Window *c, bool indirect) const { - Q_UNUSED(indirect); return c->transientFor() == this; } @@ -3484,9 +3476,6 @@ void Window::setOnActivity(const QString &activity, bool enable) newActivitiesList.removeOne(activity); } setOnActivities(newActivitiesList); -#else - Q_UNUSED(activity) - Q_UNUSED(enable) #endif } @@ -3529,8 +3518,6 @@ void Window::setOnActivities(const QStringList &newActivitiesList) } updateActivities(false); -#else - Q_UNUSED(newActivitiesList) #endif } @@ -3549,8 +3536,6 @@ void Window::setOnAllActivities(bool all) } else { setOnActivity(Workspace::self()->activities()->current(), true); } -#else - Q_UNUSED(all) #endif } @@ -4190,8 +4175,6 @@ void Window::checkOffscreenPosition(QRectF *geom, const QRectF &screenArea) */ QSizeF Window::constrainClientSize(const QSizeF &size, SizeMode mode) const { - Q_UNUSED(mode) - qreal width = size.width(); qreal height = size.height(); @@ -4270,8 +4253,6 @@ bool Window::userCanSetFullScreen() const */ void Window::setFullScreen(bool set, bool user) { - Q_UNUSED(set) - Q_UNUSED(user) qCWarning(KWIN_CORE, "%s doesn't support setting fullscreen state", metaObject()->className()); } @@ -4349,7 +4330,6 @@ bool Window::userCanSetNoBorder() const void Window::setNoBorder(bool set) { - Q_UNUSED(set) qCWarning(KWIN_CORE, "%s doesn't support setting decorations", metaObject()->className()); } diff --git a/src/windowitem.cpp b/src/windowitem.cpp index e4d3f18aba..4980397c98 100644 --- a/src/windowitem.cpp +++ b/src/windowitem.cpp @@ -121,7 +121,6 @@ void WindowItem::unrefVisible(int reason) void WindowItem::handleWindowClosed(Window *original, Deleted *deleted) { - Q_UNUSED(original) m_window = deleted; } diff --git a/src/workspace.cpp b/src/workspace.cpp index ef8259749b..18bb35c3ac 100644 --- a/src/workspace.cpp +++ b/src/workspace.cpp @@ -1378,8 +1378,6 @@ void Workspace::updateCurrentActivity(const QString &new_activity) } Q_EMIT currentActivityChanged(); -#else - Q_UNUSED(new_activity) #endif } diff --git a/src/x11window.cpp b/src/x11window.cpp index 8783375df7..8a209f72f0 100644 --- a/src/x11window.cpp +++ b/src/x11window.cpp @@ -1994,8 +1994,6 @@ void X11Window::doSetOnActivities(const QStringList &activityList) QByteArray joined = activityList.join(QStringLiteral(",")).toLatin1(); m_client.changeProperty(atoms->activities, XCB_ATOM_STRING, 8, joined.length(), joined.constData()); } -#else - Q_UNUSED(activityList) #endif } @@ -2500,8 +2498,6 @@ void X11Window::readActivities(Xcb::StringProperty &property) } setOnActivities(newActivitiesList); -#else - Q_UNUSED(property) #endif } diff --git a/src/xdgshellwindow.cpp b/src/xdgshellwindow.cpp index 00c654ca32..1000f7bf0f 100644 --- a/src/xdgshellwindow.cpp +++ b/src/xdgshellwindow.cpp @@ -98,8 +98,6 @@ XdgSurfaceWindow::~XdgSurfaceWindow() NET::WindowType XdgSurfaceWindow::windowType(bool direct, int supported_types) const { - Q_UNUSED(direct) - Q_UNUSED(supported_types) return m_windowType; } @@ -1112,8 +1110,6 @@ void XdgToplevelWindow::handleWindowClassChanged() void XdgToplevelWindow::handleWindowMenuRequested(SeatInterface *seat, const QPoint &surfacePos, quint32 serial) { - Q_UNUSED(seat) - Q_UNUSED(serial) performMouseCommand(Options::MouseOperationsMenu, pos() + surfacePos); } @@ -2006,8 +2002,6 @@ XdgSurfaceConfigure *XdgPopupWindow::sendRoleConfigure() const void XdgPopupWindow::handleGrabRequested(SeatInterface *seat, quint32 serial) { - Q_UNUSED(seat) - Q_UNUSED(serial) m_haveExplicitGrab = true; } diff --git a/src/xkb.cpp b/src/xkb.cpp index 9f1553121d..690d25b467 100644 --- a/src/xkb.cpp +++ b/src/xkb.cpp @@ -44,7 +44,6 @@ namespace KWin static void xkbLogHandler(xkb_context *context, xkb_log_level priority, const char *format, va_list args) { - Q_UNUSED(context) char buf[1024]; int length = std::vsnprintf(buf, 1023, format, args); while (length > 0 && std::isspace(buf[length - 1])) { diff --git a/src/xwayland/clipboard.cpp b/src/xwayland/clipboard.cpp index 084830eb72..daab05cd2d 100644 --- a/src/xwayland/clipboard.cpp +++ b/src/xwayland/clipboard.cpp @@ -143,8 +143,6 @@ void Clipboard::doHandleXfixesNotify(xcb_xfixes_selection_notify_event_t *event) void Clipboard::x11OffersChanged(const QStringList &added, const QStringList &removed) { - Q_UNUSED(added) - Q_UNUSED(removed) m_waitingForTargets = false; X11Source *source = x11Source(); if (!source) { diff --git a/src/xwayland/dnd.cpp b/src/xwayland/dnd.cpp index 8f5e53b412..19e9d0fa6b 100644 --- a/src/xwayland/dnd.cpp +++ b/src/xwayland/dnd.cpp @@ -115,8 +115,6 @@ void Dnd::doHandleXfixesNotify(xcb_xfixes_selection_notify_event_t *event) void Dnd::x11OffersChanged(const QStringList &added, const QStringList &removed) { - Q_UNUSED(added); - Q_UNUSED(removed); } bool Dnd::handleClientMessage(xcb_client_message_event_t *event) diff --git a/src/xwayland/drag_wl.cpp b/src/xwayland/drag_wl.cpp index 04a5c88c6c..ea3ca36e69 100644 --- a/src/xwayland/drag_wl.cpp +++ b/src/xwayland/drag_wl.cpp @@ -42,8 +42,6 @@ WlToXDrag::WlToXDrag(Dnd *dnd) DragEventReply WlToXDrag::moveFilter(Window *target, const QPoint &pos) { - Q_UNUSED(target) - Q_UNUSED(pos) return DragEventReply::Wayland; } @@ -153,8 +151,6 @@ bool Xvisit::handleFinished(xcb_client_message_event_t *event) const bool success = m_version > 4 ? data->data32[1] & 1 : true; const xcb_atom_t usedActionAtom = m_version > 4 ? data->data32[2] : static_cast(XCB_ATOM_NONE); - Q_UNUSED(success); - Q_UNUSED(usedActionAtom); if (m_dataSource) { m_dataSource->dndFinished(); diff --git a/src/xwayland/drag_x.cpp b/src/xwayland/drag_x.cpp index 23053aaf8c..dd38561558 100644 --- a/src/xwayland/drag_x.cpp +++ b/src/xwayland/drag_x.cpp @@ -74,15 +74,12 @@ XToWlDrag::XToWlDrag(X11Source *source, Dnd *dnd) checkForFinished(); }); connect(source, &X11Source::transferReady, this, [this](xcb_atom_t target, qint32 fd) { - Q_UNUSED(target); - Q_UNUSED(fd); m_dataRequests << QPair(m_source->timestamp(), false); }); connect(&m_selectionSource, &XwlDataSource::dropped, this, [this] { m_performed = true; if (m_visit) { connect(m_visit, &WlVisit::finish, this, [this](WlVisit *visit) { - Q_UNUSED(visit); checkForFinished(); }); @@ -123,8 +120,6 @@ XToWlDrag::~XToWlDrag() DragEventReply XToWlDrag::moveFilter(Window *target, const QPoint &pos) { - Q_UNUSED(pos); - auto *seat = waylandServer()->seat(); if (m_visit && m_visit->target() == target) { @@ -415,7 +410,6 @@ bool WlVisit::handlePosition(xcb_client_message_event_t *event) return true; } const uint32_t pos = data->data32[2]; - Q_UNUSED(pos); const xcb_timestamp_t timestamp = data->data32[3]; m_drag->x11Source()->setTimestamp(timestamp); diff --git a/src/xwayland/primary.cpp b/src/xwayland/primary.cpp index 6023c24d2d..9a44bf19e4 100644 --- a/src/xwayland/primary.cpp +++ b/src/xwayland/primary.cpp @@ -146,9 +146,6 @@ void Primary::doHandleXfixesNotify(xcb_xfixes_selection_notify_event_t *event) void Primary::x11OffersChanged(const QStringList &added, const QStringList &removed) { - Q_UNUSED(added) - Q_UNUSED(removed) - m_waitingForTargets = false; X11Source *source = x11Source(); if (!source) { diff --git a/src/xwayland/selection.h b/src/xwayland/selection.h index 0d37dc1efa..be1e2bc391 100644 --- a/src/xwayland/selection.h +++ b/src/xwayland/selection.h @@ -79,7 +79,6 @@ protected: virtual bool handleClientMessage(xcb_client_message_event_t *event) { - Q_UNUSED(event); return false; } // sets the current provider of the selection diff --git a/src/xwayland/transfer.cpp b/src/xwayland/transfer.cpp index 4bb45dac76..4568b6628a 100644 --- a/src/xwayland/transfer.cpp +++ b/src/xwayland/transfer.cpp @@ -96,7 +96,6 @@ void TransferWltoX::startTransferFromSource() { createSocketNotifier(QSocketNotifier::Read); connect(socketNotifier(), &QSocketNotifier::activated, this, [this](int socket) { - Q_UNUSED(socket); readWlSource(); }); } @@ -471,7 +470,6 @@ void TransferXtoWl::dataSourceWrite() if (!socketNotifier()) { createSocketNotifier(QSocketNotifier::Write); connect(socketNotifier(), &QSocketNotifier::activated, this, [this](int socket) { - Q_UNUSED(socket); dataSourceWrite(); }); } diff --git a/src/xwayland/xwldrophandler.cpp b/src/xwayland/xwldrophandler.cpp index 8d49fb1311..90d2cf3a83 100644 --- a/src/xwayland/xwldrophandler.cpp +++ b/src/xwayland/xwldrophandler.cpp @@ -49,7 +49,6 @@ bool XwlDropHandler::handleClientMessage(xcb_client_message_event_t *event) void XwlDropHandler::updateDragTarget(KWaylandServer::SurfaceInterface *surface, quint32 serial) { - Q_UNUSED(serial) auto client = workspace()->findClient([surface](const X11Window *c) { return c->surface() == surface; }); diff --git a/tests/cursorhotspottest.cpp b/tests/cursorhotspottest.cpp index 183660f96e..6d23a5fdaf 100644 --- a/tests/cursorhotspottest.cpp +++ b/tests/cursorhotspottest.cpp @@ -107,8 +107,6 @@ MouseCursorWidget::~MouseCursorWidget() = default; void MouseCursorWidget::paintEvent(QPaintEvent *event) { - Q_UNUSED(event) - QPainter p(this); p.fillRect(0, 0, width(), height(), Qt::white); if (geometry().contains(m_cursorPos)) { diff --git a/tests/pointerconstraintstest.cpp b/tests/pointerconstraintstest.cpp index 87237ef5b3..1c80236c96 100644 --- a/tests/pointerconstraintstest.cpp +++ b/tests/pointerconstraintstest.cpp @@ -247,9 +247,6 @@ void XBackend::init(QQuickView *view) void XBackend::lockRequest(bool persistent, QRect region) { - Q_UNUSED(persistent); - Q_UNUSED(region); - auto winId = view()->winId(); /* Cursor needs to be hidden such that Xwayland emulates warps. */ @@ -287,9 +284,6 @@ void XBackend::unlockRequest() void XBackend::confineRequest(bool persistent, QRect region) { - Q_UNUSED(persistent); - Q_UNUSED(region); - int error; if (!tryConfine(error)) { qDebug() << "Confine (grab) failed with XCB error:" << error; diff --git a/tests/pointerconstraintstest.h b/tests/pointerconstraintstest.h index b4ea95c4aa..7a986f9326 100644 --- a/tests/pointerconstraintstest.h +++ b/tests/pointerconstraintstest.h @@ -71,8 +71,6 @@ public: Q_INVOKABLE virtual void lockRequest(bool persistent = true, QRect region = QRect()) { - Q_UNUSED(persistent); - Q_UNUSED(region); } Q_INVOKABLE virtual void unlockRequest() { @@ -80,15 +78,12 @@ public: Q_INVOKABLE virtual void confineRequest(bool persistent = true, QRect region = QRect()) { - Q_UNUSED(persistent); - Q_UNUSED(region); } Q_INVOKABLE virtual void unconfineRequest() { } Q_INVOKABLE virtual void hideAndConfineRequest(bool confineBeforeHide = false) { - Q_UNUSED(confineBeforeHide); } Q_INVOKABLE virtual void undoHideRequest() { diff --git a/tests/pointergesturestest.cpp b/tests/pointergesturestest.cpp index c8237109d1..66866b2449 100644 --- a/tests/pointergesturestest.cpp +++ b/tests/pointergesturestest.cpp @@ -113,7 +113,6 @@ void PinchGesture::setupGesture() m_gesture = m_pointerGestures->createPinchGesture(m_pointer, this); connect(m_gesture, &PointerPinchGesture::updated, this, [this](const QSizeF &delta, qreal scale) { - Q_UNUSED(delta) m_progressScale = scale; Q_EMIT progressScaleChanged(); });