config: Support setting sideload-repos option

This commit is contained in:
Alexander Larsson 2020-03-19 13:51:22 +01:00
parent bea879c0d0
commit 1d1819840e
2 changed files with 16 additions and 1 deletions

View File

@ -199,6 +199,18 @@ get_lang_default (FlatpakDir *dir)
return g_strjoinv (";", langs);
}
static char *
parse_string (const char *value, GError **error)
{
return g_strdup (value);
}
static char *
print_string (const char *value)
{
return g_strdup (value);
}
typedef struct
{
const char *name;
@ -210,6 +222,7 @@ typedef struct
ConfigKey keys[] = {
{ "languages", parse_lang, print_lang, get_lang_default },
{ "extra-languages", parse_locale, print_locale, NULL },
{ "sideload-repos", parse_string, print_string, NULL },
};
static ConfigKey *

View File

@ -1138,7 +1138,9 @@ handle_configure (FlatpakSystemHelper *object,
return TRUE;
}
if ((strcmp (arg_key, "languages") != 0) && (strcmp (arg_key, "extra-languages") != 0))
if ((strcmp (arg_key, "languages") != 0) &&
(strcmp (arg_key, "extra-languages") != 0) &&
(strcmp (arg_key, "sideload-repos") != 0))
{
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS,
"Unsupported key: %s", arg_key);