Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Cambra <claudio.cambra@gmail.com>2022-07-08 18:44:50 +0300
committerMatthieu Gallien <matthieu_gallien@yahoo.fr>2022-07-15 16:01:48 +0300
commit6872e1a75b15a9fe1d4a00b76c131b8705275ac0 (patch)
tree64118d2e4ab68f8bc3e0aa82482563a838847f27
parentf4744eb682787e74aa4c233fde734f90430ad68b (diff)
Take ints by value rather than reference in UserModel methods
Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
-rw-r--r--src/gui/tray/usermodel.cpp12
-rw-r--r--src/gui/tray/usermodel.h12
2 files changed, 12 insertions, 12 deletions
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<OCC::UserStatusConnector> userStatusConnector(int id);