X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fdebuglogdlg.cpp;h=e535640307203f0e1bd1268e6ce0a0dd4b40c776;hb=13425536062e5cf1b2d9f0ef258f3eb9dab1923c;hp=bebe26b9cef6f1fce090bbcca5048dc8ce2cfd61;hpb=d438145b28f34b7fdbc7e290aa001e5f3f922207;p=quassel.git diff --git a/src/qtui/debuglogdlg.cpp b/src/qtui/debuglogdlg.cpp index bebe26b9..e5356403 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-2019 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); @@ -30,24 +30,21 @@ DebugLogDlg::DebugLogDlg(QWidget *parent) ui.textEdit->setReadOnly(true); - connect(Quassel::instance()->logger(), SIGNAL(messageLogged(Logger::LogEntry)), SLOT(logUpdated(Logger::LogEntry))); + 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));