aboutsummaryrefslogtreecommitdiff
path: root/src/qt/optionsmodel.h
diff options
context:
space:
mode:
authorRyan Ofsky <ryan@ofsky.org>2019-04-29 15:29:00 -0400
committerRyan Ofsky <ryan@ofsky.org>2022-05-19 11:32:56 -0400
commit31122aa979c4c9a40e276cfc44243420c367ba4f (patch)
treed13a3ff58c08635efba19c4693a8ae1ba6878b00 /src/qt/optionsmodel.h
parent0de36941eca1bff91420dd878eb097db2b1a596c (diff)
downloadbitcoin-31122aa979c4c9a40e276cfc44243420c367ba4f.tar.xz
refactor: Pass interfaces::Node references to OptionsModel constructor
Will allow OptionsModel to read/write settings to the node settings.json file and share settings with the node, instead of storing them externally in QSettings. Co-authored-by: Vasil Dimov <vd@FreeBSD.org>
Diffstat (limited to 'src/qt/optionsmodel.h')
-rw-r--r--src/qt/optionsmodel.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h
index 510ebb5cfd..e109d72435 100644
--- a/src/qt/optionsmodel.h
+++ b/src/qt/optionsmodel.h
@@ -41,7 +41,7 @@ class OptionsModel : public QAbstractListModel
Q_OBJECT
public:
- explicit OptionsModel(QObject *parent = nullptr, bool resetSettings = false);
+ explicit OptionsModel(interfaces::Node& node, QObject *parent = nullptr, bool resetSettings = false);
enum OptionID {
StartAtStartup, // bool
@@ -103,11 +103,10 @@ public:
void setRestartRequired(bool fRequired);
bool isRestartRequired() const;
- interfaces::Node& node() const { assert(m_node); return *m_node; }
- void setNode(interfaces::Node& node) { assert(!m_node); m_node = &node; }
+ interfaces::Node& node() const { return m_node; }
private:
- interfaces::Node* m_node = nullptr;
+ interfaces::Node& m_node;
/* Qt-only settings */
bool m_show_tray_icon;
bool fMinimizeToTray;