mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
fix(chatform): crash after opening chat in new window
This commit is contained in:
parent
174d6ef8ca
commit
59a59fdc09
|
@ -155,7 +155,7 @@ FriendWidget* ContentDialog::addFriend(std::shared_ptr<FriendChatroom> chatroom,
|
||||||
{
|
{
|
||||||
const auto compact = Settings::getInstance().getCompactLayout();
|
const auto compact = Settings::getInstance().getCompactLayout();
|
||||||
auto frnd = chatroom->getFriend();
|
auto frnd = chatroom->getFriend();
|
||||||
auto friendPk = frnd->getPublicKey();
|
const auto& friendPk = frnd->getPublicKey();
|
||||||
auto friendWidget = new FriendWidget(chatroom, compact);
|
auto friendWidget = new FriendWidget(chatroom, compact);
|
||||||
emit connectFriendWidget(*friendWidget);
|
emit connectFriendWidget(*friendWidget);
|
||||||
contactWidgets[friendPk] = friendWidget;
|
contactWidgets[friendPk] = friendWidget;
|
||||||
|
@ -176,7 +176,7 @@ FriendWidget* ContentDialog::addFriend(std::shared_ptr<FriendChatroom> chatroom,
|
||||||
GroupWidget* ContentDialog::addGroup(std::shared_ptr<GroupChatroom> chatroom, GenericChatForm* form)
|
GroupWidget* ContentDialog::addGroup(std::shared_ptr<GroupChatroom> chatroom, GenericChatForm* form)
|
||||||
{
|
{
|
||||||
const auto g = chatroom->getGroup();
|
const auto g = chatroom->getGroup();
|
||||||
const auto groupId = g->getPersistentId();
|
const auto& groupId = g->getPersistentId();
|
||||||
const auto compact = Settings::getInstance().getCompactLayout();
|
const auto compact = Settings::getInstance().getCompactLayout();
|
||||||
auto groupWidget = new GroupWidget(chatroom, compact);
|
auto groupWidget = new GroupWidget(chatroom, compact);
|
||||||
contactWidgets[groupId] = groupWidget;
|
contactWidgets[groupId] = groupWidget;
|
||||||
|
|
|
@ -63,7 +63,7 @@ FriendWidget* ContentDialogManager::addFriendToDialog(ContentDialog* dialog,
|
||||||
GenericChatForm* form)
|
GenericChatForm* form)
|
||||||
{
|
{
|
||||||
auto friendWidget = dialog->addFriend(chatroom, form);
|
auto friendWidget = dialog->addFriend(chatroom, form);
|
||||||
const auto friendPk = friendWidget->getFriend()->getPublicKey();
|
const auto& friendPk = friendWidget->getFriend()->getPublicKey();
|
||||||
|
|
||||||
ContentDialog* lastDialog = getFriendDialog(friendPk);
|
ContentDialog* lastDialog = getFriendDialog(friendPk);
|
||||||
if (lastDialog) {
|
if (lastDialog) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user