mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Generalized connection check, now working for every user in account menu
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
This commit is contained in:
parent
578a3b4ef4
commit
bc8f64bb98
@ -105,9 +105,9 @@ MenuItem {
|
||||
}
|
||||
|
||||
MenuItem {
|
||||
text: userModelBackend.isCurrentUserConnected() ? "Log out" : "Log in"
|
||||
text: userModelBackend.isUserConnected(index) ? "Log out" : "Log in"
|
||||
onClicked: {
|
||||
userModelBackend.isCurrentUserConnected() ? userModelBackend.logout(index) : userModelBackend.logout(index)
|
||||
userModelBackend.isUserConnected(index) ? userModelBackend.logout(index) : userModelBackend.logout(index)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -163,9 +163,9 @@ Q_INVOKABLE int UserModel::numUsers()
|
||||
return _users.size();
|
||||
}
|
||||
|
||||
Q_INVOKABLE bool UserModel::isCurrentUserConnected()
|
||||
Q_INVOKABLE bool UserModel::isUserConnected(const int &id)
|
||||
{
|
||||
return _users[_currentUserId].isConnected();
|
||||
return _users[id].isConnected();
|
||||
}
|
||||
|
||||
Q_INVOKABLE QImage UserModel::currentUserAvatar()
|
||||
|
||||
@ -62,11 +62,11 @@ public:
|
||||
Q_INVOKABLE void openCurrentAccountServer();
|
||||
Q_INVOKABLE QImage currentUserAvatar();
|
||||
Q_INVOKABLE int numUsers();
|
||||
Q_INVOKABLE bool isCurrentUserConnected();
|
||||
Q_INVOKABLE QString currentUserName();
|
||||
Q_INVOKABLE QString currentUserServer();
|
||||
Q_INVOKABLE bool currentUserHasActivities();
|
||||
Q_INVOKABLE bool currentServerHasTalk();
|
||||
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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user