From: Claudio Cambra Date: Fri, 8 Jul 2022 15:44:50 +0000 (+0200) Subject: Take ints by value rather than reference in UserModel methods X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~15^2~100^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=6872e1a75b15a9fe1d4a00b76c131b8705275ac0;p=nextcloud-desktop.git Take ints by value rather than reference in UserModel methods Signed-off-by: Claudio Cambra --- diff --git a/src/gui/tray/usermodel.cpp b/src/gui/tray/usermodel.cpp index 782de47a1..566d93cd0 100644 --- a/src/gui/tray/usermodel.cpp +++ b/src/gui/tray/usermodel.cpp @@ -905,7 +905,7 @@ Q_INVOKABLE int UserModel::currentUserId() const return _currentUserId; } -Q_INVOKABLE bool UserModel::isUserConnected(const int &id) +Q_INVOKABLE bool UserModel::isUserConnected(const int id) { if (id < 0 || id >= _users.size()) return false; @@ -913,7 +913,7 @@ Q_INVOKABLE bool UserModel::isUserConnected(const int &id) return _users[id]->isConnected(); } -QImage UserModel::avatarById(const int &id) +QImage UserModel::avatarById(const int id) { if (id < 0 || id >= _users.size()) return {}; @@ -1014,7 +1014,7 @@ Q_INVOKABLE void UserModel::openCurrentAccountServer() QDesktopServices::openUrl(url); } -Q_INVOKABLE void UserModel::switchCurrentUser(const int &id) +Q_INVOKABLE void UserModel::switchCurrentUser(const int id) { if (_currentUserId < 0 || _currentUserId >= _users.size()) return; @@ -1025,7 +1025,7 @@ Q_INVOKABLE void UserModel::switchCurrentUser(const int &id) emit newUserSelected(); } -Q_INVOKABLE void UserModel::login(const int &id) +Q_INVOKABLE void UserModel::login(const int id) { if (id < 0 || id >= _users.size()) return; @@ -1033,7 +1033,7 @@ Q_INVOKABLE void UserModel::login(const int &id) _users[id]->login(); } -Q_INVOKABLE void UserModel::logout(const int &id) +Q_INVOKABLE void UserModel::logout(const int id) { if (id < 0 || id >= _users.size()) return; @@ -1041,7 +1041,7 @@ Q_INVOKABLE void UserModel::logout(const int &id) _users[id]->logout(); } -Q_INVOKABLE void UserModel::removeAccount(const int &id) +Q_INVOKABLE void UserModel::removeAccount(const int id) { if (id < 0 || id >= _users.size()) return; diff --git a/src/gui/tray/usermodel.h b/src/gui/tray/usermodel.h index afe7fe6d4..28a7eb9ac 100644 --- a/src/gui/tray/usermodel.h +++ b/src/gui/tray/usermodel.h @@ -160,7 +160,7 @@ public: QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; - QImage avatarById(const int &id); + QImage avatarById(const int id); User *currentUser() const; @@ -173,11 +173,11 @@ public: Q_INVOKABLE int numUsers(); Q_INVOKABLE QString currentUserServer(); int currentUserId() const; - Q_INVOKABLE bool isUserConnected(const int &id); - Q_INVOKABLE void switchCurrentUser(const int &id); - Q_INVOKABLE void login(const int &id); - Q_INVOKABLE void logout(const int &id); - Q_INVOKABLE void removeAccount(const int &id); + Q_INVOKABLE bool isUserConnected(const int id); + Q_INVOKABLE void switchCurrentUser(const int id); + Q_INVOKABLE void login(const int id); + Q_INVOKABLE void logout(const int id); + Q_INVOKABLE void removeAccount(const int id); Q_INVOKABLE std::shared_ptr userStatusConnector(int id);