To be able to access it from viewer application from its updated callback.
[model] Redwood,Kiran,B3(Wearable)
[binary_type] AP
[customer] Docomo/Orange/ATT/Open
[issue#] N/A
[problem]
[cause]
[solution]
[team] HomeTF
[request]
[horizontal_expansion]
Change-Id: Ifddc45f0eeed97b1e5f3c2a5635f9954d090eaf6
extern void dbox_set_period(struct dynamicbox_common *handler, double period);
extern void dbox_set_update_mode(struct dynamicbox_common *handler, int active_mode);
extern void dbox_set_filename(struct dynamicbox_common *handler, const char *filename);
+extern void dbox_unlink_filename(struct dynamicbox_common *common);
extern void dbox_set_alt_icon(struct dynamicbox_common *handler, const char *icon);
extern void dbox_set_alt_name(struct dynamicbox_common *handle, const char *name);
extern int dbox_destroy_common_handle(struct dynamicbox_common *common);
common->dbox.last_damage.w = w;
common->dbox.last_damage.h = h;
common->dbox.last_extra_buffer_idx = DBOX_PRIMARY_BUFFER;
-
dbox_set_filename(common, safe_file);
if (dbox_text_dbox(common)) {
* DESC parser will call the "text event callback".
* Don't need to call global event callback in this case.
*/
+ dbox_unlink_filename(common);
goto out;
} else if (dbox_get_dbox_fb(common)) {
/*!
dbox_invoke_event_handler(handler, DBOX_EVENT_DBOX_UPDATED);
}
}
+ dbox_unlink_filename(common);
out:
return NULL;
fd = open(filename, O_RDONLY);
if (fd < 0) {
- ErrPrint("open: %s\n", strerror(errno));
+ ErrPrint("open: %s (%s)\n", strerror(errno), filename);
return NULL;
}
common->id = pi;
}
-void dbox_set_filename(struct dynamicbox_common *common, const char *filename)
+void dbox_unlink_filename(struct dynamicbox_common *common)
{
- if (common->filename) {
- if (common->dbox.type == DBOX_TYPE_FILE || common->dbox.type == DBOX_TYPE_TEXT) {
- if (common->filename[0] && unlink(common->filename) < 0) {
- ErrPrint("unlink: %s (%s)\n", strerror(errno), common->filename);
- }
+ if (common->dbox.type == DBOX_TYPE_FILE || common->dbox.type == DBOX_TYPE_TEXT) {
+ if (common->filename && common->filename[0] && unlink(common->filename) < 0) {
+ ErrPrint("unlink: %s (%s)\n", strerror(errno), common->filename);
}
+ }
+}
+void dbox_set_filename(struct dynamicbox_common *common, const char *filename)
+{
+ if (common->filename) {
free(common->filename);
}