summaryrefslogtreecommitdiffstats
path: root/src/afm-db.c
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2015-12-22 19:14:53 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2015-12-22 19:14:53 +0100
commita8f72186c447ba9b917c7f24a00497ae36dbc71f (patch)
tree46368c4333aba36cf6c1c5e4e52127826de2a7d0 /src/afm-db.c
parentce714369c64051d5307ef7ac9af2c53b6edfbb4a (diff)
implementation of installation by the daemon
Change-Id: I50ceca8c515df5a22f3387ccd1a6e3716641661f
Diffstat (limited to 'src/afm-db.c')
-rw-r--r--src/afm-db.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/afm-db.c b/src/afm-db.c
index 3f96821..8f52d1c 100644
--- a/src/afm-db.c
+++ b/src/afm-db.c
@@ -169,7 +169,6 @@ static int addapp(struct afapps *apps, const char *path)
const struct wgt_desc *desc;
const struct wgt_desc_feature *feat;
struct json_object *priv = NULL, *pub, *bya, *plugs, *str;
- char *appid, *end;
/* connect to the widget */
info = wgt_info_createat(AT_FDCWD, path, 0, 1, 0);
@@ -180,12 +179,6 @@ static int addapp(struct afapps *apps, const char *path)
}
desc = wgt_info_desc(info);
- /* create the application id */
- appid = alloca(2 + strlen(desc->id) + strlen(desc->version));
- end = stpcpy(appid, desc->id);
- *end++ = '@';
- strcpy(end, desc->version);
-
/* create the application structure */
priv = json_object_new_object();
if (!priv)
@@ -213,7 +206,7 @@ static int addapp(struct afapps *apps, const char *path)
|| json_add_str(priv, "path", path)
|| json_add_str(priv, "content", desc->content_src)
|| json_add_str(priv, "type", desc->content_type)
- || json_add_str(pub, "id", appid)
+ || json_add_str(pub, "id", desc->idaver)
|| json_add_str(pub, "version", desc->version)
|| json_add_int(pub, "width", desc->width)
|| json_add_int(pub, "height", desc->height)
@@ -249,7 +242,7 @@ static int addapp(struct afapps *apps, const char *path)
}
}
- if (json_add(apps->direct, appid, priv))
+ if (json_add(apps->direct, desc->idaver, priv))
goto error2;
json_object_get(priv);