X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fsettingspage.h;h=11555e5b10fb54fc2682344c9cb3abbf33660b65;hp=523cfa255d76620ac8c57cbebef88134e34a4c5b;hb=cc6e7c08709c4e761e2fd9c2e322751015497003;hpb=39328183a6a87c6eb10a9dbbffcd5d65bf154a1f diff --git a/src/uisupport/settingspage.h b/src/uisupport/settingspage.h index 523cfa25..11555e5b 100644 --- a/src/uisupport/settingspage.h +++ b/src/uisupport/settingspage.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2018 by the Quassel Project * + * Copyright (C) 2005-2019 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -61,8 +61,7 @@ class UISUPPORT_EXPORT SettingsPage : public QWidget Q_OBJECT public: - SettingsPage(const QString &category, const QString &name, QWidget *parent = nullptr); - virtual ~SettingsPage() {}; + SettingsPage(QString category, QString name, QWidget* parent = nullptr); //! The category of this settings page. inline virtual QString category() const { return _category; } @@ -98,7 +97,7 @@ public: * enabled. You also need to provide an implementation of defaults() then. * * The default implementation returns false. - */ + */ inline virtual bool hasDefaults() const { return false; } //! Check if there are changes in the page, compared to the state saved in permanent storage. @@ -111,14 +110,14 @@ public: inline virtual bool aboutToSave() { return true; } //! sets checked state depending on \checked and stores the value for later comparision - static void load(QCheckBox *box, bool checked); - static bool hasChanged(QCheckBox *box); - static void load(QComboBox *box, int index); - static bool hasChanged(QComboBox *box); - static void load(QSpinBox *box, int value); - static bool hasChanged(QSpinBox *box); - static void load(FontSelector *box, QFont value); - static bool hasChanged(FontSelector *box); + static void load(QCheckBox* box, bool checked); + static bool hasChanged(QCheckBox* box); + static void load(QComboBox* box, int index); + static bool hasChanged(QComboBox* box); + static void load(QSpinBox* box, int value); + static bool hasChanged(QSpinBox* box); + static void load(FontSelector* box, QFont value); + static bool hasChanged(FontSelector* box); public slots: //! Save settings to permanent storage. @@ -140,16 +139,13 @@ public slots: virtual void defaults(); protected slots: - //! Calling this slot is equivalent to calling setChangedState(true). - inline void changed() { setChangedState(true); } - //! This should be called whenever the widget state changes from unchanged to change or the other way round. void setChangedState(bool hasChanged = true); protected: void initAutoWidgets(); - virtual QVariant loadAutoWidgetValue(const QString &widgetName); - virtual void saveAutoWidgetValue(const QString &widgetName, const QVariant &value); + virtual QVariant loadAutoWidgetValue(const QString& widgetName); + virtual void saveAutoWidgetValue(const QString& widgetName, const QVariant& value); signals: //! Emitted whenever the widget state changes. @@ -160,9 +156,9 @@ private slots: void autoWidgetHasChanged(); private: - void findAutoWidgets(QObject *parent, QObjectList *widgetList) const; - QByteArray autoWidgetPropertyName(QObject *widget) const; - QString autoWidgetSettingsKey(QObject *widget) const; + void findAutoWidgets(QObject* parent, QObjectList* widgetList) const; + QByteArray autoWidgetPropertyName(QObject* widget) const; + QString autoWidgetSettingsKey(QObject* widget) const; QString _category, _title; bool _changed, _autoWidgetsChanged;