mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
refactor(widget): Extract friendId in variable
This commit is contained in:
parent
a1c7bb3c43
commit
775d9987a3
|
@ -1456,7 +1456,8 @@ void Widget::removeFriend(Friend* f, bool fake)
|
|||
}
|
||||
}
|
||||
|
||||
FriendWidget* widget = friendWidgets[f->getId()];
|
||||
const uint32_t friendId = f->getId();
|
||||
FriendWidget* widget = friendWidgets[friendId];
|
||||
widget->setAsInactiveChatroom();
|
||||
if (widget == activeChatroomWidget) {
|
||||
activeChatroomWidget = nullptr;
|
||||
|
@ -1465,16 +1466,16 @@ void Widget::removeFriend(Friend* f, bool fake)
|
|||
|
||||
contactListWidget->removeFriendWidget(widget);
|
||||
|
||||
ContentDialog* lastDialog = ContentDialog::getFriendDialog(f->getId());
|
||||
ContentDialog* lastDialog = ContentDialog::getFriendDialog(friendId);
|
||||
|
||||
if (lastDialog != nullptr) {
|
||||
lastDialog->removeFriend(f->getId());
|
||||
lastDialog->removeFriend(friendId);
|
||||
}
|
||||
|
||||
FriendList::removeFriend(f->getId(), fake);
|
||||
Nexus::getCore()->removeFriend(f->getId(), fake);
|
||||
FriendList::removeFriend(friendId, fake);
|
||||
Nexus::getCore()->removeFriend(friendId, fake);
|
||||
|
||||
friendWidgets.remove(f->getId());
|
||||
friendWidgets.remove(friendId);
|
||||
delete widget;
|
||||
delete f;
|
||||
if (contentLayout && contentLayout->mainHead->layout()->isEmpty()) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user