modernize: Require member function pointers for Settings::notify()
[quassel.git] / src / qtui / qtuistyle.cpp
index 7516c22..2920f70 100644 (file)
 QtUiStyle::QtUiStyle(QObject *parent) : UiStyle(parent)
 {
     ChatViewSettings s;
-    s.notify("UseCustomTimestampFormat", this, SLOT(updateUseCustomTimestampFormat()));
-    updateUseCustomTimestampFormat();
-    s.notify("TimestampFormat", this, SLOT(updateTimestampFormatString()));
-    updateTimestampFormatString();
-    s.notify("SenderPrefixMode", this, SLOT(updateSenderPrefixDisplay()));
-    updateSenderPrefixDisplay();
-    s.notify("ShowSenderBrackets", this, SLOT(updateShowSenderBrackets()));
-    updateShowSenderBrackets();
+    s.initAndNotify("UseCustomTimestampFormat", this, &QtUiStyle::updateUseCustomTimestampFormat);
+    s.initAndNotify("TimestampFormat", this, &QtUiStyle::updateTimestampFormatString);
+    s.initAndNotify("SenderPrefixMode", this, &QtUiStyle::updateSenderPrefixDisplay);
+    s.initAndNotify("ShowSenderBrackets", this, &QtUiStyle::updateShowSenderBrackets);
 
     // If no style sheet exists, generate it on first run.
     initializeSettingsQss();
 }
 
 
-QtUiStyle::~QtUiStyle() {}
-
 void QtUiStyle::updateUseCustomTimestampFormat()
 {
     ChatViewSettings s;
@@ -59,7 +53,7 @@ void QtUiStyle::updateTimestampFormatString()
 void QtUiStyle::updateSenderPrefixDisplay()
 {
     ChatViewSettings s;
-    setSenderPrefixDisplay(s.SenderPrefixDisplay());
+    setSenderPrefixDisplay(s.senderPrefixDisplay());
 }
 
 void QtUiStyle::updateShowSenderBrackets()
@@ -200,7 +194,7 @@ void QtUiStyle::generateSettingsQss() const
         out << "\n// NickView Colors\n"
             << "NickListItem[type=\"category\"] { foreground: " << color("DefaultBuffer", uiColors) << "; }\n"
             << "NickListItem[type=\"user\"] { foreground: " << color("OnlineNick", uiColors) << "; }\n"
-            << "NickListItem[type=\"user\", state=\"away\"] { foreground: " << color("AwayNick", uiColors) << "; }\n";
+            << R"(NickListItem[type="user", state="away"] { foreground: )" << color("AwayNick", uiColors) << "; }\n";
     }
 
     settingsQss.close();