X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatscene.cpp;h=8a5f7d4c72b300c7d607c910a99ac93b866c64ca;hp=2f1474283fb565a8731a5c1d558f1b8d15514264;hb=b664a5a142f458b8d6b3ccc846df3c0676beb3aa;hpb=d3f99ef6bfc13599dcbddc2f84d29351b7a07d87 diff --git a/src/qtui/chatscene.cpp b/src/qtui/chatscene.cpp index 2f147428..8a5f7d4c 100644 --- a/src/qtui/chatscene.cpp +++ b/src/qtui/chatscene.cpp @@ -1026,9 +1026,18 @@ QString ChatScene::selection() const for (int l = start; l <= end; l++) { if (_selectionMinCol == ChatLineModel::TimestampColumn) result += _lines[l]->item(ChatLineModel::TimestampColumn)->data(MessageModel::DisplayRole).toString() + " "; - if (_selectionMinCol <= ChatLineModel::SenderColumn) - result += _lines[l]->item(ChatLineModel::SenderColumn)->data(MessageModel::DisplayRole).toString() + " "; - result += _lines[l]->item(ChatLineModel::ContentsColumn)->data(MessageModel::DisplayRole).toString() + "\n"; + if (_selectionMinCol <= ChatLineModel::SenderColumn) { + ChatItem *item = _lines[l]->item(ChatLineModel::SenderColumn); + if (item->chatLine()->msgType() == Message::Plain) { + // Copying to plain-text, re-add the sender brackets + result += QString("<%1> ").arg(item->data(MessageModel::DisplayRole) + .toString()); + } else { + result += item->data(MessageModel::DisplayRole).toString() + " "; + } + } + result += _lines[l]->item(ChatLineModel::ContentsColumn) + ->data(MessageModel::DisplayRole).toString() + "\n"; } return result; }