diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2017-03-21 08:22:36 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2017-03-21 08:22:36 +0100 |
commit | ca847749c03b88d8e482396a9c4311ef02b054b9 (patch) | |
tree | c8237b2d8385f922acdb5563e417737feba3adfb /options/bundle.hpp | |
parent | fd0305aeecfad05f855b7d0e09a1eb9a70f4b2e5 (diff) |
options/{bundle,connector,value}: allow setting to default values
This is complicated by Qt's rejection of template classes.
Also move some stuff to slots where makes sense.
Diffstat (limited to 'options/bundle.hpp')
-rw-r--r-- | options/bundle.hpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/options/bundle.hpp b/options/bundle.hpp index a7897051..587b8a6b 100644 --- a/options/bundle.hpp +++ b/options/bundle.hpp @@ -32,6 +32,8 @@ namespace options { namespace detail { +void set_base_value_to_default(base_value* val); + struct bundler; class OPENTRACK_OPTIONS_EXPORT bundle final : public QObject, public connector @@ -66,11 +68,8 @@ public: bundle(const QString& group_name); ~bundle() override; QString name() const { return group_name; } - void reload(std::shared_ptr<QSettings> settings = group::ini_file()); void store_kv(const QString& name, const QVariant& datum); bool contains(const QString& name) const; - void save(); - void save_deferred(QSettings& s); bool is_modified() const; template<typename t> @@ -79,6 +78,11 @@ public: QMutexLocker l(mtx); return transient.get<t>(name); } +public slots: + void save(); + void reload(std::shared_ptr<QSettings> settings = group::ini_file()); + void save_deferred(QSettings& s); + void set_all_to_default(); }; OPENTRACK_OPTIONS_EXPORT bundler& singleton(); |