aboutsummaryrefslogtreecommitdiff
path: root/src/util/system.h
diff options
context:
space:
mode:
authorRyan Ofsky <ryan@ofsky.org>2022-05-16 14:37:00 -0400
committerRyan Ofsky <ryan@ofsky.org>2022-05-19 11:32:56 -0400
commitf9fdcec7e932843a91ddf7f377e00bd2a6efb82a (patch)
tree445d6149d3336842aa63ee000d64854e834b54a4 /src/util/system.h
parent77fabffef4ea840ee15c97061048fe8443d74658 (diff)
downloadbitcoin-f9fdcec7e932843a91ddf7f377e00bd2a6efb82a.tar.xz
settings: Add resetSettings() method
Allows the GUI to clear settings.json file and save settings.json.bak file when GUI "Reset Options" button is pressed or -resetguisettings command line option is used. (GUI code already backs up and resets the "guisettings.ini" file this way, so this just makes the same behavior possible for "settings.json")
Diffstat (limited to 'src/util/system.h')
-rw-r--r--src/util/system.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/util/system.h b/src/util/system.h
index bfc9698221..6af4f1dc18 100644
--- a/src/util/system.h
+++ b/src/util/system.h
@@ -440,7 +440,7 @@ protected:
* Get settings file path, or return false if read-write settings were
* disabled with -nosettings.
*/
- bool GetSettingsPath(fs::path* filepath = nullptr, bool temp = false) const;
+ bool GetSettingsPath(fs::path* filepath = nullptr, bool temp = false, bool backup = false) const;
/**
* Read settings file. Push errors to vector, or log them if null.
@@ -448,9 +448,10 @@ protected:
bool ReadSettingsFile(std::vector<std::string>* errors = nullptr);
/**
- * Write settings file. Push errors to vector, or log them if null.
+ * Write settings file or backup settings file. Push errors to vector, or
+ * log them if null.
*/
- bool WriteSettingsFile(std::vector<std::string>* errors = nullptr) const;
+ bool WriteSettingsFile(std::vector<std::string>* errors = nullptr, bool backup = false) const;
/**
* Get current setting from config file or read/write settings file,