mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
refactor: Comply with Wunused-parameter
Explicitly ignore unused parameters. Also replace Q_UNUSED with std::ignore for consistency and to favour std over Qt when equivalent.
This commit is contained in:
parent
288f44ba5a
commit
48ad6cc17a
|
@ -71,7 +71,7 @@ QString ChatLineContent::getSelectedText() const
|
|||
|
||||
void ChatLineContent::fontChanged(const QFont& font)
|
||||
{
|
||||
Q_UNUSED(font)
|
||||
std::ignore = font;
|
||||
}
|
||||
|
||||
qreal ChatLineContent::getAscent() const
|
||||
|
|
|
@ -1304,6 +1304,7 @@ void ChatWidget::showEvent(QShowEvent*)
|
|||
|
||||
void ChatWidget::hideEvent(QHideEvent* event)
|
||||
{
|
||||
std::ignore = event;
|
||||
// Purge accumulated lines from the chatlog. We do not purge messages while
|
||||
// the chatlog is open because it causes flickers. When a user leaves the
|
||||
// chat we take the opportunity to remove old messages. If a user only has
|
||||
|
|
|
@ -40,14 +40,14 @@ void Broken::paint(QPainter* painter, const QStyleOptionGraphicsItem* option,
|
|||
painter->setRenderHint(QPainter::SmoothPixmapTransform);
|
||||
painter->drawPixmap(0, 0, pmap);
|
||||
|
||||
Q_UNUSED(option)
|
||||
Q_UNUSED(widget)
|
||||
std::ignore = option;
|
||||
std::ignore = widget;
|
||||
|
||||
}
|
||||
|
||||
void Broken::setWidth(qreal width)
|
||||
{
|
||||
Q_UNUSED(width)
|
||||
std::ignore = width;
|
||||
}
|
||||
|
||||
qreal Broken::getAscent() const
|
||||
|
|
|
@ -46,11 +46,11 @@ void Image::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWi
|
|||
painter->translate(-size.width() / 2.0, -size.height() / 2.0);
|
||||
painter->drawPixmap(0, 0, pmap);
|
||||
|
||||
Q_UNUSED(option)
|
||||
Q_UNUSED(widget)
|
||||
std::ignore = option;
|
||||
std::ignore = widget;
|
||||
}
|
||||
|
||||
void Image::setWidth(qreal width)
|
||||
{
|
||||
Q_UNUSED(width)
|
||||
std::ignore = width;
|
||||
}
|
||||
|
|
|
@ -57,13 +57,13 @@ void NotificationIcon::paint(QPainter* painter, const QStyleOptionGraphicsItem*
|
|||
updateTimer.start();
|
||||
}
|
||||
|
||||
Q_UNUSED(option)
|
||||
Q_UNUSED(widget)
|
||||
std::ignore = option;
|
||||
std::ignore = widget;
|
||||
}
|
||||
|
||||
void NotificationIcon::setWidth(qreal width)
|
||||
{
|
||||
Q_UNUSED(width)
|
||||
std::ignore = width;
|
||||
}
|
||||
|
||||
qreal NotificationIcon::getAscent() const
|
||||
|
|
|
@ -71,13 +71,13 @@ void Spinner::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, Q
|
|||
timer.start(); // update bounding rectangle for next frame
|
||||
}
|
||||
|
||||
Q_UNUSED(option)
|
||||
Q_UNUSED(widget)
|
||||
std::ignore = option;
|
||||
std::ignore = widget;
|
||||
}
|
||||
|
||||
void Spinner::setWidth(qreal width)
|
||||
{
|
||||
Q_UNUSED(width)
|
||||
std::ignore = width;
|
||||
}
|
||||
|
||||
qreal Spinner::getAscent() const
|
||||
|
|
|
@ -210,8 +210,8 @@ QRectF Text::boundingRect() const
|
|||
|
||||
void Text::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
|
||||
{
|
||||
Q_UNUSED(option)
|
||||
Q_UNUSED(widget)
|
||||
std::ignore = option;
|
||||
std::ignore = widget;
|
||||
|
||||
if (!doc)
|
||||
return;
|
||||
|
|
|
@ -955,6 +955,7 @@ void Core::onConnectionStatusChanged(Tox*, uint32_t friendId, Tox_Connection sta
|
|||
void Core::onGroupInvite(Tox* tox, uint32_t friendId, Tox_Conference_Type type,
|
||||
const uint8_t* cookie, size_t length, void* vCore)
|
||||
{
|
||||
std::ignore = tox;
|
||||
Core* core = static_cast<Core*>(vCore);
|
||||
const QByteArray data(reinterpret_cast<const char*>(cookie), length);
|
||||
const GroupInvite inviteInfo(friendId, type, data);
|
||||
|
|
|
@ -475,7 +475,7 @@ void CoreAV::groupCallCallback(void* tox, uint32_t group, uint32_t peer, const i
|
|||
* See https://github.com/TokTok/c-toxcore/issues/1364 for details.
|
||||
*/
|
||||
|
||||
Q_UNUSED(tox)
|
||||
std::ignore = tox;
|
||||
Core* c = static_cast<Core*>(core);
|
||||
CoreAV* cav = c->getAv();
|
||||
|
||||
|
@ -751,7 +751,7 @@ void CoreAV::callCallback(ToxAV* toxav, uint32_t friendNum, bool audio, bool vid
|
|||
|
||||
void CoreAV::stateCallback(ToxAV* toxav, uint32_t friendNum, uint32_t state, void* vSelf)
|
||||
{
|
||||
Q_UNUSED(toxav)
|
||||
std::ignore = toxav;
|
||||
CoreAV* self = static_cast<CoreAV*>(vSelf);
|
||||
|
||||
// we must unlock this lock before emitting any signals
|
||||
|
@ -812,8 +812,8 @@ void CoreAV::bitrateCallback(ToxAV* toxav, uint32_t friendNum, uint32_t arate, u
|
|||
void* vSelf)
|
||||
{
|
||||
CoreAV* self = static_cast<CoreAV*>(vSelf);
|
||||
Q_UNUSED(self)
|
||||
Q_UNUSED(toxav)
|
||||
std::ignore = self;
|
||||
std::ignore = toxav;
|
||||
|
||||
qDebug() << "Recommended bitrate with" << friendNum << " is now " << arate << "/" << vrate
|
||||
<< ", ignoring it";
|
||||
|
@ -823,8 +823,8 @@ void CoreAV::bitrateCallback(ToxAV* toxav, uint32_t friendNum, uint32_t arate, u
|
|||
void CoreAV::audioBitrateCallback(ToxAV* toxav, uint32_t friendNum, uint32_t rate, void* vSelf)
|
||||
{
|
||||
CoreAV* self = static_cast<CoreAV*>(vSelf);
|
||||
Q_UNUSED(self)
|
||||
Q_UNUSED(toxav)
|
||||
std::ignore = self;
|
||||
std::ignore = toxav;
|
||||
|
||||
qDebug() << "Recommended audio bitrate with" << friendNum << " is now " << rate << ", ignoring it";
|
||||
}
|
||||
|
@ -833,8 +833,8 @@ void CoreAV::audioBitrateCallback(ToxAV* toxav, uint32_t friendNum, uint32_t rat
|
|||
void CoreAV::videoBitrateCallback(ToxAV* toxav, uint32_t friendNum, uint32_t rate, void* vSelf)
|
||||
{
|
||||
CoreAV* self = static_cast<CoreAV*>(vSelf);
|
||||
Q_UNUSED(self)
|
||||
Q_UNUSED(toxav)
|
||||
std::ignore = self;
|
||||
std::ignore = toxav;
|
||||
|
||||
qDebug() << "Recommended video bitrate with" << friendNum << " is now " << rate << ", ignoring it";
|
||||
}
|
||||
|
|
|
@ -47,6 +47,8 @@ QByteArray cleanPath(const char *file)
|
|||
void onLogMessage(Tox *tox, Tox_Log_Level level, const char *file, uint32_t line,
|
||||
const char *func, const char *message, void *user_data)
|
||||
{
|
||||
std::ignore = tox;
|
||||
std::ignore = user_data;
|
||||
const QByteArray cleanedPath = cleanPath(file);
|
||||
|
||||
switch (level) {
|
||||
|
|
|
@ -29,16 +29,20 @@ AboutFriend::AboutFriend(const Friend* f_, IFriendSettings* const settings_)
|
|||
, settings{settings_}
|
||||
{
|
||||
settings->connectTo_contactNoteChanged(this, [=](const ToxPk& pk, const QString& note) {
|
||||
std::ignore = pk;
|
||||
emit noteChanged(note);
|
||||
});
|
||||
settings->connectTo_autoAcceptCallChanged(this,
|
||||
[=](const ToxPk& pk, IFriendSettings::AutoAcceptCallFlags flag) {
|
||||
std::ignore = pk;
|
||||
emit autoAcceptCallChanged(flag);
|
||||
});
|
||||
settings->connectTo_autoAcceptDirChanged(this, [=](const ToxPk& pk, const QString& dir) {
|
||||
std::ignore = pk;
|
||||
emit autoAcceptDirChanged(dir);
|
||||
});
|
||||
settings->connectTo_autoGroupInviteChanged(this, [=](const ToxPk& pk, bool enable) {
|
||||
std::ignore = pk;
|
||||
emit autoGroupInviteChanged(enable);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -68,6 +68,7 @@ GroupMessageDispatcher::sendMessage(bool isAction, QString const& content)
|
|||
std::pair<DispatchedMessageId, DispatchedMessageId>
|
||||
GroupMessageDispatcher::sendExtendedMessage(const QString& content, ExtensionSet extensions)
|
||||
{
|
||||
std::ignore = extensions;
|
||||
// Stub this api to immediately fail
|
||||
auto messageId = nextMessageId++;
|
||||
auto messages = processor.processOutgoingMessage(false, content, ExtensionSet());
|
||||
|
|
|
@ -933,6 +933,7 @@ void RawDatabase::regexpSensitive(sqlite3_context* ctx, int argc, sqlite3_value*
|
|||
|
||||
void RawDatabase::regexp(sqlite3_context* ctx, int argc, sqlite3_value** argv, const QRegularExpression::PatternOptions cs)
|
||||
{
|
||||
std::ignore = argc;
|
||||
QRegularExpression regex;
|
||||
const QString str1(reinterpret_cast<const char*>(sqlite3_value_text(argv[0])));
|
||||
const QString str2(reinterpret_cast<const char*>(sqlite3_value_text(argv[1])));
|
||||
|
|
|
@ -958,7 +958,7 @@ void Settings::setAutorun(bool newValue)
|
|||
emit autorunChanged(autorun);
|
||||
}
|
||||
#else
|
||||
Q_UNUSED(newValue)
|
||||
std::ignore = newValue;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -1970,7 +1970,7 @@ void Settings::setFriendActivity(const ToxPk& id, const QDateTime& activity)
|
|||
|
||||
void Settings::saveFriendSettings(const ToxPk& id)
|
||||
{
|
||||
Q_UNUSED(id)
|
||||
std::ignore = id;
|
||||
savePersonal();
|
||||
}
|
||||
|
||||
|
|
|
@ -232,7 +232,7 @@ CameraDevice* CameraDevice::open(QString devName, VideoMode mode)
|
|||
#endif
|
||||
else if (mode) {
|
||||
qWarning().nospace() << "No known options for " << iformat->name << ", using defaults.";
|
||||
Q_UNUSED(mode)
|
||||
std::ignore = mode;
|
||||
}
|
||||
|
||||
CameraDevice* dev = open(devName, &options);
|
||||
|
@ -450,7 +450,7 @@ QVector<VideoMode> CameraDevice::getScreenModes()
|
|||
*/
|
||||
QVector<VideoMode> CameraDevice::getVideoModes(QString devName)
|
||||
{
|
||||
Q_UNUSED(devName)
|
||||
std::ignore = devName;
|
||||
|
||||
if (!iformat)
|
||||
;
|
||||
|
@ -484,6 +484,7 @@ QString CameraDevice::getPixelFormatString(uint32_t pixel_format)
|
|||
#if USING_V4L
|
||||
return v4l2::getPixelFormatString(pixel_format);
|
||||
#else
|
||||
std::ignore = pixel_format;
|
||||
return QString("unknown");
|
||||
#endif
|
||||
}
|
||||
|
@ -500,6 +501,8 @@ bool CameraDevice::betterPixelFormat(uint32_t a, uint32_t b)
|
|||
#if USING_V4L
|
||||
return v4l2::betterPixelFormat(a, b);
|
||||
#else
|
||||
std::ignore = a;
|
||||
std::ignore = b;
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -197,7 +197,7 @@ void NetCamView::setTitle(const QString& title)
|
|||
|
||||
void NetCamView::showEvent(QShowEvent* event)
|
||||
{
|
||||
Q_UNUSED(event)
|
||||
std::ignore = event;
|
||||
selfFrame->resetBoundary(videoSurface->getBoundingRect());
|
||||
}
|
||||
|
||||
|
|
|
@ -201,7 +201,7 @@ void VideoSurface::resizeEvent(QResizeEvent* event)
|
|||
|
||||
void VideoSurface::showEvent(QShowEvent* e)
|
||||
{
|
||||
Q_UNUSED(e)
|
||||
std::ignore = e;
|
||||
// emit ratioChanged();
|
||||
}
|
||||
|
||||
|
|
|
@ -251,7 +251,7 @@ void CategoryWidget::onCompactChanged(bool _compact)
|
|||
topLayout->setSpacing(0);
|
||||
topLayout->setMargin(0);
|
||||
|
||||
Q_UNUSED(_compact)
|
||||
std::ignore = _compact;
|
||||
setCompact(true);
|
||||
|
||||
nameLabel->minimizeMaximumWidth();
|
||||
|
|
|
@ -642,6 +642,7 @@ void ContentDialog::setStatusMessage(const ToxPk& friendPk, const QString& messa
|
|||
*/
|
||||
void ContentDialog::updateFriendWidget(const ToxPk& friendPk, QString alias)
|
||||
{
|
||||
std::ignore = alias;
|
||||
Friend* f = FriendList::findFriend(friendPk);
|
||||
FriendWidget* friendWidget = qobject_cast<FriendWidget*>(contactWidgets[friendPk]);
|
||||
|
||||
|
|
|
@ -192,6 +192,6 @@ void EmoticonsWidget::PageButtonsUpdate()
|
|||
|
||||
void EmoticonsWidget::keyPressEvent(QKeyEvent* e)
|
||||
{
|
||||
Q_UNUSED(e)
|
||||
std::ignore = e;
|
||||
hide();
|
||||
}
|
||||
|
|
|
@ -456,6 +456,7 @@ void ChatForm::onFriendStatusChanged(const ToxPk& friendPk, Status::Status statu
|
|||
{
|
||||
// Disable call buttons if friend is offline
|
||||
assert(friendPk == f->getPublicKey());
|
||||
std::ignore = friendPk;
|
||||
|
||||
if (!Status::isOnline(f->getStatus())) {
|
||||
// Hide the "is typing" message when a friend goes offline
|
||||
|
|
|
@ -234,11 +234,13 @@ namespace FileTransferList
|
|||
|
||||
int Model::rowCount(const QModelIndex& parent) const
|
||||
{
|
||||
std::ignore = parent;
|
||||
return files.size();
|
||||
}
|
||||
|
||||
int Model::columnCount(const QModelIndex& parent) const
|
||||
{
|
||||
std::ignore = parent;
|
||||
return static_cast<int>(Column::invalid);
|
||||
}
|
||||
|
||||
|
@ -293,6 +295,7 @@ namespace FileTransferList
|
|||
|
||||
bool Model::setData(const QModelIndex &index, const QVariant &value, int role)
|
||||
{
|
||||
std::ignore = role;
|
||||
const auto column = toFileTransferListColumn(index.column());
|
||||
|
||||
if (column != Column::control) {
|
||||
|
|
|
@ -238,6 +238,7 @@ void GroupChatForm::updateUserNames()
|
|||
|
||||
void GroupChatForm::onUserJoined(const ToxPk& user, const QString& name)
|
||||
{
|
||||
std::ignore = user;
|
||||
if (settings.getShowGroupJoinLeaveMessages()) {
|
||||
addSystemInfoMessage(QDateTime::currentDateTime(), SystemMessageType::userJoinedGroup, {name});
|
||||
}
|
||||
|
@ -246,6 +247,7 @@ void GroupChatForm::onUserJoined(const ToxPk& user, const QString& name)
|
|||
|
||||
void GroupChatForm::onUserLeft(const ToxPk& user, const QString& name)
|
||||
{
|
||||
std::ignore = user;
|
||||
if (settings.getShowGroupJoinLeaveMessages()) {
|
||||
addSystemInfoMessage(QDateTime::currentDateTime(), SystemMessageType::userLeftGroup, {name});
|
||||
}
|
||||
|
@ -254,6 +256,7 @@ void GroupChatForm::onUserLeft(const ToxPk& user, const QString& name)
|
|||
|
||||
void GroupChatForm::onPeerNameChanged(const ToxPk& peer, const QString& oldName, const QString& newName)
|
||||
{
|
||||
std::ignore = peer;
|
||||
addSystemInfoMessage(QDateTime::currentDateTime(), SystemMessageType::peerNameChanged,
|
||||
{oldName, newName});
|
||||
updateUserNames();
|
||||
|
|
|
@ -141,7 +141,7 @@ void SearchSettingsForm::onStartSearchSelected(const int index)
|
|||
|
||||
void SearchSettingsForm::onRegisterClicked(const bool checked)
|
||||
{
|
||||
Q_UNUSED(checked)
|
||||
std::ignore = checked;
|
||||
setUpdate(true);
|
||||
}
|
||||
|
||||
|
|
|
@ -174,6 +174,7 @@ void AboutForm::replaceVersions()
|
|||
|
||||
void AboutForm::onUpdateAvailable(QString latestVersion, QUrl link)
|
||||
{
|
||||
std::ignore = latestVersion;
|
||||
QObject::disconnect(linkConnection);
|
||||
linkConnection = connect(bodyUI->updateAvailableButton, &QPushButton::clicked,
|
||||
[link]() { QDesktopServices::openUrl(link); });
|
||||
|
|
|
@ -462,6 +462,7 @@ void AVForm::on_videoDevCombobox_currentIndexChanged(int index)
|
|||
|
||||
void AVForm::on_audioQualityComboBox_currentIndexChanged(int index)
|
||||
{
|
||||
std::ignore = index;
|
||||
audioSettings->setAudioBitrate(audioQualityComboBox->currentData().toInt());
|
||||
}
|
||||
|
||||
|
|
|
@ -349,7 +349,7 @@ void FriendListWidget::addGroupWidget(GroupWidget* widget)
|
|||
{
|
||||
Group* g = widget->getGroup();
|
||||
connect(g, &Group::titleChanged, [=](const QString& author, const QString& name) {
|
||||
Q_UNUSED(author)
|
||||
std::ignore = author;
|
||||
renameGroupWidget(widget, name);
|
||||
});
|
||||
|
||||
|
@ -414,6 +414,8 @@ void FriendListWidget::searchChatrooms(const QString& searchString, bool hideOnl
|
|||
|
||||
void FriendListWidget::renameGroupWidget(GroupWidget* groupWidget, const QString& newName)
|
||||
{
|
||||
std::ignore = groupWidget;
|
||||
std::ignore = newName;
|
||||
itemsChanged();
|
||||
}
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ GroupWidget::~GroupWidget()
|
|||
|
||||
void GroupWidget::updateTitle(const QString& author, const QString& newName)
|
||||
{
|
||||
Q_UNUSED(author)
|
||||
std::ignore = author;
|
||||
nameLabel->setText(newName);
|
||||
}
|
||||
|
||||
|
|
|
@ -91,6 +91,7 @@ void ChatTextEdit::sendKeyEvent(QKeyEvent* event)
|
|||
|
||||
bool ChatTextEdit::pasteIfImage(QKeyEvent* event)
|
||||
{
|
||||
std::ignore = event;
|
||||
const QClipboard* const clipboard = QApplication::clipboard();
|
||||
if (!clipboard) {
|
||||
return false;
|
||||
|
|
|
@ -177,14 +177,14 @@ void ScreenGrabberChooserRectItem::mouseRelease(QGraphicsSceneMouseEvent* event)
|
|||
|
||||
void ScreenGrabberChooserRectItem::mouseDoubleClick(QGraphicsSceneMouseEvent* event)
|
||||
{
|
||||
Q_UNUSED(event)
|
||||
std::ignore = event;
|
||||
emit doubleClicked();
|
||||
}
|
||||
|
||||
void ScreenGrabberChooserRectItem::mousePressHandle(int x, int y, QGraphicsSceneMouseEvent* event)
|
||||
{
|
||||
Q_UNUSED(x)
|
||||
Q_UNUSED(y)
|
||||
std::ignore = x;
|
||||
std::ignore = y;
|
||||
|
||||
if (event->button() == Qt::LeftButton)
|
||||
state = HandleResizing;
|
||||
|
@ -223,8 +223,8 @@ void ScreenGrabberChooserRectItem::mouseMoveHandle(int x, int y, QGraphicsSceneM
|
|||
|
||||
void ScreenGrabberChooserRectItem::mouseReleaseHandle(int x, int y, QGraphicsSceneMouseEvent* event)
|
||||
{
|
||||
Q_UNUSED(x)
|
||||
Q_UNUSED(y)
|
||||
std::ignore = x;
|
||||
std::ignore = y;
|
||||
|
||||
if (event->button() == Qt::LeftButton)
|
||||
state = None;
|
||||
|
|
|
@ -1204,6 +1204,7 @@ void Widget::addFriend(uint32_t friendId, const ToxPk& friendPk)
|
|||
|
||||
|
||||
auto notifyReceivedCallback = [this, friendPk](const ToxPk& author, const Message& message) {
|
||||
std::ignore = author;
|
||||
newFriendMessageAlert(friendPk, message.content);
|
||||
};
|
||||
|
||||
|
@ -1498,11 +1499,11 @@ void Widget::addFriendDialog(const Friend* frnd, ContentDialog* dialog)
|
|||
[=](QContextMenuEvent* event) { emit widget->contextMenuCalled(event); });
|
||||
|
||||
connect(friendWidget, &FriendWidget::chatroomWidgetClicked, [=](GenericChatroomWidget* w) {
|
||||
Q_UNUSED(w)
|
||||
std::ignore = w;
|
||||
emit widget->chatroomWidgetClicked(widget);
|
||||
});
|
||||
connect(friendWidget, &FriendWidget::newWindowOpened, [=](GenericChatroomWidget* w) {
|
||||
Q_UNUSED(w)
|
||||
std::ignore = w;
|
||||
emit widget->newWindowOpened(widget);
|
||||
});
|
||||
// FIXME: emit should be removed
|
||||
|
@ -1549,12 +1550,12 @@ void Widget::addGroupDialog(const Group* group, ContentDialog* dialog)
|
|||
// ContentDialog) to the `widget` (which shown in main widget)
|
||||
// FIXME: emit should be removed
|
||||
connect(groupWidget, &GroupWidget::chatroomWidgetClicked, [=](GenericChatroomWidget* w) {
|
||||
Q_UNUSED(w)
|
||||
std::ignore = w;
|
||||
emit widget->chatroomWidgetClicked(widget);
|
||||
});
|
||||
|
||||
connect(groupWidget, &GroupWidget::newWindowOpened, [=](GenericChatroomWidget* w) {
|
||||
Q_UNUSED(w)
|
||||
std::ignore = w;
|
||||
emit widget->newWindowOpened(widget);
|
||||
});
|
||||
|
||||
|
@ -1602,6 +1603,10 @@ bool Widget::newFriendMessageAlert(const ToxPk& friendId, const QString& text, b
|
|||
auto notificationData = filename.isEmpty() ? notificationGenerator->friendMessageNotification(f, text)
|
||||
: notificationGenerator->fileTransferNotification(f, filename, filesize);
|
||||
notifier.notifyMessage(notificationData);
|
||||
#else
|
||||
std::ignore = text;
|
||||
std::ignore = filename;
|
||||
std::ignore = filesize;
|
||||
#endif
|
||||
|
||||
if (contentDialog == nullptr) {
|
||||
|
@ -1644,6 +1649,9 @@ bool Widget::newGroupMessageAlert(const GroupId& groupId, const ToxPk& authorPk,
|
|||
#if DESKTOP_NOTIFICATIONS
|
||||
auto notificationData = notificationGenerator->groupMessageNotification(g, authorPk, message);
|
||||
notifier.notifyMessage(notificationData);
|
||||
#else
|
||||
std::ignore = authorPk;
|
||||
std::ignore = message;
|
||||
#endif
|
||||
|
||||
if (contentDialog == nullptr) {
|
||||
|
@ -2399,8 +2407,8 @@ void Widget::saveSplitterGeometry()
|
|||
|
||||
void Widget::onSplitterMoved(int pos, int index)
|
||||
{
|
||||
Q_UNUSED(pos)
|
||||
Q_UNUSED(index)
|
||||
std::ignore = pos;
|
||||
std::ignore = index;
|
||||
saveSplitterGeometry();
|
||||
}
|
||||
|
||||
|
@ -2502,6 +2510,9 @@ inline QIcon Widget::prepareIcon(QString path, int w, int h)
|
|||
return QIcon(pm);
|
||||
}
|
||||
}
|
||||
#else
|
||||
std::ignore = w;
|
||||
std::ignore = h;
|
||||
#endif
|
||||
return QIcon(path);
|
||||
}
|
||||
|
|
|
@ -38,11 +38,13 @@ public:
|
|||
|
||||
GroupId getGroupPersistentId(uint32_t groupNumber) const override
|
||||
{
|
||||
std::ignore = groupNumber;
|
||||
return GroupId(0);
|
||||
}
|
||||
|
||||
uint32_t getGroupNumberPeers(int groupId) const override
|
||||
{
|
||||
std::ignore = groupId;
|
||||
if (emptyGroup) {
|
||||
return 1;
|
||||
}
|
||||
|
@ -52,17 +54,20 @@ public:
|
|||
|
||||
QString getGroupPeerName(int groupId, int peerId) const override
|
||||
{
|
||||
std::ignore = groupId;
|
||||
return QString("peer") + peerId;
|
||||
}
|
||||
|
||||
ToxPk getGroupPeerPk(int groupId, int peerId) const override
|
||||
{
|
||||
std::ignore = groupId;
|
||||
uint8_t id[TOX_PUBLIC_KEY_SIZE] = {static_cast<uint8_t>(peerId)};
|
||||
return ToxPk(id);
|
||||
}
|
||||
|
||||
QStringList getGroupPeerNames(int groupId) const override
|
||||
{
|
||||
std::ignore = groupId;
|
||||
if (emptyGroup) {
|
||||
return QStringList({QString("me")});
|
||||
}
|
||||
|
@ -71,6 +76,7 @@ public:
|
|||
|
||||
bool getGroupAvEnabled(int groupId) const override
|
||||
{
|
||||
std::ignore = groupId;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -73,6 +73,7 @@ public:
|
|||
|
||||
std::unique_ptr<ICoreExtPacket> MockCoreExtPacketAllocator::getPacket(uint32_t friendId)
|
||||
{
|
||||
std::ignore = friendId;
|
||||
return std::unique_ptr<MockCoreExtPacket>(new MockCoreExtPacket(numSentMessages, currentReceiptId));
|
||||
}
|
||||
|
||||
|
@ -91,6 +92,8 @@ public:
|
|||
|
||||
bool MockFriendMessageSender::sendAction(uint32_t friendId, const QString& action, ReceiptNum& receipt)
|
||||
{
|
||||
std::ignore = friendId;
|
||||
std::ignore = action;
|
||||
if (canSend) {
|
||||
numSentActions++;
|
||||
receipt = receiptNum;
|
||||
|
@ -101,6 +104,8 @@ bool MockFriendMessageSender::sendAction(uint32_t friendId, const QString& actio
|
|||
|
||||
bool MockFriendMessageSender::sendMessage(uint32_t friendId, const QString& message, ReceiptNum& receipt)
|
||||
{
|
||||
std::ignore = friendId;
|
||||
std::ignore = message;
|
||||
if (canSend) {
|
||||
numSentMessages++;
|
||||
receipt = receiptNum;
|
||||
|
@ -144,6 +149,7 @@ private slots:
|
|||
|
||||
void onMessageReceived(const ToxPk& sender, Message message)
|
||||
{
|
||||
std::ignore = sender;
|
||||
receivedMessages.push_back(std::move(message));
|
||||
}
|
||||
|
||||
|
|
|
@ -48,11 +48,15 @@ public:
|
|||
|
||||
void MockGroupMessageSender::sendGroupAction(int groupId, const QString& action)
|
||||
{
|
||||
std::ignore = groupId;
|
||||
std::ignore = action;
|
||||
numSentActions++;
|
||||
}
|
||||
|
||||
void MockGroupMessageSender::sendGroupMessage(int groupId, const QString& message)
|
||||
{
|
||||
std::ignore = groupId;
|
||||
std::ignore = message;
|
||||
numSentMessages++;
|
||||
}
|
||||
|
||||
|
@ -66,7 +70,7 @@ public:
|
|||
SIGNAL_IMPL(MockGroupSettings, blackListChanged, QStringList const& blist)
|
||||
|
||||
bool getShowGroupJoinLeaveMessages() const override { return true; };
|
||||
void setShowGroupJoinLeaveMessages(bool newValue) override {};
|
||||
void setShowGroupJoinLeaveMessages(bool newValue) override { std::ignore = newValue; };
|
||||
SIGNAL_IMPL(MockGroupSettings, showGroupJoinLeaveMessagesChanged, bool show)
|
||||
|
||||
private:
|
||||
|
@ -115,6 +119,7 @@ private slots:
|
|||
|
||||
void onMessageReceived(const ToxPk& sender, Message message)
|
||||
{
|
||||
std::ignore = sender;
|
||||
receivedMessages.push_back(std::move(message));
|
||||
}
|
||||
|
||||
|
|
|
@ -32,25 +32,25 @@ namespace
|
|||
{
|
||||
virtual bool getNotify() const override { return true; }
|
||||
|
||||
virtual void setNotify(bool newValue) override {}
|
||||
virtual void setNotify(bool newValue) override { std::ignore = newValue; }
|
||||
|
||||
virtual bool getShowWindow() const override { return true; }
|
||||
virtual void setShowWindow(bool newValue) override {}
|
||||
virtual void setShowWindow(bool newValue) override { std::ignore = newValue; }
|
||||
|
||||
virtual bool getDesktopNotify() const override { return true; }
|
||||
virtual void setDesktopNotify(bool enabled) override {}
|
||||
virtual void setDesktopNotify(bool enabled) override { std::ignore = enabled; }
|
||||
|
||||
virtual bool getNotifySound() const override { return true; }
|
||||
virtual void setNotifySound(bool newValue) override {}
|
||||
virtual void setNotifySound(bool newValue) override { std::ignore = newValue; }
|
||||
|
||||
virtual bool getNotifyHide() const override { return notifyHide; }
|
||||
virtual void setNotifyHide(bool newValue) override { notifyHide = newValue; };
|
||||
|
||||
virtual bool getBusySound() const override { return true; }
|
||||
virtual void setBusySound(bool newValue) override {}
|
||||
virtual void setBusySound(bool newValue) override { std::ignore = newValue; }
|
||||
|
||||
virtual bool getGroupAlwaysNotify() const override { return true; }
|
||||
virtual void setGroupAlwaysNotify(bool newValue) override {}
|
||||
virtual void setGroupAlwaysNotify(bool newValue) override { std::ignore = newValue; }
|
||||
private:
|
||||
bool notifyHide = false;
|
||||
};
|
||||
|
|
|
@ -166,10 +166,12 @@ void TestFileTransferList::testControl()
|
|||
bool pauseCalled = false;
|
||||
|
||||
QObject::connect(&model, &Model::cancel, [&] (ToxFile file) {
|
||||
std::ignore = file;
|
||||
cancelCalled = true;
|
||||
});
|
||||
|
||||
QObject::connect(&model, &Model::togglePause, [&] (ToxFile file) {
|
||||
std::ignore = file;
|
||||
pauseCalled = true;
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user