From 29c48a5e3b4be084b89893e0a0c475653e1b6b5a Mon Sep 17 00:00:00 2001 From: Jehun Lim Date: Thu, 23 Jul 2015 21:38:28 +0900 Subject: [PATCH] base: modify the argument of layoutmgr_update_layout Change-Id: Id483943c3917acf0eb1f916a653e102e7875313d Signed-off-by: Jehun Lim --- src/layout/gallery.c | 11 +++++------ src/layout/movie.c | 11 +++++------ src/layout/music.c | 11 +++++------ src/view/base.c | 2 +- 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/layout/gallery.c b/src/layout/gallery.c index eac45df..5dad688 100644 --- a/src/layout/gallery.c +++ b/src/layout/gallery.c @@ -376,8 +376,8 @@ static void _hide(void *layout_data) static void _update(void *layout_data, int update_type, void *data) { + struct view_update_data *vdata; struct _priv *priv; - int index; bool update; if (!layout_data) { @@ -386,25 +386,24 @@ static void _update(void *layout_data, int update_type, void *data) } priv = layout_data; + vdata = data; switch (update_type) { case UPDATE_CONTENT: _update_content_list(priv); break; case UPDATE_FOCUS: - if (!data) { + if (!vdata) { _ERR("invalid argument"); return; } - index = *(int *)data; - - if (priv->cur_index != index) + if (priv->cur_index != vdata->index) update = true; else update = false; - listmgr_update_focus_item(priv->listmgr, index, update); + listmgr_update_focus_item(priv->listmgr, vdata->index, update); break; default: diff --git a/src/layout/movie.c b/src/layout/movie.c index 3e92362..e6c5289 100644 --- a/src/layout/movie.c +++ b/src/layout/movie.c @@ -579,8 +579,8 @@ static void _hide(void *layout_data) static void _update(void *layout_data, int update_type, void *data) { + struct view_update_data *vdata; struct _priv *priv; - int index; bool update; if (!layout_data) { @@ -589,6 +589,7 @@ static void _update(void *layout_data, int update_type, void *data) } priv = layout_data; + vdata = data; switch (update_type) { case UPDATE_CONTENT: @@ -596,19 +597,17 @@ static void _update(void *layout_data, int update_type, void *data) _update_recent_item(priv); break; case UPDATE_FOCUS: - if (!data) { + if (!vdata) { _ERR("invalid argument"); return; } - index = *(int *)data; - - if (priv->cur_index != index) + if (priv->cur_index != vdata->index) update = true; else update = false; - listmgr_update_focus_item(priv->listmgr, index, update); + listmgr_update_focus_item(priv->listmgr, vdata->index, update); _update_recent_item(priv); break; default: diff --git a/src/layout/music.c b/src/layout/music.c index 2c8b373..76313b5 100644 --- a/src/layout/music.c +++ b/src/layout/music.c @@ -548,8 +548,8 @@ static void _hide(void *layout_data) static void _update(void *layout_data, int update_type, void *data) { + struct view_update_data *vdata; struct _priv *priv; - int index; bool update; if (!layout_data) { @@ -558,6 +558,7 @@ static void _update(void *layout_data, int update_type, void *data) } priv = layout_data; + vdata = data; switch (update_type) { case UPDATE_CONTENT: @@ -565,19 +566,17 @@ static void _update(void *layout_data, int update_type, void *data) _update_playing_item(priv); break; case UPDATE_FOCUS: - if (!data) { + if (!vdata) { _ERR("invalid argument"); return; } - index = *(int *)data; - - if (priv->cur_index != index) + if (priv->cur_index != vdata->index) update = true; else update = false; - listmgr_update_focus_item(priv->listmgr, index, update); + listmgr_update_focus_item(priv->listmgr, vdata->index, update); _update_playing_item(priv); break; default: diff --git a/src/view/base.c b/src/view/base.c index 928031a..9e50dd9 100644 --- a/src/view/base.c +++ b/src/view/base.c @@ -308,7 +308,7 @@ static void _update(void *view_data, int update_type, void *data) layoutmgr_update_layout(priv->lmgr, g_menu_item[priv->current_layout].layout_id, - update_type, (void *)&vdata->index); + update_type, vdata); } static void _destroy(void *view_data) -- 2.7.4