1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-09-29 15:25:24 +00:00

sip: provider: Save accounts to disk

This commit is contained in:
Evangelos Ribeiro Tzaras 2021-07-06 13:17:53 +02:00 committed by Evangelos Ribeiro Tzaras
parent 7717633698
commit 5c1b76908b

View file

@ -194,6 +194,20 @@ origin_to_keyfile (CallsSipOrigin *origin,
}
static void
save_to_disk (CallsSipProvider *self)
{
g_autoptr (GKeyFile) key_file = g_key_file_new ();
g_autoptr (GError) error = NULL;
g_assert (CALLS_IS_SIP_PROVIDER (self));
calls_sip_provider_save_accounts (self, key_file);
if (!g_key_file_save_to_file (key_file, self->filename, &error))
g_warning ("Error saving keyfile to file %s: %s", self->filename, error->message);
}
static const char *
calls_sip_provider_get_name (CallsProvider *provider)
{
@ -579,6 +593,9 @@ calls_sip_provider_add_origin_full (CallsSipProvider *self,
g_list_store_append (self->origins, origin);
if (!self->use_memory_backend)
save_to_disk (self);
return origin;
}