core: Consolidate default global setting values in one place.
Some checks failed
Build Tilde Friends / Build-All (push) Has been cancelled

This commit is contained in:
2025-01-20 14:23:41 -05:00
parent fca5d37b7e
commit 19dbe354e7
3 changed files with 165 additions and 56 deletions

View File

@ -2046,6 +2046,10 @@ bool tf_ssb_db_get_global_setting_bool(sqlite3* db, const char* name, bool* out_
{
tf_printf("prepare failed: %s\n", sqlite3_errmsg(db));
}
if (!result)
{
*out_value = tf_util_get_default_global_setting_bool(name);
}
return result;
}
@ -2069,6 +2073,10 @@ bool tf_ssb_db_get_global_setting_int64(sqlite3* db, const char* name, int64_t*
{
tf_printf("prepare failed: %s\n", sqlite3_errmsg(db));
}
if (!result)
{
*out_value = tf_util_get_default_global_setting_int(name);
}
return result;
}
@ -2092,6 +2100,10 @@ bool tf_ssb_db_get_global_setting_string(sqlite3* db, const char* name, char* ou
{
tf_printf("prepare failed: %s\n", sqlite3_errmsg(db));
}
if (!result)
{
snprintf(out_value, size, "%s", tf_util_get_default_global_setting_string(name));
}
return result;
}