config: Support setting sideload-repos option

This commit is contained in:
Alexander Larsson committed 2020-03-23 17:58:04 +01:00
1 parent bea879c0d0
commit 1d1819840e
2 files changed
+16 -1

No files matched your search

+13
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 *
+3 -1
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);