Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
fix(ui): provide context when emitting friendWidgetRenamed()
Browse files Browse the repository at this point in the history
Qt5 documentation at http://doc.qt.io/qt-5/signalsandslots.html
explains:

"[...] we provide /this/ as context in the call to connect(). The
context object provides information about in which thread the receiver
should be executed. This is important, as providing the context ensures
that the receiver is executed in the context thread."

Fixes #5495.
  • Loading branch information
tpikonen committed Jan 16, 2019
1 parent 55ef1e0 commit 0b6d6d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/widget/friendwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ FriendWidget::FriendWidget(std::shared_ptr<FriendChatroom> chatroom, bool compac
connect(nameLabel, &CroppingLabel::editFinished, frnd, &Friend::setAlias);
// update on changes of the displayed name
connect(frnd, &Friend::displayedNameChanged, nameLabel, &CroppingLabel::setText);
connect(frnd, &Friend::displayedNameChanged, [this](const QString /* &newName */){emit friendWidgetRenamed(this);});
connect(frnd, &Friend::displayedNameChanged, this, [this](const QString /* &newName */){emit friendWidgetRenamed(this);});
connect(chatroom.get(), &FriendChatroom::activeChanged, this, &FriendWidget::setActive);
statusMessageLabel->setTextFormat(Qt::PlainText);
}
Expand Down

0 comments on commit 0b6d6d7

Please sign in to comment.