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

Commit

Permalink
fix(ui): don't duplicate group peer name in tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonybilinski committed May 15, 2019
1 parent b7bd7c6 commit 87a53fa
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/widget/form/groupchatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,14 @@ void GroupChatForm::updateUserNames()
* and then sort them by their text and add them to the layout in that order */
const auto selfPk = Core::getInstance()->getSelfPublicKey();
for (const auto& peerPk : peers.keys()) {
const QString fullName = FriendList::decideNickname(peerPk, peers.value(peerPk));
const QString editedName = editName(fullName).append(QLatin1String(", "));
QLabel* const label = new QLabel(editedName);
if (editedName != fullName) {
label->setToolTip(fullName + " (" + peerPk.toString() + ")");
}
const QString peerName = peers.value(peerPk);
const QString editedName = editName(peerName);
QLabel* const label = new QLabel(editedName + QLatin1String(", "));
if (editedName != peerName) {
label->setToolTip(peerName + " (" + peerPk.toString() + ")");
} else if (peerName != peerPk.toString()) {
label->setToolTip(peerPk.toString());
} // else their name is just their Pk, no tooltip needed
label->setTextFormat(Qt::PlainText);
label->setContextMenuPolicy(Qt::CustomContextMenu);

Expand Down

0 comments on commit 87a53fa

Please sign in to comment.