common: Make SyncableObject non-copyable
[quassel.git] / src / qtui / debuglogdlg.cpp
index bebe26b..176a968 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2018 by the Quassel Project                        *
+ *   Copyright (C) 2005-2020 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(QWidgetparent)
     : 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));