modernize: Replace most remaining old-style connects by PMF ones
[quassel.git] / src / qtui / settingspages / chatmonitorsettingspage.cpp
index e6f0435..bf546b1 100644 (file)
@@ -60,12 +60,12 @@ ChatMonitorSettingsPage::ChatMonitorSettingsPage(QWidget *parent)
     ui.operationMode->addItem(tr("Opt Out"), ChatViewSettings::OptOut);
 
     // connect slots
-    connect(ui.operationMode, SIGNAL(currentIndexChanged(int)), SLOT(switchOperationMode(int)));
-    connect(ui.showHighlights, SIGNAL(toggled(bool)), SLOT(widgetHasChanged()));
-    connect(ui.showOwnMessages, SIGNAL(toggled(bool)), SLOT(widgetHasChanged()));
-    connect(ui.alwaysOwn, SIGNAL(toggled(bool)), SLOT(widgetHasChanged()));
-    connect(ui.showBacklog, SIGNAL(toggled(bool)), SLOT(widgetHasChanged()));
-    connect(ui.includeRead, SIGNAL(toggled(bool)), SLOT(widgetHasChanged()));
+    connect(ui.operationMode, selectOverload<int>(&QComboBox::currentIndexChanged), this, &ChatMonitorSettingsPage::switchOperationMode);
+    connect(ui.showHighlights, &QAbstractButton::toggled, this, &ChatMonitorSettingsPage::widgetHasChanged);
+    connect(ui.showOwnMessages, &QAbstractButton::toggled, this, &ChatMonitorSettingsPage::widgetHasChanged);
+    connect(ui.alwaysOwn, &QAbstractButton::toggled, this, &ChatMonitorSettingsPage::widgetHasChanged);
+    connect(ui.showBacklog, &QAbstractButton::toggled, this, &ChatMonitorSettingsPage::widgetHasChanged);
+    connect(ui.includeRead, &QAbstractButton::toggled, this, &ChatMonitorSettingsPage::widgetHasChanged);
 }
 
 
@@ -238,8 +238,8 @@ void ChatMonitorSettingsPage::toggleBuffers(BufferView *inView, BufferViewConfig
       This can probably be removed whenever BufferViewConfig::bulkAdd or something
       like that is available.
     */
-    qobject_cast<BufferViewFilter *>(outView->model())->setConfig(0);
-    qobject_cast<BufferViewFilter *>(inView->model())->setConfig(0);
+    qobject_cast<BufferViewFilter *>(outView->model())->setConfig(nullptr);
+    qobject_cast<BufferViewFilter *>(inView->model())->setConfig(nullptr);
 
     // actually move the ids
     foreach(QList<BufferId> list, selectedBuffers) {
@@ -280,7 +280,7 @@ void ChatMonitorSettingsPage::on_deactivateBuffer_clicked()
 */
 void ChatMonitorSettingsPage::switchOperationMode(int idx)
 {
-    ChatViewSettings::OperationMode mode = (ChatViewSettings::OperationMode)(idx + 1);
+    auto mode = (ChatViewSettings::OperationMode)(idx + 1);
     if (mode == ChatViewSettings::OptIn) {
         ui.labelActiveBuffers->setText(tr("Show:"));
     }