diff options
author | Russell Yanofsky <russ@yanofsky.org> | 2018-08-23 13:42:31 -0400 |
---|---|---|
committer | Russell Yanofsky <russ@yanofsky.org> | 2020-08-26 05:52:31 -0400 |
commit | 102abff9eb6c267af64f2a3560712147d1896e13 (patch) | |
tree | c9501b6cc14050d044f50bbfc45d668370679be0 /src/qt/optionsmodel.h | |
parent | 91aced7c7e6e75c1f5896b7e3843015177f32748 (diff) |
gui: Replace interface::Node references with pointers
No change in behavior. Replacing references with pointers allows Node interface
creation to be delayed until later during gui startup next commit to support
implementing -ipcconnect option
Diffstat (limited to 'src/qt/optionsmodel.h')
-rw-r--r-- | src/qt/optionsmodel.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h index 14fdf9046e..3d9e7bbb80 100644 --- a/src/qt/optionsmodel.h +++ b/src/qt/optionsmodel.h @@ -11,6 +11,8 @@ #include <QAbstractListModel> +#include <assert.h> + namespace interfaces { class Node; } @@ -39,7 +41,7 @@ class OptionsModel : public QAbstractListModel Q_OBJECT public: - explicit OptionsModel(interfaces::Node& node, QObject *parent = nullptr, bool resetSettings = false); + explicit OptionsModel(QObject *parent = nullptr, bool resetSettings = false); enum OptionID { StartAtStartup, // bool @@ -92,10 +94,11 @@ public: void setRestartRequired(bool fRequired); bool isRestartRequired() const; - interfaces::Node& node() const { return m_node; } + interfaces::Node& node() const { assert(m_node); return *m_node; } + void setNode(interfaces::Node& node) { assert(!m_node); m_node = &node; } private: - interfaces::Node& m_node; + interfaces::Node* m_node = nullptr; /* Qt-only settings */ bool fHideTrayIcon; bool fMinimizeToTray; |