Added "Show all chats" switch to the Debug page

This commit is contained in:
Slava Monich 2020-12-16 15:51:06 +02:00
parent 72582c26f4
commit 25efbb8bc2
2 changed files with 12 additions and 5 deletions

View file

@ -44,15 +44,22 @@ Page {
} }
SectionHeader { SectionHeader {
text: "Join chat by id" text: "Chats"
}
TextSwitch {
checked: chatListModel.showAllChats
text: "Show all chats"
description: "Including the ones referenced by the chats you have joined."
automaticCheck: false
onClicked: chatListModel.showAllChats = !chatListModel.showAllChats
} }
Row { Row {
x: Theme.horizontalPageMargin
TextField { TextField {
id: chatId id: chatId
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
width: column.width - joinButton.width - Theme.horizontalPageMargin - Theme.paddingLarge width: column.width - joinButton.width - Theme.horizontalPageMargin
placeholderText: "Chat id" placeholderText: "Chat id"
labelVisible: false labelVisible: false
EnterKey.iconSource: "image://theme/icon-m-enter-accept" EnterKey.iconSource: "image://theme/icon-m-enter-accept"
@ -61,7 +68,7 @@ Page {
} }
Button { Button {
id: joinButton id: joinButton
text: "Join" text: "Join by id"
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
enabled: chatId.text.length > 0 enabled: chatId.text.length > 0
onClicked: tdLibWrapper.joinChat(chatId.text) onClicked: tdLibWrapper.joinChat(chatId.text)

View file

@ -495,7 +495,7 @@ void ChatListModel::addVisibleChat(ChatData *chat)
void ChatListModel::updateChatVisibility(const TDLibWrapper::Group *group) void ChatListModel::updateChatVisibility(const TDLibWrapper::Group *group)
{ {
LOG("Updating chat visibility" << group->groupId); LOG("Updating chat visibility" << (group ? qPrintable(QString::number(group->groupId)) : ""));
// See if any group has been removed from from view // See if any group has been removed from from view
for (int i = 0; i < chatList.size(); i++) { for (int i = 0; i < chatList.size(); i++) {
ChatData *chat = chatList.at(i); ChatData *chat = chatList.at(i);