From d4194db7af7e708b66b0cc6ad6c43231e819a3f1 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Sat, 17 Nov 2012 06:52:46 +0200 Subject: [PATCH] core: Fix external profile remote UUID setting --- src/profile.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/profile.c b/src/profile.c index b7f876e81..79cb6af43 100644 --- a/src/profile.c +++ b/src/profile.c @@ -1586,6 +1586,8 @@ static void ext_set_defaults(struct ext_profile *ext) ext->enable_client = true; ext->enable_server = true; + ext->remote_uuids = g_new0(char *, 2); + for (i = 0; i < G_N_ELEMENTS(defaults); i++) { struct default_settings *settings = &defaults[i]; const char *remote_uuid; @@ -1593,8 +1595,6 @@ static void ext_set_defaults(struct ext_profile *ext) if (strcasecmp(ext->uuid, settings->uuid) != 0) continue; - ext->remote_uuids = g_new0(char *, 2); - if (settings->remote_uuid) remote_uuid = settings->remote_uuid; else @@ -1785,6 +1785,13 @@ static struct ext_profile *create_ext(const char *owner, const char *path, if (!ext->name) ext->name = g_strdup_printf("%s%s/%s", owner, path, uuid); + if (!ext->remote_uuids[0]) { + if (ext->service) + ext->remote_uuids[0] = g_strdup(ext->service); + else + ext->remote_uuids[0] = g_strdup(ext->uuid); + } + p = &ext->p; p->name = ext->name; -- 2.47.3