#include <SettingsStore.hpp>
Static Public Member Functions | |
| static void | init () |
| static void | reload () |
| static bool | flush () |
| static bool | reset_to_defaults () |
| static bool | get_secure_payments_enabled () |
| static void | set_secure_payments_enabled (bool enabled) |
| static std::string | get_language () |
| static void | set_language (const std::string &lang) |
| static void | apply_language () |
| static std::string | get_string (const std::string &dotted_key, const std::string &fallback_default) |
| static void | set_string (const std::string &dotted_key, const std::string &value) |
| static void | ensure_payments_json_exists () |
| static std::vector< std::string > | get_payment_domains () |
| static bool | save_payment_domains_user (const std::vector< std::string > &domains) |
| static bool | reset_payment_domains_from_system () |
Static Private Member Functions | |
| static std::string | settings_file_path () |
| static nlohmann::json | defaults () |
| static void | ensure_loaded_locked () |
| static bool | load_from_disk_locked () |
| static bool | write_to_disk_locked (const nlohmann::json &j) |
| static nlohmann::json * | get_or_create_node_locked (nlohmann::json &root, const std::string &dotted_key) |
| static const nlohmann::json * | get_node_locked (const nlohmann::json &root, const std::string &dotted_key) |
| static bool | get_bool (const std::string &dotted_key, bool fallback_default) |
| static void | set_bool (const std::string &dotted_key, bool value) |
| static int | get_int (const std::string &dotted_key, int fallback_default) |
| static void | set_int (const std::string &dotted_key, int value) |
| static std::string | user_payments_path () |
| static std::string | system_payments_path () |
| static nlohmann::json | default_payments_seed () |
| static bool | read_json_file (const std::string &path, nlohmann::json &out) |
| static bool | write_json_atomic (const std::string &path, const nlohmann::json &j) |
Static Private Attributes | |
| static std::mutex | mtx_ |
| static bool | loaded_ = false |
| static nlohmann::json | cache_ = nlohmann::json::object() |
Definition at line 27 of file SettingsStore.hpp.
|
static |
Definition at line 293 of file SettingsStore.cpp.
References get_language(), and set_language().
Referenced by main().
|
staticprivate |
Definition at line 374 of file SettingsStore.cpp.
Referenced by ensure_payments_json_exists().
|
staticprivate |
Definition at line 45 of file SettingsStore.cpp.
Referenced by ensure_loaded_locked(), and reset_to_defaults().
|
staticprivate |
Definition at line 75 of file SettingsStore.cpp.
References cache_, defaults(), load_from_disk_locked(), and loaded_.
Referenced by flush(), get_bool(), get_int(), get_string(), init(), reload(), set_bool(), set_int(), and set_string().
|
static |
Definition at line 439 of file SettingsStore.cpp.
References default_payments_seed(), mtx_, system_payments_path(), user_payments_path(), and write_json_atomic().
Referenced by get_payment_domains().
|
static |
Definition at line 139 of file SettingsStore.cpp.
References cache_, ensure_loaded_locked(), mtx_, and write_to_disk_locked().
|
staticprivate |
Definition at line 187 of file SettingsStore.cpp.
References cache_, ensure_loaded_locked(), get_node_locked(), and mtx_.
Referenced by get_secure_payments_enabled().
|
staticprivate |
Definition at line 211 of file SettingsStore.cpp.
References cache_, ensure_loaded_locked(), get_node_locked(), and mtx_.
|
static |
Definition at line 270 of file SettingsStore.cpp.
References get_string().
Referenced by apply_language().
|
staticprivate |
Definition at line 175 of file SettingsStore.cpp.
References split_dotted().
Referenced by get_bool(), get_int(), and get_string().
|
staticprivate |
Definition at line 160 of file SettingsStore.cpp.
References split_dotted().
Referenced by set_bool(), set_int(), and set_string().
|
static |
Definition at line 480 of file SettingsStore.cpp.
References ensure_payments_json_exists(), extract_domains_from_payments_json(), mtx_, normalize_domain(), read_json_file(), system_payments_path(), and user_payments_path().
|
static |
Definition at line 261 of file SettingsStore.cpp.
References get_bool().
Referenced by SettingsPage::build_secure_payments_tab(), BankOpener::is_payment_domain(), is_payment_domain(), and SecureList::is_payment_domain().
|
static |
Definition at line 236 of file SettingsStore.cpp.
References cache_, ensure_loaded_locked(), get_node_locked(), and mtx_.
Referenced by get_language().
|
static |
Definition at line 56 of file SettingsStore.cpp.
References ensure_loaded_locked(), and mtx_.
|
staticprivate |
Definition at line 85 of file SettingsStore.cpp.
References cache_, and settings_file_path().
Referenced by ensure_loaded_locked().
|
staticprivate |
Definition at line 397 of file SettingsStore.cpp.
Referenced by get_payment_domains().
|
static |
Definition at line 61 of file SettingsStore.cpp.
References cache_, ensure_loaded_locked(), loaded_, and mtx_.
|
static |
Definition at line 523 of file SettingsStore.cpp.
References mtx_, system_payments_path(), and user_payments_path().
|
static |
Definition at line 68 of file SettingsStore.cpp.
References cache_, defaults(), loaded_, mtx_, and write_to_disk_locked().
|
static |
Definition at line 505 of file SettingsStore.cpp.
References mtx_, normalize_domain(), user_payments_path(), and write_json_atomic().
|
staticprivate |
Definition at line 197 of file SettingsStore.cpp.
References cache_, ensure_loaded_locked(), get_or_create_node_locked(), mtx_, split_dotted(), and write_to_disk_locked().
Referenced by set_secure_payments_enabled().
|
staticprivate |
Definition at line 222 of file SettingsStore.cpp.
References cache_, ensure_loaded_locked(), get_or_create_node_locked(), mtx_, split_dotted(), and write_to_disk_locked().
|
static |
Definition at line 274 of file SettingsStore.cpp.
References set_string().
Referenced by apply_language().
|
static |
Definition at line 266 of file SettingsStore.cpp.
References set_bool().
Referenced by SettingsPage::build_secure_payments_tab().
|
static |
Definition at line 246 of file SettingsStore.cpp.
References cache_, ensure_loaded_locked(), get_or_create_node_locked(), mtx_, split_dotted(), and write_to_disk_locked().
Referenced by set_language().
|
staticprivate |
Definition at line 41 of file SettingsStore.cpp.
References config_dir_path().
Referenced by load_from_disk_locked(), and write_to_disk_locked().
|
staticprivate |
Definition at line 357 of file SettingsStore.cpp.
Referenced by ensure_payments_json_exists(), get_payment_domains(), and reset_payment_domains_from_system().
|
staticprivate |
Definition at line 353 of file SettingsStore.cpp.
Referenced by ensure_payments_json_exists(), get_payment_domains(), reset_payment_domains_from_system(), and save_payment_domains_user().
|
staticprivate |
Definition at line 409 of file SettingsStore.cpp.
Referenced by ensure_payments_json_exists(), and save_payment_domains_user().
|
staticprivate |
Definition at line 106 of file SettingsStore.cpp.
References config_dir_path(), and settings_file_path().
Referenced by flush(), reset_to_defaults(), set_bool(), set_int(), and set_string().
|
staticprivate |
Definition at line 76 of file SettingsStore.hpp.
Referenced by ensure_loaded_locked(), flush(), get_bool(), get_int(), get_string(), load_from_disk_locked(), reload(), reset_to_defaults(), set_bool(), set_int(), and set_string().
|
staticprivate |
Definition at line 75 of file SettingsStore.hpp.
Referenced by ensure_loaded_locked(), reload(), and reset_to_defaults().
|
staticprivate |
Definition at line 74 of file SettingsStore.hpp.
Referenced by ensure_payments_json_exists(), flush(), get_bool(), get_int(), get_payment_domains(), get_string(), init(), reload(), reset_payment_domains_from_system(), reset_to_defaults(), save_payment_domains_user(), set_bool(), set_int(), and set_string().