mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-01 06:07:59 +00:00
LibConfig+LibCore+ConfigServer: Support u32 configuration entries
This commit is contained in:
committed by
Andreas Kling
parent
49f697ed56
commit
69beda23c3
@@ -150,15 +150,6 @@ DeprecatedString ConfigFile::read_entry(DeprecatedString const& group, Deprecate
|
||||
return jt->value;
|
||||
}
|
||||
|
||||
int ConfigFile::read_num_entry(DeprecatedString const& group, DeprecatedString const& key, int default_value) const
|
||||
{
|
||||
if (!has_key(group, key)) {
|
||||
return default_value;
|
||||
}
|
||||
|
||||
return read_entry(group, key).to_int().value_or(default_value);
|
||||
}
|
||||
|
||||
bool ConfigFile::read_bool_entry(DeprecatedString const& group, DeprecatedString const& key, bool default_value) const
|
||||
{
|
||||
auto value = read_entry(group, key, default_value ? "true" : "false");
|
||||
@@ -171,11 +162,6 @@ void ConfigFile::write_entry(DeprecatedString const& group, DeprecatedString con
|
||||
m_dirty = true;
|
||||
}
|
||||
|
||||
void ConfigFile::write_num_entry(DeprecatedString const& group, DeprecatedString const& key, int value)
|
||||
{
|
||||
write_entry(group, key, DeprecatedString::number(value));
|
||||
}
|
||||
|
||||
void ConfigFile::write_bool_entry(DeprecatedString const& group, DeprecatedString const& key, bool value)
|
||||
{
|
||||
write_entry(group, key, value ? "true" : "false");
|
||||
|
||||
Reference in New Issue
Block a user