mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
parent
b071021351
commit
8198940607
|
@ -1840,7 +1840,12 @@ void Widget::onGroupPeerAudioPlaying(int groupnumber, int peernumber)
|
||||||
void Widget::removeGroup(Group* g, bool fake)
|
void Widget::removeGroup(Group* g, bool fake)
|
||||||
{
|
{
|
||||||
auto groupId = g->getId();
|
auto groupId = g->getId();
|
||||||
auto widget = groupWidgets[groupId];
|
auto groupWidgetIt = groupWidgets.find(groupId);
|
||||||
|
if (groupWidgetIt == groupWidgets.end()) {
|
||||||
|
qWarning() << "Tried to remove group" << groupId << "but GroupWidget doesn't exist";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
auto widget = groupWidgetIt.value();
|
||||||
widget->setAsInactiveChatroom();
|
widget->setAsInactiveChatroom();
|
||||||
if (static_cast<GenericChatroomWidget*>(widget) == activeChatroomWidget) {
|
if (static_cast<GenericChatroomWidget*>(widget) == activeChatroomWidget) {
|
||||||
activeChatroomWidget = nullptr;
|
activeChatroomWidget = nullptr;
|
||||||
|
@ -1854,15 +1859,16 @@ void Widget::removeGroup(Group* g, bool fake)
|
||||||
}
|
}
|
||||||
|
|
||||||
Nexus::getCore()->removeGroup(groupId, fake);
|
Nexus::getCore()->removeGroup(groupId, fake);
|
||||||
contactListWidget->removeGroupWidget(widget);
|
contactListWidget->removeGroupWidget(widget); // deletes widget
|
||||||
|
|
||||||
groupWidgets.remove(groupId);
|
groupWidgets.remove(groupId);
|
||||||
delete widget;
|
auto groupChatFormIt = groupChatForms.find(groupId);
|
||||||
|
if (groupChatFormIt == groupChatForms.end()) {
|
||||||
auto chatForm = groupChatForms[groupId];
|
qWarning() << "Tried to remove group" << groupId << "but GroupChatForm doesn't exist";
|
||||||
groupChatForms.remove(groupId);
|
return;
|
||||||
delete chatForm;
|
}
|
||||||
|
groupChatForms.erase(groupChatFormIt);
|
||||||
|
delete groupChatFormIt.value();
|
||||||
delete g;
|
delete g;
|
||||||
if (contentLayout && contentLayout->mainHead->layout()->isEmpty()) {
|
if (contentLayout && contentLayout->mainHead->layout()->isEmpty()) {
|
||||||
onAddClicked();
|
onAddClicked();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user