feat: add easy to use get function for chat channels

This commit is contained in:
Jonathan Rainville 2020-05-19 16:12:05 -04:00 committed by Iuri Matias
parent e2bf81a281
commit 26d7cacaea
1 changed files with 5 additions and 0 deletions

View File

@ -35,6 +35,11 @@ QtObject:
self.names.add(chatId)
self.endInsertRows()
proc get*(self: ChatsView, index: int): string {.slot.} =
if index < 0 or index >= self.names.len:
return
return self.names[index]
method rowCount(self: ChatsView, index: QModelIndex = nil): int =
return self.names.len