modernize: Require member function pointers for Settings::notify()
[quassel.git] / src / qtui / chatmonitorfilter.cpp
index c1dcf13..1229fd4 100644 (file)
@@ -31,8 +31,7 @@ ChatMonitorFilter::ChatMonitorFilter(MessageModel *model, QObject *parent)
 {
     // Global configuration
     ChatViewSettings defaultSettings;
-    _showSenderBrackets = defaultSettings.showSenderBrackets();
-    defaultSettings.notify("ShowSenderBrackets", this, SLOT(showSenderBracketsSettingChanged(const QVariant &)));
+    defaultSettings.initAndNotify("ShowSenderBrackets", this, &ChatMonitorFilter::showSenderBracketsSettingChanged);
 
     // NOTE: Whenever changing defaults here, also update ChatMonitorSettingsPage::loadSettings()
     // and ChatMonitorSettingsPage::defaults() to match
@@ -41,8 +40,8 @@ ChatMonitorFilter::ChatMonitorFilter(MessageModel *model, QObject *parent)
     ChatViewSettings viewSettings(ChatMonitorFilter::idString());
     _showFields = viewSettings.value("ShowFields", AllFields).toInt();
     _showOwnMessages = viewSettings.value("ShowOwnMsgs", true).toBool();
-    viewSettings.notify("ShowFields", this, SLOT(showFieldsSettingChanged(const QVariant &)));
-    viewSettings.notify("ShowOwnMsgs", this, SLOT(showOwnMessagesSettingChanged(const QVariant &)));
+    viewSettings.notify("ShowFields", this, &ChatMonitorFilter::showFieldsSettingChanged);
+    viewSettings.notify("ShowOwnMsgs", this, &ChatMonitorFilter::showOwnMessagesSettingChanged);
 
     // ChatMonitorSettingsPage
     QString showHighlightsSettingsId = "ShowHighlights";
@@ -53,21 +52,20 @@ ChatMonitorFilter::ChatMonitorFilter(MessageModel *model, QObject *parent)
     QString alwaysOwnSettingsId = "AlwaysOwn";
 
     _showHighlights = viewSettings.value(showHighlightsSettingsId, false).toBool();
-    _operationMode =
-            viewSettings.value(operationModeSettingsId, ChatViewSettings::InvalidMode).toInt();
+    _operationMode = viewSettings.value(operationModeSettingsId, ChatViewSettings::InvalidMode).toInt();
     // read configured list of buffers to monitor/ignore
     foreach(QVariant v, viewSettings.value(buffersSettingsId, QVariant()).toList())
-    _bufferIds << v.value<BufferId>();
+        _bufferIds << v.value<BufferId>();
     _showBacklog = viewSettings.value(showBacklogSettingsId, true).toBool();
     _includeRead = viewSettings.value(includeReadSettingsId, false).toBool();
     _alwaysOwn = viewSettings.value(alwaysOwnSettingsId, false).toBool();
 
-    viewSettings.notify(showHighlightsSettingsId, this, SLOT(showHighlightsSettingChanged(const QVariant &)));
-    viewSettings.notify(operationModeSettingsId, this, SLOT(operationModeSettingChanged(const QVariant &)));
-    viewSettings.notify(buffersSettingsId, this, SLOT(buffersSettingChanged(const QVariant &)));
-    viewSettings.notify(showBacklogSettingsId, this, SLOT(showBacklogSettingChanged(const QVariant &)));
-    viewSettings.notify(includeReadSettingsId, this, SLOT(includeReadSettingChanged(const QVariant &)));
-    viewSettings.notify(alwaysOwnSettingsId, this, SLOT(alwaysOwnSettingChanged(const QVariant &)));
+    viewSettings.notify(showHighlightsSettingsId, this, &ChatMonitorFilter::showHighlightsSettingChanged);
+    viewSettings.notify(operationModeSettingsId, this, &ChatMonitorFilter::operationModeSettingChanged);
+    viewSettings.notify(buffersSettingsId, this, &ChatMonitorFilter::buffersSettingChanged);
+    viewSettings.notify(showBacklogSettingsId, this, &ChatMonitorFilter::showBacklogSettingChanged);
+    viewSettings.notify(includeReadSettingsId, this, &ChatMonitorFilter::includeReadSettingChanged);
+    viewSettings.notify(alwaysOwnSettingsId, this, &ChatMonitorFilter::alwaysOwnSettingChanged);
 }