diff --git a/src/libsnore/settingsdialog.cpp b/src/libsnore/settingsdialog.cpp index 8aa874d..d95724f 100644 --- a/src/libsnore/settingsdialog.cpp +++ b/src/libsnore/settingsdialog.cpp @@ -119,11 +119,7 @@ void SettingsDialog::save() void SettingsDialog::setVisible(bool b) { - if (b) { - load(); - } else { - save(); - } + load(); QWidget::setVisible(b); } diff --git a/src/libsnore/settingsdialog.h b/src/libsnore/settingsdialog.h index a742bbc..fbcc016 100644 --- a/src/libsnore/settingsdialog.h +++ b/src/libsnore/settingsdialog.h @@ -24,6 +24,7 @@ class QAbstractButton; + namespace Snore { class PluginSettingsWidget; @@ -36,20 +37,36 @@ class SettingsDialog; namespace Snore { + +/** + * A QWidget providing acces to the settings of the plugins. + * If your application does not offer a ui you might call snore-settings insetad. + */ + class SNORE_EXPORT SettingsDialog : public QWidget { Q_OBJECT public: - explicit SettingsDialog(QWidget *parent = 0); + explicit SettingsDialog(QWidget *parent = nullptr); ~SettingsDialog(); - //TODO: move to private header + /** + * \todo move to private header or cleanup + */ void initTabs(); public Q_SLOTS: void setVisible(bool b) override; + + /** + * Save the settings. + */ void accept(); + + /** + * Reset the settings. + */ void reset(); private Q_SLOTS: