From 788d57c815c30ed51d8e4768767271ed3066a642 Mon Sep 17 00:00:00 2001 From: krepa098 Date: Wed, 11 Feb 2015 16:37:02 +0100 Subject: [PATCH] copy/paste changed format (issue #11) --- src/chatlog/chatlog.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/chatlog/chatlog.cpp b/src/chatlog/chatlog.cpp index 460da96fc..f4b6e4af8 100644 --- a/src/chatlog/chatlog.cpp +++ b/src/chatlog/chatlog.cpp @@ -496,22 +496,16 @@ QString ChatLog::getSelectedText() const // build a nicely formatted message QString out; - QString lastSender; for(int i=selFirstRow; i<=selLastRow; ++i) { if(lines[i]->content[1]->getText().isEmpty()) continue; - if(lastSender != lines[i]->content[0]->getText() && !lines[i]->content[0]->getText().isEmpty()) - { - //author changed - QString timestamp = lines[i]->content[2]->getText().isEmpty() ? tr("pending") : lines[i]->content[2]->getText(); - QString msg = lines[i]->content[0]->getText(); - out += QString(out.isEmpty() ? "[%2] %1:\n" : "\n[%2] %1:\n").arg(msg, timestamp); - lastSender = lines[i]->content[0]->getText(); - } + QString timestamp = lines[i]->content[2]->getText().isEmpty() ? tr("pending") : lines[i]->content[2]->getText(); + QString author = lines[i]->content[0]->getText(); + QString msg = lines[i]->content[1]->getText(); - out += lines[i]->content[1]->getText(); + out += QString(out.isEmpty() ? "[%2] %1:\n%3" : "\n[%2] %1:\n%3").arg(author, timestamp, msg); if(i != selLastRow) out += "\n";