clazy: Convert many old-style connects into function pointer based
[quassel.git] / src / qtui / chatmonitorview.cpp
index 37197ed..71c975b 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2014 by the Quassel Project                        *
+ *   Copyright (C) 2005-2018 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
 #include "chatmonitorview.h"
 
 #include <QAction>
-#include <QIcon>
 #include <QMenu>
 #include <QContextMenuEvent>
 
+#include "buffermodel.h"
 #include "chatmonitorfilter.h"
 #include "chatlinemodel.h"
 #include "chatitem.h"
 #include "chatscene.h"
 #include "client.h"
+#include "clientignorelistmanager.h"
+#include "icon.h"
 #include "networkmodel.h"
-#include "buffermodel.h"
 #include "messagemodel.h"
 #include "qtuisettings.h"
 #include "settingspagedlg.h"
 #include "settingspages/chatmonitorsettingspage.h"
-#include "clientignorelistmanager.h"
 
 ChatMonitorView::ChatMonitorView(ChatMonitorFilter *filter, QWidget *parent)
     : ChatView(filter, parent),
     _filter(filter)
 {
     scene()->setSenderCutoffMode(ChatScene::CutoffLeft);
-    connect(Client::instance(), SIGNAL(coreConnectionStateChanged(bool)), this, SLOT(coreConnectionStateChanged(bool)));
+    // The normal message prefixes get replaced by the network and buffer name.  Re-add brackets for
+    // all message types.
+    scene()->setAlwaysBracketSender(true);
+    connect(Client::instance(), &Client::coreConnectionStateChanged, this, &ChatMonitorView::coreConnectionStateChanged);
 }
 
 
@@ -70,7 +73,7 @@ void ChatMonitorView::addActionsToMenu(QMenu *menu, const QPointF &pos)
     }
 
     menu->addSeparator();
-    menu->addAction(QIcon::fromTheme("configure"), tr("Configure..."), this, SLOT(showSettingsPage()));
+    menu->addAction(icon::get("configure"), tr("Configure..."), this, SLOT(showSettingsPage()));
 }
 
 
@@ -98,7 +101,7 @@ void ChatMonitorView::mouseDoubleClickEvent(QMouseEvent *event)
 
 void ChatMonitorView::showFieldsChanged(bool checked)
 {
-    QAction *showAction = qobject_cast<QAction *>(sender());
+    auto *showAction = qobject_cast<QAction *>(sender());
     if (!showAction)
         return;