projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix #1125 by adding a missing typecast
[pulseview.git]
/
pv
/
globalsettings.hpp
diff --git
a/pv/globalsettings.hpp
b/pv/globalsettings.hpp
index c6b4cfc5891e617a4d44985f240268bf2a2fa1a0..fe5bbc9e3292257cac2b38609e135bf9b91023af 100644
(file)
--- a/
pv/globalsettings.hpp
+++ b/
pv/globalsettings.hpp
@@
-20,7
+20,6
@@
#ifndef PULSEVIEW_GLOBALSETTINGS_HPP
#define PULSEVIEW_GLOBALSETTINGS_HPP
#ifndef PULSEVIEW_GLOBALSETTINGS_HPP
#define PULSEVIEW_GLOBALSETTINGS_HPP
-#include <functional>
#include <map>
#include <glib.h>
#include <map>
#include <glib.h>
@@
-29,12
+28,18
@@
#include <QString>
#include <QVariant>
#include <QString>
#include <QVariant>
-using std::function;
using std::map;
using std::map;
-using std::
multimap
;
+using std::
vector
;
namespace pv {
namespace pv {
+class GlobalSettingsInterface
+{
+public:
+ virtual void on_setting_changed(const QString &key, const QVariant &value) = 0;
+};
+
+
class GlobalSettings : public QSettings
{
Q_OBJECT
class GlobalSettings : public QSettings
{
Q_OBJECT
@@
-63,8
+68,8
@@
public:
void set_defaults_where_needed();
void set_defaults_where_needed();
- static void
register_change_handler(const QString key,
-
function<void(QVariant)>
cb);
+ static void
add_change_handler(GlobalSettingsInterface *cb);
+
static void remove_change_handler(GlobalSettingsInterface *
cb);
void setValue(const QString& key, const QVariant& value);
void setValue(const QString& key, const QVariant& value);
@@
-91,7
+96,7
@@
public:
static GVariant* restore_gvariant(QSettings &settings);
private:
static GVariant* restore_gvariant(QSettings &settings);
private:
- static
multimap< QString, function<void(QVariant)>
> callbacks_;
+ static
vector<GlobalSettingsInterface*
> callbacks_;
static bool tracking_;
static map<QString, QVariant> tracked_changes_;
static bool tracking_;
static map<QString, QVariant> tracked_changes_;