X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fdebuglogdlg.cpp;h=e535640307203f0e1bd1268e6ce0a0dd4b40c776;hp=fc701d9df7a2cca1b3148845bc6232e002c2417c;hb=HEAD;hpb=fcacaaf16551524c7ebb6114254d005274cc3d63 diff --git a/src/qtui/debuglogdlg.cpp b/src/qtui/debuglogdlg.cpp index fc701d9d..ed064856 100644 --- a/src/qtui/debuglogdlg.cpp +++ b/src/qtui/debuglogdlg.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2018 by the Quassel Project * + * Copyright (C) 2005-2022 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -22,7 +22,7 @@ #include "quassel.h" -DebugLogDlg::DebugLogDlg(QWidget *parent) +DebugLogDlg::DebugLogDlg(QWidget* parent) : QDialog(parent) { ui.setupUi(this); @@ -33,21 +33,18 @@ DebugLogDlg::DebugLogDlg(QWidget *parent) connect(Quassel::instance()->logger(), &Logger::messageLogged, this, &DebugLogDlg::logUpdated); QString content; - for (auto &&message : Quassel::instance()->logger()->messages()) { + for (auto&& message : Quassel::instance()->logger()->messages()) { content += toString(message); } ui.textEdit->setPlainText(content); - } - -QString DebugLogDlg::toString(const Logger::LogEntry &msg) +QString DebugLogDlg::toString(const Logger::LogEntry& msg) { - return msg.timeStamp.toString("yyyy-MM-dd hh:mm:ss ") + msg.message + "\n"; + return msg.toString() + "\n"; } - -void DebugLogDlg::logUpdated(const Logger::LogEntry &msg) +void DebugLogDlg::logUpdated(const Logger::LogEntry& msg) { ui.textEdit->moveCursor(QTextCursor::End); ui.textEdit->insertPlainText(toString(msg));