mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
changed output of ChatLog::toPlainText
This commit is contained in:
parent
27e967b67e
commit
bc97948be7
|
@ -445,19 +445,10 @@ QString ChatLog::getSelectedText() const
|
|||
QString ChatLog::toPlainText() const
|
||||
{
|
||||
QString out;
|
||||
QString lastSender;
|
||||
|
||||
for(ChatLine::Ptr l : lines)
|
||||
{
|
||||
if(lastSender != l->content[0]->getText() && !l->content[0]->getText().isEmpty())
|
||||
{
|
||||
//author changed
|
||||
out += l->content[0]->getText() + ":\n";
|
||||
lastSender = l->content[0]->getText();
|
||||
}
|
||||
|
||||
out += l->content[1]->getText();
|
||||
out += "\n\n";
|
||||
out += QString("|%1 @%2|\n%3\n\n").arg(l->getContent(0)->getText(),l->getContent(2)->getText(),l->getContent(1)->getText());
|
||||
}
|
||||
|
||||
return out;
|
||||
|
|
|
@ -52,6 +52,9 @@ void Text::setText(const QString& txt)
|
|||
text = txt;
|
||||
dirty = true;
|
||||
|
||||
if(rawText.isEmpty())
|
||||
rawText = txt;
|
||||
|
||||
ensureIntegrity();
|
||||
freeResources();
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ class CustomTextDocument;
|
|||
class Text : public ChatLineContent
|
||||
{
|
||||
public:
|
||||
Text(const QString& txt = "", QFont font = QFont(), bool enableElide = false, const QString& rawText = "");
|
||||
Text(const QString& txt = "", QFont font = QFont(), bool enableElide = false, const QString& rawText = QString());
|
||||
virtual ~Text();
|
||||
|
||||
void setText(const QString& txt);
|
||||
|
|
Loading…
Reference in New Issue
Block a user