fix: code review
This commit is contained in:
parent
78e8e6be93
commit
e38f1b0268
|
@ -28,8 +28,6 @@ QtObject:
|
||||||
self.members = members
|
self.members = members
|
||||||
self.endResetModel()
|
self.endResetModel()
|
||||||
|
|
||||||
proc len*(self: ChatMembersView): int {.slot.} = self.members.len
|
|
||||||
|
|
||||||
method rowCount(self: ChatMembersView, index: QModelIndex = nil): int = self.members.len
|
method rowCount(self: ChatMembersView, index: QModelIndex = nil): int = self.members.len
|
||||||
|
|
||||||
method data(self: ChatMembersView, index: QModelIndex, role: int): QVariant =
|
method data(self: ChatMembersView, index: QModelIndex, role: int): QVariant =
|
||||||
|
|
|
@ -49,7 +49,7 @@ Rectangle {
|
||||||
case Constants.chatTypePublic: return qsTr("Public chat")
|
case Constants.chatTypePublic: return qsTr("Public chat")
|
||||||
case Constants.chatTypeOneToOne: return qsTr("TODO: Contact/Not a contact")
|
case Constants.chatTypeOneToOne: return qsTr("TODO: Contact/Not a contact")
|
||||||
case Constants.chatTypePrivateGroupChat:
|
case Constants.chatTypePrivateGroupChat:
|
||||||
let cnt = chatsModel.activeChannel.members.len();
|
let cnt = chatsModel.activeChannel.members.rowCount();
|
||||||
if(cnt > 1) return qsTr("%1 members").arg(cnt);
|
if(cnt > 1) return qsTr("%1 members").arg(cnt);
|
||||||
return qsTr("1 member");
|
return qsTr("1 member");
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ ModalPopup {
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
text: {
|
text: {
|
||||||
let cnt = chatsModel.activeChannel.members.len();
|
let cnt = chatsModel.activeChannel.members.rowCount();
|
||||||
if(cnt > 1) return qsTr("%1 members").arg(cnt);
|
if(cnt > 1) return qsTr("%1 members").arg(cnt);
|
||||||
return qsTr("1 member");
|
return qsTr("1 member");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue