From 4371c951948578d937202076a4eb484f74a76eac Mon Sep 17 00:00:00 2001 From: Marco Mattiolo Date: Mon, 12 Aug 2024 14:14:46 +0200 Subject: [PATCH] Flag unused parameters with Q_UNUSED() --- components/shellsettingsplugin/mobileshellsettings.cpp | 1 + components/wallpaperimageplugin/wallpaperplugin.cpp | 1 + containments/homescreens/folio/delegatetoucharea.cpp | 4 +++- .../homescreens/halcyon/plugin/applicationlistmodel.cpp | 1 + containments/homescreens/halcyon/plugin/pinnedmodel.cpp | 1 + kwin/mobiletaskswitcher/effecttouchborder.cpp | 1 + 6 files changed, 8 insertions(+), 1 deletion(-) diff --git a/components/shellsettingsplugin/mobileshellsettings.cpp b/components/shellsettingsplugin/mobileshellsettings.cpp index a08b7163..9f4cee3a 100644 --- a/components/shellsettingsplugin/mobileshellsettings.cpp +++ b/components/shellsettingsplugin/mobileshellsettings.cpp @@ -26,6 +26,7 @@ MobileShellSettings::MobileShellSettings(QObject *parent) m_configWatcher = KConfigWatcher::create(m_config); connect(m_configWatcher.data(), &KConfigWatcher::configChanged, this, [this](const KConfigGroup &group, const QByteArrayList &names) -> void { + Q_UNUSED(names) if (group.name() == GENERAL_CONFIG_GROUP) { Q_EMIT vibrationsEnabledChanged(); Q_EMIT vibrationDurationChanged(); diff --git a/components/wallpaperimageplugin/wallpaperplugin.cpp b/components/wallpaperimageplugin/wallpaperplugin.cpp index d2c10fe2..8713683f 100644 --- a/components/wallpaperimageplugin/wallpaperplugin.cpp +++ b/components/wallpaperimageplugin/wallpaperplugin.cpp @@ -39,6 +39,7 @@ WallpaperPlugin::WallpaperPlugin(QObject *parent) } connect(m_lockscreenConfigWatcher.data(), &KConfigWatcher::configChanged, this, [this](const KConfigGroup &group) { + Q_UNUSED(group) loadLockscreenSettings(); }); diff --git a/containments/homescreens/folio/delegatetoucharea.cpp b/containments/homescreens/folio/delegatetoucharea.cpp index ef194b0a..f58828db 100644 --- a/containments/homescreens/folio/delegatetoucharea.cpp +++ b/containments/homescreens/folio/delegatetoucharea.cpp @@ -173,6 +173,7 @@ void DelegateTouchArea::hoverLeaveEvent(QHoverEvent *event) void DelegateTouchArea::handlePressEvent(QPointerEvent *event, QPointF point) { + Q_UNUSED(event) // ignore multiple press events if (m_pressed) { return; @@ -190,7 +191,7 @@ void DelegateTouchArea::handlePressEvent(QPointerEvent *event, QPointF point) void DelegateTouchArea::handleReleaseEvent(QPointerEvent *event, bool click) { // NOTE: event can be nullptr! - + Q_UNUSED(event) bool wasPressed = m_pressed; setPressed(false); @@ -208,6 +209,7 @@ void DelegateTouchArea::handleReleaseEvent(QPointerEvent *event, bool click) void DelegateTouchArea::handleMoveEvent(QPointerEvent *event, QPointF point) { + Q_UNUSED(event) if (QPointF(point - m_mouseDownPosition).manhattanLength() >= QGuiApplication::styleHints()->startDragDistance()) { m_pressAndHoldTimer->stop(); setPressed(false); diff --git a/containments/homescreens/halcyon/plugin/applicationlistmodel.cpp b/containments/homescreens/halcyon/plugin/applicationlistmodel.cpp index 30b3bd3c..1ede6712 100644 --- a/containments/homescreens/halcyon/plugin/applicationlistmodel.cpp +++ b/containments/homescreens/halcyon/plugin/applicationlistmodel.cpp @@ -89,6 +89,7 @@ void ApplicationListModel::loadApplications() QVariant ApplicationListModel::data(const QModelIndex &index, int role) const { + Q_UNUSED(role) if (!index.isValid()) { return QVariant(); } diff --git a/containments/homescreens/halcyon/plugin/pinnedmodel.cpp b/containments/homescreens/halcyon/plugin/pinnedmodel.cpp index e1d720dc..6e0f29ad 100644 --- a/containments/homescreens/halcyon/plugin/pinnedmodel.cpp +++ b/containments/homescreens/halcyon/plugin/pinnedmodel.cpp @@ -23,6 +23,7 @@ PinnedModel *PinnedModel::self() int PinnedModel::rowCount(const QModelIndex &parent) const { + Q_UNUSED(parent) return m_applications.count(); } diff --git a/kwin/mobiletaskswitcher/effecttouchborder.cpp b/kwin/mobiletaskswitcher/effecttouchborder.cpp index 3c93eb68..09b5cb2a 100644 --- a/kwin/mobiletaskswitcher/effecttouchborder.cpp +++ b/kwin/mobiletaskswitcher/effecttouchborder.cpp @@ -57,6 +57,7 @@ void EffectTouchBorder::setBorders(const QList &touchActivateBorders) effects->registerRealtimeTouchBorder(ElectricBorder(border), m_state->activateAction(), [this](ElectricBorder border, const QPointF &deltaProgress, const Output *screen) { + Q_UNUSED(screen) m_state->setInProgress(true); if (border == ElectricTop || border == ElectricBottom) {