Export new API for updating extra information. 10/15710/1 accepted/tizen/generic accepted/tizen/generic/20140226.073944 accepted/tizen/mobile/20140227.072316 submit/tizen/20140226.000818
authorSung-jae Park <nicesj.park@samsung.com>
Mon, 27 Jan 2014 12:19:06 +0000 (21:19 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Mon, 27 Jan 2014 12:19:06 +0000 (21:19 +0900)
Alternative icon/name information.
content & title information.

Change-Id: I7743a7843edcd6628e5aa31b3540a3afb5c8d0e9

include/lb.h
packaging/org.tizen.data-provider-slave.spec
src/lb.c

index 9864481..1cd5eca 100644 (file)
@@ -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 */
index 36afcaa..2938fbc 100644 (file)
@@ -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
index f7c70f8..64fef83 100644 (file)
--- 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;