base: modify the argument of layoutmgr_update_layout 03/44603/3
authorJehun Lim <jehun.lim@samsung.com>
Thu, 23 Jul 2015 12:38:28 +0000 (21:38 +0900)
committerJehun Lim <jehun.lim@samsung.com>
Thu, 23 Jul 2015 12:44:00 +0000 (21:44 +0900)
Change-Id: Id483943c3917acf0eb1f916a653e102e7875313d
Signed-off-by: Jehun Lim <jehun.lim@samsung.com>
src/layout/gallery.c
src/layout/movie.c
src/layout/music.c
src/view/base.c

index eac45df..5dad688 100644 (file)
@@ -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:
index 3e92362..e6c5289 100644 (file)
@@ -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:
index 2c8b373..76313b5 100644 (file)
@@ -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:
index 928031a..9e50dd9 100644 (file)
@@ -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)