From 1ef51e2c854f896da6407496dbac214e8c9ae082 Mon Sep 17 00:00:00 2001 From: Sung-jae Park Date: Mon, 27 Jan 2014 21:19:06 +0900 Subject: [PATCH] Export new API for updating extra information. Alternative icon/name information. content & title information. Change-Id: I7743a7843edcd6628e5aa31b3540a3afb5c8d0e9 --- include/lb.h | 1 + packaging/org.tizen.data-provider-slave.spec | 2 +- src/lb.c | 78 ++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+), 1 deletion(-) diff --git a/include/lb.h b/include/lb.h index 9864481..1cd5eca 100644 --- a/include/lb.h +++ b/include/lb.h @@ -54,5 +54,6 @@ extern int lb_delete_all_deleteme(void); extern const char *livebox_find_pkgname(const char *filename); extern int livebox_request_update_by_id(const char *filename); extern int livebox_trigger_update_monitor(const char *id, int is_pd); +extern int livebox_update_extra_info(const char *id, const char *content, const char *title, const char *icon, const char *name); /* End of a file */ diff --git a/packaging/org.tizen.data-provider-slave.spec b/packaging/org.tizen.data-provider-slave.spec index 36afcaa..2938fbc 100644 --- a/packaging/org.tizen.data-provider-slave.spec +++ b/packaging/org.tizen.data-provider-slave.spec @@ -2,7 +2,7 @@ Name: org.tizen.data-provider-slave Summary: Plugin type livebox service provider -Version: 0.13.1 +Version: 0.13.2 Release: 1 Group: HomeTF/Livebox License: Flora diff --git a/src/lb.c b/src/lb.c index f7c70f8..64fef83 100644 --- a/src/lb.c +++ b/src/lb.c @@ -1233,6 +1233,84 @@ const char *livebox_find_pkgname(const char *filename) return NULL; } +int livebox_update_extra_info(const char *id, const char *content, const char *title, const char *icon, const char *name) +{ + Eina_List *l; + struct item *item; + + EINA_LIST_FOREACH(s_info.item_list, l, item) { + if (!strcmp(item->inst->id, id)) { + if (content && strlen(content)) { + char *_content; + + _content = strdup(content); + if (_content) { + if (item->inst->content) { + free(item->inst->content); + item->inst->content = NULL; + } + + item->inst->content = _content; + } else { + ErrPrint("Heap: %s\n", strerror(errno)); + } + } + + if (title && strlen(title)) { + char *_title; + + _title = strdup(title); + if (_title) { + if (item->inst->title) { + free(item->inst->title); + item->inst->title = NULL; + } + + item->inst->title = _title; + } else { + ErrPrint("Heap: %s\n", strerror(errno)); + } + } + + if (icon && strlen(icon)) { + char *_icon; + + _icon = strdup(icon); + if (_icon) { + if (item->inst->icon) { + free(item->inst->icon); + item->inst->icon = NULL; + } + + item->inst->icon = _icon; + } else { + ErrPrint("Heap: %s\n", strerror(errno)); + } + } + + if (name && strlen(name)) { + char *_name; + + _name = strdup(name); + if (_name) { + if (item->inst->name) { + free(item->inst->name); + item->inst->name = NULL; + } + + item->inst->name = _name; + } else { + ErrPrint("Heap: %s\n", strerror(errno)); + } + } + + return LB_STATUS_SUCCESS; + } + } + + return LB_STATUS_ERROR_NOT_EXIST; +} + int livebox_request_update_by_id(const char *filename) { Eina_List *l; -- 2.7.4