Browse Source

fix(ui): provide context when emitting friendWidgetRenamed()

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.
reviewable/pr5499/r1
Teemu Ikonen 7 years ago
parent
commit
0b6d6d7715
  1. 2
      src/widget/friendwidget.cpp

2
src/widget/friendwidget.cpp

@ -71,7 +71,7 @@ FriendWidget::FriendWidget(std::shared_ptr<FriendChatroom> chatroom, bool compac @@ -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);
}

Loading…
Cancel
Save