Skip to content

Commit

Permalink
Make clazy a bit more happy
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOneRing committed Apr 28, 2021
1 parent 3994e5c commit 637e288
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/gui/activitywidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ ActivityWidget::ActivityWidget(QWidget *parent)
showLabels();
}

for (const auto widget : _widgetForNotifId) {
for (const auto widget : qAsConst(_widgetForNotifId)) {
if (widget->activity().uuid() == ast->account()->uuid()) {
scheduleWidgetToRemove(widget);
}
Expand Down Expand Up @@ -313,24 +313,23 @@ void ActivityWidget::slotBuildNotificationDisplay(const ActivityList &list)

const auto accId = list.first().uuid();
QList<Activity::Identifier> strayCats;
for (const auto &id : _widgetForNotifId.keys()) {
NotificationWidget *widget = _widgetForNotifId[id];
for (auto it = _widgetForNotifId.cbegin(); it != _widgetForNotifId.cend(); ++it) {
bool found = false;
// do not mark widgets of other accounts to delete.
if (widget->activity().uuid() != accId) {
if (it.value()->activity().uuid() != accId) {
continue;
}

for (const auto &activity : list) {
if (activity.id() == id) {
if (activity.id() == it.key()) {
// found an activity
found = true;
break;
}
}
if (!found) {
// the activity does not exist any more.
strayCats.append(id);
strayCats.append(it.key());
}
}

Expand Down Expand Up @@ -376,10 +375,10 @@ void ActivityWidget::slotSendNotificationRequest(const QString &accountName, con
qCInfo(lcActivity) << "Server Notification Request " << verb << link << "on account" << accountName;
NotificationWidget *theSender = qobject_cast<NotificationWidget *>(sender());

const QStringList validVerbs = QStringList() << "GET"
<< "PUT"
<< "POST"
<< "DELETE";
const QStringList validVerbs = { QStringLiteral("GET"),
QStringLiteral("PUT"),
QStringLiteral("POST"),
QStringLiteral("DELETE") };

if (validVerbs.contains(verb)) {
AccountStatePtr acc = AccountManager::instance()->account(accountName);
Expand Down

0 comments on commit 637e288

Please sign in to comment.