[network/ruqola] src: Port to [[maybe_unused]]
Laurent Montel <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit e2b72b40cf02be3b9d923ba58a4201e8f889dcd1 by Laurent Montel.
Committed on 01/08/2026 at 14:14.
Pushed by mlaurent into branch 'master'.
Port to [[maybe_unused]]
M +1 -3 src/core/autotests/restauthenticationmanagertest.cpp
M +1 -2 src/core/internaltools/ruqolatoolinternalinterface.cpp
M +1 -2 src/core/model/adminoauthmodel.cpp
M +1 -1 src/core/rocketchataccount.cpp
M +1 -2 src/core/rocketchatmessage.cpp
M +1 -2 src/rocketchatrestapi-qt/apps/appinstalledjob.cpp
M +1 -2 src/rocketchatrestapi-qt/apps/appmarketplacejob.cpp
M +1 -3 src/rocketchatrestapi-qt/chat/reportmessagejob.cpp
M +3 -9 src/rocketchatrestapi-qt/restapiabstractjob.h
M +1 -2 src/widgets/administratordialog/customemoji/administratorcustomemojiwidget.cpp
M +1 -2 src/widgets/administratordialog/moderationconsole/moderationreportedmessageconsoletreewidget.cpp
M +2 -4 src/widgets/administratordialog/moderationconsole/moderationreportinfodelegate.cpp
M +1 -2 src/widgets/administratordialog/users/administratoruserspendingactiondelegate.cpp
M +1 -2 src/widgets/autogenerateui/autogenerateinteractionuiviewactionable.cpp
M +1 -2 src/widgets/autogenerateui/blockelement/autogenerateinteractionuiviewcalloutblock.cpp
M +4 -8 src/widgets/autogenerateui/blockelement/autogenerateinteractionuiviewdividerblock.cpp
M +2 -4 src/widgets/autogenerateui/blockelement/autogenerateinteractionuiviewimageblock.cpp
M +1 -2 src/widgets/autogenerateui/blockelement/autogenerateinteractionuiviewsectionblock.cpp
M +1 -2 src/widgets/autogenerateui/elements/autogenerateinteractionuiviewimageelement.cpp
M +1 -2 src/widgets/autogenerateui/elements/autogenerateinteractionuiviewradiobuttonelement.cpp
M +1 -3 src/widgets/autogenerateui/elements/autogenerateinteractionuiviewtoggleswitchelement.cpp
M +1 -2 src/widgets/delegateutils/textselection.cpp
M +6 -6 src/widgets/misc/messagelistdelegatebase.cpp
M +1 -2 src/widgets/myaccount/myaccountprofileconfigureavatarwidget.cpp
M +1 -2 src/widgets/notificationhistory/notificationhistorydelegate.cpp
M +6 -12 src/widgets/room/delegate/messageattachmentdelegatehelperbase.cpp
M +1 -2 src/widgets/room/delegate/messageattachmentdelegatehelperfile.cpp
M +2 -4 src/widgets/room/delegate/messageattachmentdelegatehelperimage.cpp
M +1 -2 src/widgets/room/delegate/messageattachmentdelegatehelpersound.cpp
M +2 -4 src/widgets/room/delegate/messageattachmentdelegatehelpertext.cpp
M +1 -2 src/widgets/room/delegate/messageattachmentdelegatehelpervideo.cpp
M +4 -5 src/widgets/room/delegate/messageblockdelegatehelperbase.cpp
M +1 -2 src/widgets/room/delegate/messagedelegatehelperactions.cpp
M +7 -8 src/widgets/room/delegate/messagedelegatehelperconferencevideo.cpp
M +8 -8 src/widgets/room/delegate/messagedelegatehelpersection.cpp
M +2 -4 src/widgets/servererrorinfohistory/servererrorinfohistorydelegate.cpp
https://invent.kde.org/network/ruqola/-/commit/e2b72b40cf02be3b9d923ba58a4201e8f889dcd1
diff --git a/src/core/autotests/restauthenticationmanagertest.cpp b/src/core/autotests/restauthenticationmanagertest.cpp
index db40782e1c..6ef69963a1 100644
--- a/src/core/autotests/restauthenticationmanagertest.cpp
+++ b/src/core/autotests/restauthenticationmanagertest.cpp
@@ -23,10 +23,8 @@ public:
~RESTAuthenticationManagerTestImpl() override = default;
protected:
- void callLoginImpl(const QJsonArray ¶ms, RESTAuthenticationManagerTestImpl::Method method) override
+ void callLoginImpl([[maybe_unused]] const QJsonArray ¶ms, [[maybe_unused]] RESTAuthenticationManagerTestImpl::Method method) override
{
- Q_UNUSED(params);
- Q_UNUSED(method);
// Nothing
}
};
diff --git a/src/core/internaltools/ruqolatoolinternalinterface.cpp b/src/core/internaltools/ruqolatoolinternalinterface.cpp
index 3b71933994..71118ffccd 100644
--- a/src/core/internaltools/ruqolatoolinternalinterface.cpp
+++ b/src/core/internaltools/ruqolatoolinternalinterface.cpp
@@ -12,9 +12,8 @@ RuqolaToolInternalInterface::RuqolaToolInternalInterface(QObject *parent)
RuqolaToolInternalInterface::~RuqolaToolInternalInterface() = default;
-TextAutoGenerateText::TextAutoGenerateTextToolInternalJob *RuqolaToolInternalInterface::callTool(const QByteArray &toolName)
+TextAutoGenerateText::TextAutoGenerateTextToolInternalJob *RuqolaToolInternalInterface::callTool([[maybe_unused]] const QByteArray &toolName)
{
- Q_UNUSED(toolName)
return {};
}
diff --git a/src/core/model/adminoauthmodel.cpp b/src/core/model/adminoauthmodel.cpp
index 88ec282e9d..88cebe8ae6 100644
--- a/src/core/model/adminoauthmodel.cpp
+++ b/src/core/model/adminoauthmodel.cpp
@@ -48,9 +48,8 @@ QVariant AdminOauthModel::headerData(int section, Qt::Orientation orientation, i
return {};
}
-int AdminOauthModel::columnCount(const QModelIndex &parent) const
+int AdminOauthModel::columnCount([[maybe_unused]] const QModelIndex &parent) const
{
- Q_UNUSED(parent)
constexpr int val = static_cast<int>(AdminOauthModel::LastColumn) + 1;
return val;
}
diff --git a/src/core/rocketchataccount.cpp b/src/core/rocketchataccount.cpp
index 585f87af72..e17813585e 100644
--- a/src/core/rocketchataccount.cpp
+++ b/src/core/rocketchataccount.cpp
@@ -2116,7 +2116,7 @@ void RocketChatAccount::sendNotification(const QJsonArray &contents)
const bool loaded = pix.load(url.toLocalFile().remove(u"file://"_s), "JPEG");
// qDebug() << " load pixmap : " << loaded;
// qDebug() << " pix " << pix.isNull();
- Q_UNUSED(loaded)
+ std::ignore = loaded;
info.setPixmap(pix);
}
break;
diff --git a/src/core/rocketchatmessage.cpp b/src/core/rocketchatmessage.cpp
index 33d799a47b..49134c6e24 100644
--- a/src/core/rocketchatmessage.cpp
+++ b/src/core/rocketchatmessage.cpp
@@ -89,11 +89,10 @@ RocketChatMessage::RocketChatMessageResult RocketChatMessage::setAdminStatus(con
return generateMethod(u"setAdminStatus"_s, params, id);
}
-RocketChatMessage::RocketChatMessageResult RocketChatMessage::uploadCustomSound(const QByteArray &sound, quint64 id)
+RocketChatMessage::RocketChatMessageResult RocketChatMessage::uploadCustomSound([[maybe_unused]] const QByteArray &sound, quint64 id)
{
// TODO: the server expects the binary sound data encoded as the params payload.
// The correct wire format is not yet implemented; sound is currently unused.
- Q_UNUSED(sound)
const QJsonArray params{{}};
return generateMethod(u"uploadCustomSound"_s, params, id);
diff --git a/src/rocketchatrestapi-qt/apps/appinstalledjob.cpp b/src/rocketchatrestapi-qt/apps/appinstalledjob.cpp
index 835bed94d5..23e6fef4b5 100644
--- a/src/rocketchatrestapi-qt/apps/appinstalledjob.cpp
+++ b/src/rocketchatrestapi-qt/apps/appinstalledjob.cpp
@@ -39,9 +39,8 @@ bool AppInstalledJob::start()
return true;
}
-void AppInstalledJob::onGetRequestResponse(const QString &replyErrorString, const QJsonDocument &replyJson)
+void AppInstalledJob::onGetRequestResponse([[maybe_unused]] const QString &replyErrorString, const QJsonDocument &replyJson)
{
- Q_UNUSED(replyErrorString)
// qDebug() << " replyJson " << replyJson;
const QJsonArray replyArray = replyJson.object().value("apps"_L1).toArray();
Q_EMIT appInstalledDone(replyArray);
diff --git a/src/rocketchatrestapi-qt/apps/appmarketplacejob.cpp b/src/rocketchatrestapi-qt/apps/appmarketplacejob.cpp
index c115406e8e..78d1513c4b 100644
--- a/src/rocketchatrestapi-qt/apps/appmarketplacejob.cpp
+++ b/src/rocketchatrestapi-qt/apps/appmarketplacejob.cpp
@@ -41,9 +41,8 @@ bool AppMarketPlaceJob::start()
return true;
}
-void AppMarketPlaceJob::onGetRequestResponse(const QString &replyErrorString, const QJsonDocument &replyJson)
+void AppMarketPlaceJob::onGetRequestResponse([[maybe_unused]] const QString &replyErrorString, const QJsonDocument &replyJson)
{
- Q_UNUSED(replyErrorString)
const QJsonArray replyArray = replyJson.array();
Q_EMIT appMarketPlaceDone(replyArray);
#if 0
diff --git a/src/rocketchatrestapi-qt/chat/reportmessagejob.cpp b/src/rocketchatrestapi-qt/chat/reportmessagejob.cpp
index 42a0ca92de..236662ba32 100644
--- a/src/rocketchatrestapi-qt/chat/reportmessagejob.cpp
+++ b/src/rocketchatrestapi-qt/chat/reportmessagejob.cpp
@@ -35,10 +35,8 @@ bool ReportMessageJob::start()
return true;
}
-void ReportMessageJob::onPostRequestResponse(const QString &replyErrorString, const QJsonDocument &replyJson)
+void ReportMessageJob::onPostRequestResponse([[maybe_unused]] const QString &replyErrorString, [[maybe_unused]] const QJsonDocument &replyJson)
{
- Q_UNUSED(replyErrorString)
- Q_UNUSED(replyJson)
auto reply = mReply;
if (reply) {
const QByteArray data = reply->readAll();
diff --git a/src/rocketchatrestapi-qt/restapiabstractjob.h b/src/rocketchatrestapi-qt/restapiabstractjob.h
index a418d93347..a9a19c0bb4 100644
--- a/src/rocketchatrestapi-qt/restapiabstractjob.h
+++ b/src/rocketchatrestapi-qt/restapiabstractjob.h
@@ -94,20 +94,14 @@ protected:
QPointer<QNetworkReply> mReply;
protected Q_SLOTS:
- virtual void onGetRequestResponse(const QString &replyErrorString, const QJsonDocument &replyJson)
+ virtual void onGetRequestResponse([[maybe_unused]] const QString &replyErrorString, [[maybe_unused]] const QJsonDocument &replyJson)
{
- Q_UNUSED(replyJson)
- Q_UNUSED(replyErrorString)
}
- virtual void onPostRequestResponse(const QString &replyErrorString, const QJsonDocument &replyJson)
+ virtual void onPostRequestResponse([[maybe_unused]] const QString &replyErrorString, [[maybe_unused]] const QJsonDocument &replyJson)
{
- Q_UNUSED(replyJson)
- Q_UNUSED(replyErrorString)
}
- virtual void onDeleteRequestResponse(const QString &replyErrorString, const QJsonDocument &replyJson)
+ virtual void onDeleteRequestResponse([[maybe_unused]] const QString &replyErrorString, [[maybe_unused]] const QJsonDocument &replyJson)
{
- Q_UNUSED(replyJson)
- Q_UNUSED(replyErrorString)
}
private:
diff --git a/src/widgets/administratordialog/customemoji/administratorcustomemojiwidget.cpp b/src/widgets/administratordialog/customemoji/administratorcustomemojiwidget.cpp
index 369bdc4426..f497c1191a 100644
--- a/src/widgets/administratordialog/customemoji/administratorcustomemojiwidget.cpp
+++ b/src/widgets/administratordialog/customemoji/administratorcustomemojiwidget.cpp
@@ -103,8 +103,7 @@ void AdministratorCustomEmojiWidget::slotAddCustomEmoji()
auto job = new RocketChatRestApi::EmojiCustomCreateJob(this);
job->setEmojiInfo(emojiInfo);
mRocketChatAccount->restApi()->initializeRestApiJob(job);
- connect(job, &RocketChatRestApi::EmojiCustomCreateJob::emojiCustomCreateDone, this, [this](const QJsonObject &replyObject) {
- Q_UNUSED(replyObject)
+ connect(job, &RocketChatRestApi::EmojiCustomCreateJob::emojiCustomCreateDone, this, [this]([[maybe_unused]] const QJsonObject &replyObject) {
// qDebug() << " replyObject " << replyObject;
initialize(); // No info about updating list without reload it
});
diff --git a/src/widgets/administratordialog/moderationconsole/moderationreportedmessageconsoletreewidget.cpp b/src/widgets/administratordialog/moderationconsole/moderationreportedmessageconsoletreewidget.cpp
index 42b7efb7a5..f7b83e7c19 100644
--- a/src/widgets/administratordialog/moderationconsole/moderationreportedmessageconsoletreewidget.cpp
+++ b/src/widgets/administratordialog/moderationconsole/moderationreportedmessageconsoletreewidget.cpp
@@ -170,8 +170,7 @@ void ModerationReportedMessageConsoleTreeWidget::slotDesactivateUser(const QMode
job->setActivate(false);
job->setActivateUserId(userId);
mRocketChatAccount->restApi()->initializeRestApiJob(job);
- connect(job, &RocketChatRestApi::SetUserActiveStatusJob::setUserActiveStatusDone, this, [this](const QJsonObject &replyObject) {
- Q_UNUSED(replyObject)
+ connect(job, &RocketChatRestApi::SetUserActiveStatusJob::setUserActiveStatusDone, this, [this]([[maybe_unused]] const QJsonObject &replyObject) {
// TODO delete messages
slotLoadElements();
});
diff --git a/src/widgets/administratordialog/moderationconsole/moderationreportinfodelegate.cpp b/src/widgets/administratordialog/moderationconsole/moderationreportinfodelegate.cpp
index 4bc4bcf4c2..918d5c3e69 100644
--- a/src/widgets/administratordialog/moderationconsole/moderationreportinfodelegate.cpp
+++ b/src/widgets/administratordialog/moderationconsole/moderationreportinfodelegate.cpp
@@ -216,9 +216,8 @@ bool ModerationReportInfoDelegate::helpEvent(QHelpEvent *helpEvent, QAbstractIte
return true;
}
-QPoint ModerationReportInfoDelegate::adaptMousePosition(const QPoint &pos, QRect textRect, const QStyleOptionViewItem &option)
+QPoint ModerationReportInfoDelegate::adaptMousePosition(const QPoint &pos, QRect textRect, [[maybe_unused]] const QStyleOptionViewItem &option)
{
- Q_UNUSED(option);
const QPoint relativePos = pos - textRect.topLeft();
return relativePos;
}
@@ -253,9 +252,8 @@ bool ModerationReportInfoDelegate::maybeStartDrag(QMouseEvent *event, const QSty
return false;
}
-RocketChatAccount *ModerationReportInfoDelegate::rocketChatAccount(const QModelIndex &index) const
+RocketChatAccount *ModerationReportInfoDelegate::rocketChatAccount([[maybe_unused]] const QModelIndex &index) const
{
- Q_UNUSED(index);
return mRocketChatAccount;
}
diff --git a/src/widgets/administratordialog/users/administratoruserspendingactiondelegate.cpp b/src/widgets/administratordialog/users/administratoruserspendingactiondelegate.cpp
index 54e7e5454b..f529b6602d 100644
--- a/src/widgets/administratordialog/users/administratoruserspendingactiondelegate.cpp
+++ b/src/widgets/administratordialog/users/administratoruserspendingactiondelegate.cpp
@@ -74,11 +74,10 @@ QWidget *AdministratorUsersPendingActionDelegate::createEditor(QWidget *, const
}
bool AdministratorUsersPendingActionDelegate::editorEvent(QEvent *event,
- QAbstractItemModel *model,
+ [[maybe_unused]] QAbstractItemModel *model,
const QStyleOptionViewItem &option,
const QModelIndex &index)
{
- Q_UNUSED(model)
if (!index.isValid()) {
return false;
}
diff --git a/src/widgets/autogenerateui/autogenerateinteractionuiviewactionable.cpp b/src/widgets/autogenerateui/autogenerateinteractionuiviewactionable.cpp
index 7524afc3ad..0f3bb4aa87 100644
--- a/src/widgets/autogenerateui/autogenerateinteractionuiviewactionable.cpp
+++ b/src/widgets/autogenerateui/autogenerateinteractionuiviewactionable.cpp
@@ -61,9 +61,8 @@ bool AutoGenerateInteractionUiViewActionable::operator==(const AutoGenerateInter
return other.appId() == appId() && other.blockId() == blockId() && other.actionId() == actionId() && other.type() == type();
}
-ActionElementWidget *AutoGenerateInteractionUiViewActionable::generateWidget(QWidget *parent)
+ActionElementWidget *AutoGenerateInteractionUiViewActionable::generateWidget([[maybe_unused]] QWidget *parent)
{
- Q_UNUSED(parent)
return nullptr;
}
diff --git a/src/widgets/autogenerateui/blockelement/autogenerateinteractionuiviewcalloutblock.cpp b/src/widgets/autogenerateui/blockelement/autogenerateinteractionuiviewcalloutblock.cpp
index 50fce236ed..50a2868688 100644
--- a/src/widgets/autogenerateui/blockelement/autogenerateinteractionuiviewcalloutblock.cpp
+++ b/src/widgets/autogenerateui/blockelement/autogenerateinteractionuiviewcalloutblock.cpp
@@ -108,9 +108,8 @@ void AutoGenerateInteractionUiViewCalloutBlock::setErrorMessages(const QMap<QStr
}
}
-void AutoGenerateInteractionUiViewCalloutBlock::assignState(const QList<StateInfo> &info)
+void AutoGenerateInteractionUiViewCalloutBlock::assignState([[maybe_unused]] const QList<StateInfo> &info)
{
- Q_UNUSED(info);
}
void AutoGenerateInteractionUiViewCalloutBlock::serializeBlock(QJsonObject &o) const
diff --git a/src/widgets/autogenerateui/blockelement/autogenerateinteractionuiviewdividerblock.cpp b/src/widgets/autogenerateui/blockelement/autogenerateinteractionuiviewdividerblock.cpp
index 53be8d3b9f..67c7ac69a5 100644
--- a/src/widgets/autogenerateui/blockelement/autogenerateinteractionuiviewdividerblock.cpp
+++ b/src/widgets/autogenerateui/blockelement/autogenerateinteractionuiviewdividerblock.cpp
@@ -31,19 +31,16 @@ QWidget *AutoGenerateInteractionUiViewDividerBlock::generateWidget(QWidget *pare
return new KSeparator(parent);
}
-void AutoGenerateInteractionUiViewDividerBlock::setErrorMessages(const QMap<QString, QString> &map)
+void AutoGenerateInteractionUiViewDividerBlock::setErrorMessages([[maybe_unused]] const QMap<QString, QString> &map)
{
- Q_UNUSED(map);
}
-void AutoGenerateInteractionUiViewDividerBlock::assignState(const QList<StateInfo> &info)
+void AutoGenerateInteractionUiViewDividerBlock::assignState([[maybe_unused]] const QList<StateInfo> &info)
{
- Q_UNUSED(info);
}
-void AutoGenerateInteractionUiViewDividerBlock::serializeBlock(QJsonObject &o) const
+void AutoGenerateInteractionUiViewDividerBlock::serializeBlock([[maybe_unused]] QJsonObject &o) const
{
- Q_UNUSED(o)
// Nothing
}
@@ -52,9 +49,8 @@ QList<AutoGenerateInteractionUiViewBlockBase::StateInfo> AutoGenerateInteraction
return {};
}
-void AutoGenerateInteractionUiViewDividerBlock::parseBlock(const QJsonObject &json)
+void AutoGenerateInteractionUiViewDividerBlock::parseBlock([[maybe_unused]] const QJsonObject &json)
{
- Q_UNUSED(json)
// Nothing
}
diff --git a/src/widgets/autogenerateui/blockelement/autogenerateinteractionuiviewimageblock.cpp b/src/widgets/autogenerateui/blockelement/autogenerateinteractionuiviewimageblock.cpp
index 85bd9d128a..c8125a3001 100644
--- a/src/widgets/autogenerateui/blockelement/autogenerateinteractionuiviewimageblock.cpp
+++ b/src/widgets/autogenerateui/blockelement/autogenerateinteractionuiviewimageblock.cpp
@@ -51,14 +51,12 @@ void AutoGenerateInteractionUiViewImageBlock::setTitle(AutoGenerateInteractionUi
mTitle = newText;
}
-void AutoGenerateInteractionUiViewImageBlock::setErrorMessages(const QMap<QString, QString> &map)
+void AutoGenerateInteractionUiViewImageBlock::setErrorMessages([[maybe_unused]] const QMap<QString, QString> &map)
{
- Q_UNUSED(map);
}
-void AutoGenerateInteractionUiViewImageBlock::assignState(const QList<StateInfo> &info)
+void AutoGenerateInteractionUiViewImageBlock::assignState([[maybe_unused]] const QList<StateInfo> &info)
{
- Q_UNUSED(info);
}
AutoGenerateInteractionUiViewImage AutoGenerateInteractionUiViewImageBlock::image() const
diff --git a/src/widgets/autogenerateui/blockelement/autogenerateinteractionuiviewsectionblock.cpp b/src/widgets/autogenerateui/blockelement/autogenerateinteractionuiviewsectionblock.cpp
index b9692f3114..3d16a8617d 100644
--- a/src/widgets/autogenerateui/blockelement/autogenerateinteractionuiviewsectionblock.cpp
+++ b/src/widgets/autogenerateui/blockelement/autogenerateinteractionuiviewsectionblock.cpp
@@ -154,9 +154,8 @@ void AutoGenerateInteractionUiViewSectionBlock::setErrorMessages(const QMap<QStr
}
}
-void AutoGenerateInteractionUiViewSectionBlock::assignState(const QList<StateInfo> &info)
+void AutoGenerateInteractionUiViewSectionBlock::assignState([[maybe_unused]] const QList<StateInfo> &info)
{
- Q_UNUSED(info);
}
AutoGenerateInteractionUiViewActionable *AutoGenerateInteractionUiViewSectionBlock::accessory() const
diff --git a/src/widgets/autogenerateui/elements/autogenerateinteractionuiviewimageelement.cpp b/src/widgets/autogenerateui/elements/autogenerateinteractionuiviewimageelement.cpp
index b25462e0cc..76d4071d79 100644
--- a/src/widgets/autogenerateui/elements/autogenerateinteractionuiviewimageelement.cpp
+++ b/src/widgets/autogenerateui/elements/autogenerateinteractionuiviewimageelement.cpp
@@ -15,9 +15,8 @@ AutoGenerateInteractionUiViewImageElement::AutoGenerateInteractionUiViewImageEle
AutoGenerateInteractionUiViewImageElement::~AutoGenerateInteractionUiViewImageElement() = default;
-ActionElementWidget *AutoGenerateInteractionUiViewImageElement::generateWidget(QWidget *parent)
+ActionElementWidget *AutoGenerateInteractionUiViewImageElement::generateWidget([[maybe_unused]] QWidget *parent)
{
- Q_UNUSED(parent)
// TODO generate image
qCWarning(RUQOLA_AUTOGENERATEUI_LOG) << "Not implemented AutoGenerateInteractionUiViewImageElement UI";
return nullptr;
diff --git a/src/widgets/autogenerateui/elements/autogenerateinteractionuiviewradiobuttonelement.cpp b/src/widgets/autogenerateui/elements/autogenerateinteractionuiviewradiobuttonelement.cpp
index 5b6de30771..f5b4f6bef4 100644
--- a/src/widgets/autogenerateui/elements/autogenerateinteractionuiviewradiobuttonelement.cpp
+++ b/src/widgets/autogenerateui/elements/autogenerateinteractionuiviewradiobuttonelement.cpp
@@ -68,12 +68,11 @@ void AutoGenerateInteractionUiViewRadioButtonElement::setOptions(const QList<Aut
mOptions = newOptions;
}
-ActionElementWidget *AutoGenerateInteractionUiViewRadioButtonElement::generateWidget(QWidget *parent)
+ActionElementWidget *AutoGenerateInteractionUiViewRadioButtonElement::generateWidget([[maybe_unused]] QWidget *parent)
{
qCWarning(RUQOLA_AUTOGENERATEUI_LOG) << "Not implemented AutoGenerateInteractionUiViewRadioButtonElement UI";
// QRadioButton ?
- Q_UNUSED(parent)
return nullptr;
}
diff --git a/src/widgets/autogenerateui/elements/autogenerateinteractionuiviewtoggleswitchelement.cpp b/src/widgets/autogenerateui/elements/autogenerateinteractionuiviewtoggleswitchelement.cpp
index 0a8a552d90..5f87dd625a 100644
--- a/src/widgets/autogenerateui/elements/autogenerateinteractionuiviewtoggleswitchelement.cpp
+++ b/src/widgets/autogenerateui/elements/autogenerateinteractionuiviewtoggleswitchelement.cpp
@@ -87,12 +87,10 @@ void AutoGenerateInteractionUiViewToggleSwitchElement::setCurrentValue(const QVa
qWarning() << " not implemented yet" << v;
}
-ActionElementWidget *AutoGenerateInteractionUiViewToggleSwitchElement::generateWidget(QWidget *parent)
+ActionElementWidget *AutoGenerateInteractionUiViewToggleSwitchElement::generateWidget([[maybe_unused]] QWidget *parent)
{
// TODO use QRadioButton ?
qCWarning(RUQOLA_AUTOGENERATEUI_LOG) << "Not implemented AutoGenerateInteractionUiViewToggleSwitchElement UI";
-
- Q_UNUSED(parent)
return nullptr;
}
diff --git a/src/widgets/delegateutils/textselection.cpp b/src/widgets/delegateutils/textselection.cpp
index 9f95261678..4a3ae08137 100644
--- a/src/widgets/delegateutils/textselection.cpp
+++ b/src/widgets/delegateutils/textselection.cpp
@@ -134,9 +134,8 @@ QString TextSelection::selectedText(Format format) const
return str;
}
-bool TextSelection::contains(const QModelIndex &index, int charPos, const MessageAttachment &att) const
+bool TextSelection::contains(const QModelIndex &index, int charPos, [[maybe_unused]] const MessageAttachment &att) const
{
- Q_UNUSED(att);
if (!hasSelection()) {
return false;
}
diff --git a/src/widgets/misc/messagelistdelegatebase.cpp b/src/widgets/misc/messagelistdelegatebase.cpp
index 95d460f9a2..eb04fc5358 100644
--- a/src/widgets/misc/messagelistdelegatebase.cpp
+++ b/src/widgets/misc/messagelistdelegatebase.cpp
@@ -70,9 +70,11 @@ bool MessageListDelegateBase::maybeStartDrag(QMouseEvent *mouseEvent, QRect mess
return false;
}
-bool MessageListDelegateBase::handleMouseEvent(QMouseEvent *mouseEvent, QRect messageRect, const QStyleOptionViewItem &option, const QModelIndex &index)
+bool MessageListDelegateBase::handleMouseEvent(QMouseEvent *mouseEvent,
+ QRect messageRect,
+ [[maybe_unused]] const QStyleOptionViewItem &option,
+ const QModelIndex &index)
{
- Q_UNUSED(option)
if (!messageRect.contains(mouseEvent->pos())) {
return false;
}
@@ -164,16 +166,14 @@ QTextDocument *MessageListDelegateBase::documentForIndex(const QModelIndex &inde
return documentForModelIndex(index, -1);
}
-QSize MessageListDelegateBase::textSizeHint(const QModelIndex &index, int maxWidth, const QStyleOptionViewItem &option, qreal *pBaseLine) const
+QSize MessageListDelegateBase::textSizeHint(const QModelIndex &index, int maxWidth, [[maybe_unused]] const QStyleOptionViewItem &option, qreal *pBaseLine) const
{
- Q_UNUSED(option)
auto *doc = documentForModelIndex(index, maxWidth);
return MessageDelegateUtils::textSizeHint(doc, pBaseLine);
}
-void MessageListDelegateBase::selectAll(const QStyleOptionViewItem &option, const QModelIndex &index)
+void MessageListDelegateBase::selectAll([[maybe_unused]] const QStyleOptionViewItem &option, const QModelIndex &index)
{
- Q_UNUSED(option);
mTextSelectionImpl->textSelection()->selectMessage(index);
mListView->update(index);
MessageDelegateUtils::setClipboardSelection(mTextSelectionImpl->textSelection());
diff --git a/src/widgets/myaccount/myaccountprofileconfigureavatarwidget.cpp b/src/widgets/myaccount/myaccountprofileconfigureavatarwidget.cpp
index d51aeef5ce..308ec7fea6 100644
--- a/src/widgets/myaccount/myaccountprofileconfigureavatarwidget.cpp
+++ b/src/widgets/myaccount/myaccountprofileconfigureavatarwidget.cpp
@@ -53,9 +53,8 @@ AvatarImage::AvatarImage(RocketChatAccount *account, QWidget *parent)
AvatarImage::~AvatarImage() = default;
-void AvatarImage::slotFileDownloaded(const QString &filePath, const QUrl &cacheImageUrl)
+void AvatarImage::slotFileDownloaded([[maybe_unused]] const QString &filePath, const QUrl &cacheImageUrl)
{
- Q_UNUSED(filePath)
Utils::AvatarInfo info;
info.avatarType = Utils::AvatarType::User;
info.identifier = mRocketChatAccount->ownUser().userName();
diff --git a/src/widgets/notificationhistory/notificationhistorydelegate.cpp b/src/widgets/notificationhistory/notificationhistorydelegate.cpp
index 903833aa82..6cdbfde7ee 100644
--- a/src/widgets/notificationhistory/notificationhistorydelegate.cpp
+++ b/src/widgets/notificationhistory/notificationhistorydelegate.cpp
@@ -288,9 +288,8 @@ bool NotificationHistoryDelegate::helpEvent(QHelpEvent *helpEvent, QAbstractItem
return true;
}
-QPoint NotificationHistoryDelegate::adaptMousePosition(const QPoint &pos, QRect textRect, const QStyleOptionViewItem &option)
+QPoint NotificationHistoryDelegate::adaptMousePosition(const QPoint &pos, QRect textRect, [[maybe_unused]] const QStyleOptionViewItem &option)
{
- Q_UNUSED(option);
const QPoint relativePos = pos - textRect.topLeft();
return relativePos;
}
diff --git a/src/widgets/room/delegate/messageattachmentdelegatehelperbase.cpp b/src/widgets/room/delegate/messageattachmentdelegatehelperbase.cpp
index 2dfdeefc24..7789b13eeb 100644
--- a/src/widgets/room/delegate/messageattachmentdelegatehelperbase.cpp
+++ b/src/widgets/room/delegate/messageattachmentdelegatehelperbase.cpp
@@ -312,18 +312,12 @@ QString MessageAttachmentDelegateHelperBase::urlAt(const QStyleOptionViewItem &o
return document->documentLayout()->anchorAt(relativePos);
}
-bool MessageAttachmentDelegateHelperBase::contextMenu(const QPoint &pos,
- const QPoint &globalPos,
- const MessageAttachment &msgAttach,
- QRect attachmentsRect,
- const QStyleOptionViewItem &option,
- QMenu *menu)
+bool MessageAttachmentDelegateHelperBase::contextMenu([[maybe_unused]] const QPoint &pos,
+ [[maybe_unused]] const QPoint &globalPos,
+ [[maybe_unused]] const MessageAttachment &msgAttach,
+ [[maybe_unused]] QRect attachmentsRect,
+ [[maybe_unused]] const QStyleOptionViewItem &option,
+ [[maybe_unused]] QMenu *menu)
{
- Q_UNUSED(msgAttach);
- Q_UNUSED(attachmentsRect);
- Q_UNUSED(pos);
- Q_UNUSED(option);
- Q_UNUSED(globalPos);
- Q_UNUSED(menu);
return false;
}
diff --git a/src/widgets/room/delegate/messageattachmentdelegatehelperfile.cpp b/src/widgets/room/delegate/messageattachmentdelegatehelperfile.cpp
index e236dcf8ee..972ce0fa92 100644
--- a/src/widgets/room/delegate/messageattachmentdelegatehelperfile.cpp
+++ b/src/widgets/room/delegate/messageattachmentdelegatehelperfile.cpp
@@ -71,11 +71,10 @@ void MessageAttachmentDelegateHelperFile::draw(const MessageAttachment &msgAttac
}
QSize MessageAttachmentDelegateHelperFile::sizeHint(const MessageAttachment &msgAttach,
- const QModelIndex &index,
+ [[maybe_unused]] const QModelIndex &index,
int maxWidth,
const QStyleOptionViewItem &option) const
{
- Q_UNUSED(index)
const FileLayout layout = doLayout(msgAttach, option, maxWidth);
return {maxWidth, // should be qMax of all sizes, but doesn't really matter
layout.y + layout.height + DelegatePaintUtil::margin()};
diff --git a/src/widgets/room/delegate/messageattachmentdelegatehelperimage.cpp b/src/widgets/room/delegate/messageattachmentdelegatehelperimage.cpp
index 66e5691770..bf01fc7d5a 100644
--- a/src/widgets/room/delegate/messageattachmentdelegatehelperimage.cpp
+++ b/src/widgets/room/delegate/messageattachmentdelegatehelperimage.cpp
@@ -101,11 +101,10 @@ void MessageAttachmentDelegateHelperImage::draw(const MessageAttachment &msgAtta
}
QSize MessageAttachmentDelegateHelperImage::sizeHint(const MessageAttachment &msgAttach,
- const QModelIndex &index,
+ [[maybe_unused]] const QModelIndex &index,
int maxWidth,
const QStyleOptionViewItem &option) const
{
- Q_UNUSED(index)
const ImageLayout layout = layoutImage(msgAttach, option, maxWidth, -1);
int height = layout.titleSize.height() + DelegatePaintUtil::margin();
int pixmapWidth = 0;
@@ -250,13 +249,12 @@ QPoint MessageAttachmentDelegateHelperImage::adaptMousePosition(const QPoint &po
}
bool MessageAttachmentDelegateHelperImage::contextMenu(const QPoint &pos,
- const QPoint &globalPos,
+ [[maybe_unused]] const QPoint &globalPos,
const MessageAttachment &msgAttach,
QRect attachmentsRect,
const QStyleOptionViewItem &option,
QMenu *menu)
{
- Q_UNUSED(globalPos);
const ImageLayout layout = layoutImage(msgAttach, option, attachmentsRect.width(), attachmentsRect.height());
if (layout.isShown) {
const QRect rectAdjusted = attachmentsRect.adjusted(0, 0, 0, -(layout.titleSize.height() + DelegatePaintUtil::margin()));
diff --git a/src/widgets/room/delegate/messageattachmentdelegatehelpersound.cpp b/src/widgets/room/delegate/messageattachmentdelegatehelpersound.cpp
index 426d4c067c..f4d65345b8 100644
--- a/src/widgets/room/delegate/messageattachmentdelegatehelpersound.cpp
+++ b/src/widgets/room/delegate/messageattachmentdelegatehelpersound.cpp
@@ -47,11 +47,10 @@ void MessageAttachmentDelegateHelperSound::draw(const MessageAttachment &msgAtta
}
QSize MessageAttachmentDelegateHelperSound::sizeHint(const MessageAttachment &msgAttach,
- const QModelIndex &index,
+ [[maybe_unused]] const QModelIndex &index,
int maxWidth,
const QStyleOptionViewItem &option) const
{
- Q_UNUSED(index)
const SoundLayout layout = layoutSound(msgAttach, option, maxWidth);
int height = layout.titleSize.height() + DelegatePaintUtil::margin();
int descriptionWidth = 0;
diff --git a/src/widgets/room/delegate/messageattachmentdelegatehelpertext.cpp b/src/widgets/room/delegate/messageattachmentdelegatehelpertext.cpp
index 2a518cb8ad..5ea3a6241a 100644
--- a/src/widgets/room/delegate/messageattachmentdelegatehelpertext.cpp
+++ b/src/widgets/room/delegate/messageattachmentdelegatehelpertext.cpp
@@ -62,11 +62,10 @@ void MessageAttachmentDelegateHelperText::draw(const MessageAttachment &msgAttac
}
QSize MessageAttachmentDelegateHelperText::sizeHint(const MessageAttachment &msgAttach,
- const QModelIndex &index,
+ [[maybe_unused]] const QModelIndex &index,
int maxWidth,
const QStyleOptionViewItem &option) const
{
- Q_UNUSED(index)
const TextLayout layout = layoutText(msgAttach, option, maxWidth, -1);
int height = layout.titleRect.height();
if ((layout.isShown && !layout.title.isEmpty()) || layout.title.isEmpty()) {
@@ -139,9 +138,8 @@ bool MessageAttachmentDelegateHelperText::handleMouseEvent(const MessageAttachme
MessageAttachmentDelegateHelperText::TextLayout MessageAttachmentDelegateHelperText::layoutText(const MessageAttachment &msgAttach,
const QStyleOptionViewItem &option,
int attachmentsWidth,
- int attachmentsHeight) const
+ [[maybe_unused]] int attachmentsHeight) const
{
- Q_UNUSED(attachmentsHeight)
TextLayout layout;
layout.title = msgAttach.attachmentGeneratedTitle();
if (!layout.title.isEmpty()) {
diff --git a/src/widgets/room/delegate/messageattachmentdelegatehelpervideo.cpp b/src/widgets/room/delegate/messageattachmentdelegatehelpervideo.cpp
index f2a655081f..e6e24e1c55 100644
--- a/src/widgets/room/delegate/messageattachmentdelegatehelpervideo.cpp
+++ b/src/widgets/room/delegate/messageattachmentdelegatehelpervideo.cpp
@@ -49,11 +49,10 @@ void MessageAttachmentDelegateHelperVideo::draw(const MessageAttachment &msgAtta
}
QSize MessageAttachmentDelegateHelperVideo::sizeHint(const MessageAttachment &msgAttach,
- const QModelIndex &index,
+ [[maybe_unused]] const QModelIndex &index,
int maxWidth,
const QStyleOptionViewItem &option) const
{
- Q_UNUSED(index)
const VideoLayout layout = layoutVideo(msgAttach, option, maxWidth);
int height = layout.titleSize.height() + DelegatePaintUtil::margin();
int descriptionWidth = 0;
diff --git a/src/widgets/room/delegate/messageblockdelegatehelperbase.cpp b/src/widgets/room/delegate/messageblockdelegatehelperbase.cpp
index 8f4ed48d12..fd29c02f5e 100644
--- a/src/widgets/room/delegate/messageblockdelegatehelperbase.cpp
+++ b/src/widgets/room/delegate/messageblockdelegatehelperbase.cpp
@@ -15,12 +15,11 @@ MessageBlockDelegateHelperBase::MessageBlockDelegateHelperBase(RocketChatAccount
MessageBlockDelegateHelperBase::~MessageBlockDelegateHelperBase() = default;
-bool MessageBlockDelegateHelperBase::handleHelpEvent(QHelpEvent *helpEvent, QRect messageRect, const Block &block, const QStyleOptionViewItem &option)
+bool MessageBlockDelegateHelperBase::handleHelpEvent([[maybe_unused]] QHelpEvent *helpEvent,
+ [[maybe_unused]] QRect messageRect,
+ [[maybe_unused]] const Block &block,
+ [[maybe_unused]] const QStyleOptionViewItem &option)
{
- Q_UNUSED(option);
- Q_UNUSED(helpEvent);
- Q_UNUSED(messageRect);
- Q_UNUSED(block);
return false;
}
diff --git a/src/widgets/room/delegate/messagedelegatehelperactions.cpp b/src/widgets/room/delegate/messagedelegatehelperactions.cpp
index 0824a2b50b..a10b3294a3 100644
--- a/src/widgets/room/delegate/messagedelegatehelperactions.cpp
+++ b/src/widgets/room/delegate/messagedelegatehelperactions.cpp
@@ -32,10 +32,9 @@ MessageDelegateHelperActions::~MessageDelegateHelperActions() = default;
void MessageDelegateHelperActions::draw(const Block &block,
QPainter *painter,
QRect blockRect,
- const QModelIndex &index,
+ [[maybe_unused]] const QModelIndex &index,
const QStyleOptionViewItem &option) const
{
- Q_UNUSED(index)
const ActionsLayout layout = layoutActions(block, option, blockRect.width());
painter->setRenderHint(QPainter::Antialiasing);
for (const auto &button : std::as_const(layout.buttonList)) {
diff --git a/src/widgets/room/delegate/messagedelegatehelperconferencevideo.cpp b/src/widgets/room/delegate/messagedelegatehelperconferencevideo.cpp
index 3b9b537506..3e16cd2e93 100644
--- a/src/widgets/room/delegate/messagedelegatehelperconferencevideo.cpp
+++ b/src/widgets/room/delegate/messagedelegatehelperconferencevideo.cpp
@@ -38,10 +38,9 @@ MessageDelegateHelperConferenceVideo::~MessageDelegateHelperConferenceVideo() =
void MessageDelegateHelperConferenceVideo::draw(const Block &block,
QPainter *painter,
QRect blockRect,
- const QModelIndex &index,
+ [[maybe_unused]] const QModelIndex &index,
const QStyleOptionViewItem &option) const
{
- Q_UNUSED(index)
const ConferenceCallLayout layout = layoutConferenceCall(block, option, blockRect.width());
painter->setRenderHint(QPainter::Antialiasing);
// Draw title and buttons
@@ -82,9 +81,11 @@ void MessageDelegateHelperConferenceVideo::draw(const Block &block,
}
}
-QSize MessageDelegateHelperConferenceVideo::sizeHint(const Block &block, const QModelIndex &index, int maxWidth, const QStyleOptionViewItem &option) const
+QSize MessageDelegateHelperConferenceVideo::sizeHint(const Block &block,
+ [[maybe_unused]] const QModelIndex &index,
+ int maxWidth,
+ const QStyleOptionViewItem &option) const
{
- Q_UNUSED(index)
const ConferenceCallLayout layout = layoutConferenceCall(block, option, maxWidth);
int height = layout.titleSize.height() + DelegatePaintUtil::margin();
// Button
@@ -107,9 +108,8 @@ bool MessageDelegateHelperConferenceVideo::handleMouseEvent(const Block &block,
QMouseEvent *mouseEvent,
QRect blocksRect,
const QStyleOptionViewItem &option,
- const QModelIndex &index)
+ [[maybe_unused]] const QModelIndex &index)
{
- Q_UNUSED(index);
const QEvent::Type eventType = mouseEvent->type();
switch (eventType) {
case QEvent::MouseButtonRelease: {
@@ -155,9 +155,8 @@ bool MessageDelegateHelperConferenceVideo::handleHelpEvent(QHelpEvent *helpEvent
}
MessageDelegateHelperConferenceVideo::ConferenceCallLayout
-MessageDelegateHelperConferenceVideo::layoutConferenceCall(const Block &block, const QStyleOptionViewItem &option, int blockRectWidth) const
+MessageDelegateHelperConferenceVideo::layoutConferenceCall(const Block &block, const QStyleOptionViewItem &option, [[maybe_unused]] int blockRectWidth) const
{
- Q_UNUSED(blockRectWidth)
ConferenceCallLayout layout;
layout.title = block.title();
layout.titleSize = option.fontMetrics.size(Qt::TextSingleLine, layout.title);
diff --git a/src/widgets/room/delegate/messagedelegatehelpersection.cpp b/src/widgets/room/delegate/messagedelegatehelpersection.cpp
index 840e253380..f2a2935fc0 100644
--- a/src/widgets/room/delegate/messagedelegatehelpersection.cpp
+++ b/src/widgets/room/delegate/messagedelegatehelpersection.cpp
@@ -101,8 +101,7 @@ bool MessageDelegateHelperSection::handleMouseEvent(const Block &block,
mRocketChatAccount->restApi()->initializeRestApiJob(job);
job->setAppsUiInteractionJobInfo(info);
// qDebug() << " info " << info;
- connect(job, &RocketChatRestApi::AppsUiInteractionJob::appsUiInteractionDone, this, [](const QJsonObject &replyObject) {
- Q_UNUSED(replyObject);
+ connect(job, &RocketChatRestApi::AppsUiInteractionJob::appsUiInteractionDone, this, []([[maybe_unused]] const QJsonObject &replyObject) {
qDebug() << " DONE";
});
if (!job->start()) {
@@ -136,10 +135,12 @@ bool MessageDelegateHelperSection::handleMouseEvent(const Block &block,
mRocketChatAccount->restApi()->initializeRestApiJob(job);
job->setAppsUiInteractionJobInfo(info);
// qDebug() << " info " << info;
- connect(job, &RocketChatRestApi::AppsUiInteractionJob::appsUiInteractionDone, this, [](const QJsonObject &replyObject) {
- Q_UNUSED(replyObject);
- // qDebug() << " DONE";
- });
+ connect(job,
+ &RocketChatRestApi::AppsUiInteractionJob::appsUiInteractionDone,
+ this,
+ []([[maybe_unused]] const QJsonObject &replyObject) {
+ // qDebug() << " DONE";
+ });
if (!job->start()) {
qCWarning(RUQOLA_AUTOGENERATEUI_LOG) << "Impossible to start AppsUiInteractionJob job";
}
@@ -154,9 +155,8 @@ bool MessageDelegateHelperSection::handleMouseEvent(const Block &block,
}
MessageDelegateHelperSection::SectionLayout
-MessageDelegateHelperSection::layoutSection(const Block &block, const QStyleOptionViewItem &option, int blockRectWidth) const
+MessageDelegateHelperSection::layoutSection(const Block &block, const QStyleOptionViewItem &option, [[maybe_unused]] int blockRectWidth) const
{
- Q_UNUSED(blockRectWidth)
SectionLayout layout;
layout.sectionText = block.sectionText();
layout.sectionTextSize = option.fontMetrics.size(Qt::TextSingleLine, layout.sectionText);
diff --git a/src/widgets/servererrorinfohistory/servererrorinfohistorydelegate.cpp b/src/widgets/servererrorinfohistory/servererrorinfohistorydelegate.cpp
index 36c1ba19a0..71073eec22 100644
--- a/src/widgets/servererrorinfohistory/servererrorinfohistorydelegate.cpp
+++ b/src/widgets/servererrorinfohistory/servererrorinfohistorydelegate.cpp
@@ -198,9 +198,8 @@ bool ServerErrorInfoHistoryDelegate::helpEvent(QHelpEvent *helpEvent, QAbstractI
return true;
}
-QPoint ServerErrorInfoHistoryDelegate::adaptMousePosition(const QPoint &pos, QRect textRect, const QStyleOptionViewItem &option)
+QPoint ServerErrorInfoHistoryDelegate::adaptMousePosition(const QPoint &pos, QRect textRect, [[maybe_unused]] const QStyleOptionViewItem &option)
{
- Q_UNUSED(option);
const QPoint relativePos = pos - textRect.topLeft();
return relativePos;
}
@@ -235,9 +234,8 @@ bool ServerErrorInfoHistoryDelegate::maybeStartDrag(QMouseEvent *event, const QS
return false;
}
-RocketChatAccount *ServerErrorInfoHistoryDelegate::rocketChatAccount(const QModelIndex &index) const
+RocketChatAccount *ServerErrorInfoHistoryDelegate::rocketChatAccount([[maybe_unused]] const QModelIndex &index) const
{
- Q_UNUSED(index);
return nullptr;
}