UI: Split global config into app and user config

This introduces a split of the current single ConfigFile instance for
all configuration into two separate instances.

The app config instance contains system-wide settings that mainly
concern the working of the app itself, whereas the user config instance
contains settings actually exposed to the user for the configuration.
This commit is contained in:
PatTheMav 2024-09-03 16:28:36 +02:00 • committed by Ryan Foster
commit 2635cf3a2a
35 changed files with 1135 additions and 912 deletions

View file

@ -147,8 +147,8 @@ std::string GetProgramGUID()
/* NOTE: this is an arbitrary random number that we use to count the
* number of unique OBS installations and is not associated with any
* kind of identifiable information */
const char *pguid =
config_get_string(GetGlobalConfig(), "General", "InstallGUID");
const char *pguid = config_get_string(App()->GetAppConfig(), "General",
"InstallGUID");
std::string guid;
if (pguid)
guid = pguid;
@ -157,7 +157,7 @@ std::string GetProgramGUID()
GenerateGUID(guid);
if (!guid.empty())
config_set_string(GetGlobalConfig(), "General",
config_set_string(App()->GetAppConfig(), "General",
"InstallGUID", guid.c_str());
}
@ -220,7 +220,7 @@ bool FetchAndVerifyFile(const char *name, const char *file, const char *url,
uint8_t fileHash[BLAKE2_HASH_LENGTH];
bool success;
BPtr<char> filePath = GetConfigPathPtr(file);
BPtr<char> filePath = GetAppConfigPathPtr(file);
if (!extraHeaders.empty()) {
headers.insert(headers.end(), extraHeaders.begin(),