From 0612a6feef999badcd320c986a4490656a76c28b Mon Sep 17 00:00:00 2001 From: Patrick von Reth Date: Tue, 7 Jul 2015 23:18:41 +0200 Subject: [PATCH] add some doc --- src/libsnore/settingsdialog.cpp | 6 +----- src/libsnore/settingsdialog.h | 21 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 7 deletions(-) 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: