modernize: Pass arguments by value and move in constructors
[quassel.git] / src / uisupport / settingspage.cpp
index bb9d934..ed48f07 100644 (file)
 #include <QComboBox>
 #include <QSpinBox>
 #include <QVariant>
+#include <utility>
+
+#include "fontselector.h"
 
 #include "uisettings.h"
 
-SettingsPage::SettingsPage(const QString &category, const QString &title, QWidget *parent)
+SettingsPage::SettingsPage(QString category, QString title, QWidget *parent)
     : QWidget(parent),
-    _category(category),
-    _title(title),
+    _category(std::move(category)),
+    _title(std::move(title)),
     _changed(false),
     _autoWidgetsChanged(false)
 {
@@ -85,6 +88,18 @@ bool SettingsPage::hasChanged(QSpinBox *box)
 {
     return box->property("storedValue").toInt() != box->value();
 }
+
+
+void SettingsPage::load(FontSelector *box, QFont value)
+{
+    box->setProperty("storedValue", value);
+    box->setSelectedFont(value);
+}
+
+
+bool SettingsPage::hasChanged(FontSelector *box)
+{
+    return box->property("storedValue").value<QFont>() != box->selectedFont();
 }