X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Fglobalsettings.hpp;h=eda3e03a0bfc1bc12b2fe6870bf8ed1c5df8299a;hb=bcb4c327ee9b8d2172d126429ba017884d079d4c;hp=c6b4cfc5891e617a4d44985f240268bf2a2fa1a0;hpb=ffc00fdd5946593ad2a587078fd4ee9ba0a507ec;p=pulseview.git diff --git a/pv/globalsettings.hpp b/pv/globalsettings.hpp index c6b4cfc..eda3e03 100644 --- a/pv/globalsettings.hpp +++ b/pv/globalsettings.hpp @@ -20,7 +20,6 @@ #ifndef PULSEVIEW_GLOBALSETTINGS_HPP #define PULSEVIEW_GLOBALSETTINGS_HPP -#include #include #include @@ -29,12 +28,18 @@ #include #include -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 @@ -51,6 +56,7 @@ public: static const QString Key_View_DefaultDivHeight; static const QString Key_View_DefaultLogicHeight; static const QString Key_Dec_InitialStateConfigurable; + static const QString Key_Log_BufferSize; enum ConvThrDispMode { ConvThrDispMode_None = 0, @@ -63,8 +69,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 +97,7 @@ public: static GVariant* restore_gvariant(QSettings &settings); private: - static multimap< QString, function > callbacks_; + static vector callbacks_; static bool tracking_; static map tracked_changes_;