Skip to content

Commit

Permalink
Fix code smells.
Browse files Browse the repository at this point in the history
Signed-off-by: alex-z <blackslayer4@gmail.com>
  • Loading branch information
allexzander committed Oct 29, 2022
1 parent 2f16e4e commit 91652a4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/gui/tray/usermodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -915,9 +915,9 @@ bool UserModel::isUserConnected(const int id)
return _users[id]->isConnected();
}

QImage UserModel::avatarById(const int id)
QImage UserModel::avatarById(const int id) const
{
const auto foundUserByIdIter = std::find_if(std::cbegin(_users), std::cend(_users), [&id](const OCC::User* user) {
const auto foundUserByIdIter = std::find_if(std::cbegin(_users), std::cend(_users), [&id](const OCC::User* const user) {
return user->account()->id() == QString::number(id);
});

Expand Down Expand Up @@ -1075,7 +1075,7 @@ void UserModel::removeAccount(const int id)
"<p><b>Note:</b> This will <b>not</b> delete any files.</p>")
.arg(_users[id]->name()),
QMessageBox::NoButton);
QPushButton *yesButton = messageBox.addButton(tr("Remove connection"), QMessageBox::YesRole);
const QPushButton * const yesButton = messageBox.addButton(tr("Remove connection"), QMessageBox::YesRole);
messageBox.addButton(tr("Cancel"), QMessageBox::NoRole);

messageBox.exec();
Expand Down
2 changes: 1 addition & 1 deletion src/gui/tray/usermodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class UserModel : public QAbstractListModel
[[nodiscard]] int rowCount(const QModelIndex &parent = QModelIndex()) const override;
[[nodiscard]] QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;

QImage avatarById(const int id);
[[nodiscard]] QImage avatarById(const int id) const;

[[nodiscard]] User *currentUser() const;

Expand Down

0 comments on commit 91652a4

Please sign in to comment.