X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fglobalsettings.hpp;h=093ac59b59ca584ba028d3313cfd6753a3065f8a;hb=7671200bd71de8cdd922b41b025ea18de6422345;hp=c6b4cfc5891e617a4d44985f240268bf2a2fa1a0;hpb=ffc00fdd5946593ad2a587078fd4ee9ba0a507ec;p=pulseview.git diff --git a/pv/globalsettings.hpp b/pv/globalsettings.hpp index c6b4cfc..093ac59 100644 --- a/pv/globalsettings.hpp +++ b/pv/globalsettings.hpp @@ -31,10 +31,17 @@ using std::function; using std::map; -using std::multimap; +using std::vector; namespace pv { +class GlobalSettingsInterface +{ +public: + virtual void on_setting_changed(const QString &key, const QVariant &value) = 0; +}; + + class GlobalSettings : public QSettings { Q_OBJECT @@ -63,8 +70,8 @@ public: void set_defaults_where_needed(); - static void register_change_handler(const QString key, - function cb); + static void add_change_handler(GlobalSettingsInterface *cb); + static void remove_change_handler(GlobalSettingsInterface *cb); void setValue(const QString& key, const QVariant& value); @@ -91,7 +98,7 @@ public: static GVariant* restore_gvariant(QSettings &settings); private: - static multimap< QString, function > callbacks_; + static vector callbacks_; static bool tracking_; static map tracked_changes_;