mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 06:55:59 +03:00
Rename isDesktopNotificationsAllowed property to desktopNotificationsAllowed.
- User !== instead of !=. - Fix code style. Signed-off-by: Camila <hello@camila.codes>
This commit is contained in:
parent
820e97cd9b
commit
f7e9e31bc9
4 changed files with 10 additions and 9 deletions
|
@ -93,7 +93,7 @@ MenuItem {
|
|||
sourceSize.height: Style.accountAvatarStateIndicatorSize
|
||||
|
||||
Accessible.role: Accessible.Indicator
|
||||
Accessible.name: model.isDesktopNotificationsAllowed ? qsTr("Current user status is online") : qsTr("Current user status is do not disturb")
|
||||
Accessible.name: model.desktopNotificationsAllowed ? qsTr("Current user status is online") : qsTr("Current user status is do not disturb")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -113,9 +113,9 @@ MenuItem {
|
|||
}
|
||||
Label {
|
||||
id: userStatusMessage
|
||||
visible: model.isConnected
|
||||
&& model.serverUserStatus
|
||||
&& statusMessage != ""
|
||||
visible: model.isConnected &&
|
||||
model.serverUserStatus &&
|
||||
statusMessage !== ""
|
||||
width: 128
|
||||
text: statusMessage
|
||||
elide: Text.ElideRight
|
||||
|
|
|
@ -57,7 +57,7 @@ User::User(AccountStatePtr &account, const bool &isCurrent, QObject *parent)
|
|||
connect(_account->account().data(), &Account::accountChangedAvatar, this, &User::avatarChanged);
|
||||
connect(_account.data(), &AccountState::statusChanged, this, &User::statusChanged);
|
||||
connect(_account.data(), &AccountState::desktopNotificationsAllowedChanged, this, &User::desktopNotificationsAllowedChanged);
|
||||
|
||||
|
||||
connect(_activityModel, &ActivityListModel::sendNotificationRequest, this, &User::slotSendNotificationRequest);
|
||||
}
|
||||
|
||||
|
@ -576,7 +576,8 @@ QUrl User::statusIcon() const
|
|||
return _account->statusIcon();
|
||||
}
|
||||
|
||||
bool User::serverHasUserStatus() const {
|
||||
bool User::serverHasUserStatus() const
|
||||
{
|
||||
return _account->account()->capabilities().userStatus();
|
||||
}
|
||||
|
||||
|
@ -918,7 +919,7 @@ QHash<int, QByteArray> UserModel::roleNames() const
|
|||
roles[ServerUserStatusRole] = "serverUserStatus";
|
||||
roles[StatusIconRole] = "statusIcon";
|
||||
roles[StatusMessageRole] = "statusMessage";
|
||||
roles[DesktopNotificationsAllowedRole] = "isDesktopNotificationsAllowed";
|
||||
roles[DesktopNotificationsAllowedRole] = "desktopNotificationsAllowed";
|
||||
roles[AvatarRole] = "avatar";
|
||||
roles[IsCurrentUserRole] = "isCurrentUser";
|
||||
roles[IsConnectedRole] = "isConnected";
|
||||
|
|
|
@ -24,7 +24,7 @@ class User : public QObject
|
|||
Q_PROPERTY(bool serverHasUserStatus READ serverHasUserStatus)
|
||||
Q_PROPERTY(QUrl statusIcon READ statusIcon NOTIFY statusChanged)
|
||||
Q_PROPERTY(QString statusMessage READ statusMessage NOTIFY statusChanged)
|
||||
Q_PROPERTY(QString isDesktopNotificationsAllowed READ isDesktopNotificationsAllowed NOTIFY desktopNotificationsAllowedChanged)
|
||||
Q_PROPERTY(QString desktopNotificationsAllowed READ isDesktopNotificationsAllowed NOTIFY desktopNotificationsAllowedChanged)
|
||||
Q_PROPERTY(bool hasLocalFolder READ hasLocalFolder NOTIFY hasLocalFolderChanged)
|
||||
Q_PROPERTY(bool serverHasTalk READ serverHasTalk NOTIFY serverHasTalkChanged)
|
||||
Q_PROPERTY(QString avatar READ avatarUrl NOTIFY avatarChanged)
|
||||
|
|
|
@ -381,7 +381,7 @@ Window {
|
|||
sourceSize.height: Style.accountAvatarStateIndicatorSize
|
||||
|
||||
Accessible.role: Accessible.Indicator
|
||||
Accessible.name: UserModel.isDesktopNotificationsAllowed ? qsTr("Current user status is online") : qsTr("Current user status is do not disturb")
|
||||
Accessible.name: UserModel.desktopNotificationsAllowed ? qsTr("Current user status is online") : qsTr("Current user status is do not disturb")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue