/***************************************************************************
- * 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 *
#include "quassel.h"
-DebugLogDlg::DebugLogDlg(QWidget *parent)
+DebugLogDlg::DebugLogDlg(QWidget* parent)
: QDialog(parent)
{
ui.setupUi(this);
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));