From 0b4625b6accbac9fe9429cc6902399b298ee7bea Mon Sep 17 00:00:00 2001 From: "bhutani.92" Date: Tue, 27 Dec 2016 12:57:40 +0530 Subject: [PATCH] Fixed Alignment in code Change-Id: I9b43a9086fe5a5a4b5c383812800bd33b28bd34e Signed-off-by: bhutani.92 --- src/view/mp-all-view.c | 159 ++++++++++++++++++++++--------------------------- 1 file changed, 71 insertions(+), 88 deletions(-) diff --git a/src/view/mp-all-view.c b/src/view/mp-all-view.c index e11188e..b141888 100644 --- a/src/view/mp-all-view.c +++ b/src/view/mp-all-view.c @@ -29,10 +29,10 @@ #include "ms-key-ctrl.h" static void _mp_all_view_playlist_list_create_playlist_cb(void *data, - Evas_Object * - obj, - void - *event_info); + Evas_Object * + obj, + void + *event_info); static void _mp_all_view_edit_cb(void *data, Evas_Object * obj, void *event_info); static void _mp_all_view_content_load(void *thiz, MpTab_e tab); @@ -80,24 +80,24 @@ int _mp_all_view_update(void *thiz) mp_list_update(view->content_to_show); if (_mp_all_view_tab_index_get(view) == MP_TAB_SONGS - && mp_list_get_editable_count(view->content_to_show, - mp_list_get_edit_type(view-> - content_to_show))) { + && mp_list_get_editable_count(view->content_to_show, + mp_list_get_edit_type(view-> + content_to_show))) { mp_list_show_fast_scroll(view->content_to_show); } if (_mp_all_view_tab_index_get(view) == MP_TAB_SONGS - && mp_list_get_editable_count(view->content_to_show, - mp_list_get_edit_type(view-> - content_to_show)) - == 0) { + && mp_list_get_editable_count(view->content_to_show, + mp_list_get_edit_type(view-> + content_to_show)) + == 0) { mp_list_hide_fast_scroll(view->content_to_show); } return 0; } static void _mp_all_view_add_to_playlist_cb(void *data, Evas_Object * obj, - void *event_info) + void *event_info) { eventfunc; MpAllView_t *view = (MpAllView_t *) data; @@ -109,7 +109,7 @@ static void _mp_all_view_add_to_playlist_cb(void *data, Evas_Object * obj, } static void _mp_all_view_normal_more_btn_cb(void *data, Evas_Object * obj, - void *event_info) + void *event_info) { eventfunc; MpAllView_t *view = (MpAllView_t *) data; @@ -129,10 +129,10 @@ static void _mp_all_view_normal_more_btn_cb(void *data, Evas_Object * obj, if (index == MP_TAB_PLAYLISTS) { if (playlistcount < 100) { mp_util_ctxpopup_item_append(view->more_btn_ctxpopup, - STR_MP_CREATE_PLAYLIST, - MP_PLAYER_MORE_BTN_CREATE_PLAYLIST_IMAGE, - _mp_all_view_playlist_list_create_playlist_cb, - view); + STR_MP_CREATE_PLAYLIST, + MP_PLAYER_MORE_BTN_CREATE_PLAYLIST_IMAGE, + _mp_all_view_playlist_list_create_playlist_cb, + view); mp_util_more_btn_move_ctxpopup(view->more_btn_ctxpopup, obj); evas_object_show(view->more_btn_ctxpopup); } @@ -140,49 +140,49 @@ static void _mp_all_view_normal_more_btn_cb(void *data, Evas_Object * obj, /*edit button */ if (mp_list_get_editable_count - (view->content_to_show, MP_LIST_EDIT_TYPE_NORMAL)) { + (view->content_to_show, MP_LIST_EDIT_TYPE_NORMAL)) { if (index != MP_TAB_PLAYLISTS) { mp_util_ctxpopup_item_append(view->more_btn_ctxpopup, - STR_MP_ADD_TO_PLAYLIST, - MP_PLAYER_MORE_BTN_ADD_TO_PLAYLSIT_IMAGE, - _mp_all_view_add_to_playlist_cb, - view); + STR_MP_ADD_TO_PLAYLIST, + MP_PLAYER_MORE_BTN_ADD_TO_PLAYLSIT_IMAGE, + _mp_all_view_add_to_playlist_cb, + view); } mp_util_ctxpopup_item_append(view->more_btn_ctxpopup, - STR_MP_DELETE, - MP_PLAYER_MORE_BTN_DELETE_IMAGE, - _mp_all_view_edit_cb, view); + STR_MP_DELETE, + MP_PLAYER_MORE_BTN_DELETE_IMAGE, + _mp_all_view_edit_cb, view); /*search */ if (count > 0) { mp_util_ctxpopup_item_append(view->more_btn_ctxpopup, - STR_MP_SEARCH, NULL, - mp_common_create_search_view_cb, - view); + STR_MP_SEARCH, NULL, + mp_common_create_search_view_cb, + view); } #ifdef MP_FEATURE_PERSONAL_PAGE if (index == MP_TAB_SONGS) { if (mp_util_is_personal_page_on()) { all_in_personal_e status = - mp_common_is_all_in_personal_page(((MpList_t *) view-> - content_to_show)-> - genlist); + mp_common_is_all_in_personal_page(((MpList_t *) view-> + content_to_show)-> + genlist); /*add */ if (status != MP_COMMON_ALL_IN - && status != MP_COMMON_ALL_ERROR) + && status != MP_COMMON_ALL_ERROR) mp_util_ctxpopup_item_append(view->more_btn_ctxpopup, - STR_MP_ADD_TO_PERSONAL_PAGE, - MP_PLAYER_MORE_BTN_ADD_TO_PERSONAL_PAGE, - mp_common_add_to_personal_page_cb, - view); + STR_MP_ADD_TO_PERSONAL_PAGE, + MP_PLAYER_MORE_BTN_ADD_TO_PERSONAL_PAGE, + mp_common_add_to_personal_page_cb, + view); /*remove */ if (status != MP_COMMON_ALL_OUT - && status != MP_COMMON_ALL_ERROR) + && status != MP_COMMON_ALL_ERROR) mp_util_ctxpopup_item_append(view->more_btn_ctxpopup, - STR_MP_REMOVE_FROM_PERSONAL_PAGE, - MP_PLAYER_MORE_BTN_REMOVE_FROM_PERSONAL_PAGE, - mp_common_remove_from_personal_page_cb, - view); + STR_MP_REMOVE_FROM_PERSONAL_PAGE, + MP_PLAYER_MORE_BTN_REMOVE_FROM_PERSONAL_PAGE, + mp_common_remove_from_personal_page_cb, + view); } } #endif @@ -191,9 +191,9 @@ static void _mp_all_view_normal_more_btn_cb(void *data, Evas_Object * obj, #ifndef MP_FEATURE_NO_END /*End */ mp_util_ctxpopup_item_append(view->more_btn_ctxpopup, - STR_MP_END, - MP_PLAYER_MORE_BTN_VIEW_END, - mp_common_ctxpopup_end_cb, view); + STR_MP_END, + MP_PLAYER_MORE_BTN_VIEW_END, + mp_common_ctxpopup_end_cb, view); #endif mp_util_more_btn_move_ctxpopup(view->more_btn_ctxpopup, obj); evas_object_show(view->more_btn_ctxpopup); @@ -230,14 +230,14 @@ static void _mp_all_view_update_toolbar_option(void *thiz) Evas_Object *btn = NULL; btn = - mp_widget_create_toolbar_btn(view->all_view_layout, - MP_TOOLBAR_BTN_MORE, NULL, - _mp_all_view_normal_more_btn_cb, - view); + mp_widget_create_toolbar_btn(view->all_view_layout, + MP_TOOLBAR_BTN_MORE, NULL, + _mp_all_view_normal_more_btn_cb, + view); elm_object_item_part_content_set(view->navi_it, "toolbar_more_btn", - btn); + btn); elm_naviframe_item_pop_cb_set(view->navi_it, _mp_all_view_pop_cb, - view); + view); endfunc; return; @@ -245,9 +245,9 @@ static void _mp_all_view_update_toolbar_option(void *thiz) /*************** functions for playlist list update *******************/ static void _mp_all_view_playlist_list_create_playlist_cb(void *data, - Evas_Object * - obj, - void *event_info) + Evas_Object * + obj, + void *event_info) { eventfunc; MpAllView_t *view = (MpAllView_t *) data; @@ -256,7 +256,7 @@ static void _mp_all_view_playlist_list_create_playlist_cb(void *data, mp_evas_object_del(view->more_btn_ctxpopup); Mp_Playlist_Data *mp_playlist_data = - mp_edit_playlist_create(MP_PLST_CREATE_TO_ADD_TRACK); + mp_edit_playlist_create(MP_PLST_CREATE_TO_ADD_TRACK); mp_edit_playlist_content_create(mp_playlist_data); } @@ -273,15 +273,10 @@ int _mp_all_view_update_options(void *thiz) mp_view_set_title_visible((MpView_t *) view, true); - /*PROFILE_IN("elm_naviframe_item_title_enabled_set"); - elm_naviframe_item_title_enabled_set(view->navi_it, EINA_TRUE, EINA_FALSE); - PROFILE_OUT("elm_naviframe_item_title_enabled_set"); */ - PROFILE_IN("_mp_all_view_update_toolbar_option"); _mp_all_view_update_toolbar_option(thiz); PROFILE_OUT("_mp_all_view_update_toolbar_option"); - /*edje_object_signal_emit(_EDJ(view->all_view_layout), "show,tabbar", "*"); */ return 0; } @@ -348,9 +343,9 @@ static void _all_view_tab_change_cb(void *data, Evas_Object * obj, list = (void *) mp_playlist_list_create(view->all_view_layout); if (view->tab_status < MP_TAB_MAX) { mp_playlist_list_set_data((MpPlaylistList_t *) list, - MP_PLAYLIST_LIST_DISPLAY_MODE, - view->display_mode[view->tab_status], - -1); + MP_PLAYLIST_LIST_DISPLAY_MODE, + view->display_mode[view->tab_status], + -1); } mp_list_update(list); break; @@ -368,11 +363,11 @@ static void _all_view_tab_change_cb(void *data, Evas_Object * obj, case MP_TAB_ARTISTS: list = (void *) mp_artist_list_create(view->all_view_layout); mp_artist_list_set_data((MpArtistList_t *) list, - MP_ARTIST_LIST_DISPLAY_MODE, - view->display_mode[view->tab_status], -1); + MP_ARTIST_LIST_DISPLAY_MODE, + view->display_mode[view->tab_status], -1); mp_list_update(list); if (view->display_mode[view->tab_status] == - MP_LIST_DISPLAY_MODE_NORMAL) { + MP_LIST_DISPLAY_MODE_NORMAL) { mp_list_show_fast_scroll(list); } break; @@ -394,7 +389,7 @@ static void _all_view_tab_change_cb(void *data, Evas_Object * obj, content = mp_list_get_layout(list); if (content != NULL) { elm_object_part_content_set(view->all_view_layout, "list-content", - content); + content); } /*reset the flag */ @@ -444,7 +439,7 @@ static void _mp_all_view_tabs_sequence_get() } static Evas_Object *_all_view_create_tabbar(Evas_Object * parent, - MpAllView_t * view) + MpAllView_t * view) { MP_CHECK_NULL(parent); MP_CHECK_NULL(view); @@ -492,8 +487,6 @@ static void _mp_all_view_content_load(void *thiz, MpTab_e tab) PROFILE_OUT("_all_view_create_tabbar"); elm_object_part_content_set(view->all_view_layout, "tabbar", tabbar); - /*elm_naviframe_item_style_set(view->navi_it, "tabbar/notitle"); - elm_object_item_part_content_set(view->navi_it, "tabbar", tabbar); */ view->all_view_tabbar = tabbar; endfunc; } @@ -603,23 +596,13 @@ static void _mp_all_view_on_event(void *thiz, MpViewEvent_e event) Mp_Playlist_Data *mp_playlist_data = (Mp_Playlist_Data *) ad->popup_data; mp_evas_object_del(mp_playlist_data->popup); - free(ad->popup_data); - ad->popup_data = NULL; + IF_FREE(ad->popup_data); } break; case MP_PLAYLIST_CREATED: _mp_all_view_playlist_update(view); break; case MP_SIP_STATE_CHANGED: - /* - if (view->navi_it) { - const char *signal = mp_util_get_sip_state() ? "elm,state,toolbar,instant_close" : "elm,state,toolbar,instant_open"; - elm_object_item_signal_emit(view->navi_it, signal, ""); - - bool title_visible = (mp_util_get_sip_state() && mp_util_is_landscape()) ? false : true; - mp_view_set_title_visible(thiz, title_visible); - } - */ break; #ifndef MP_SOUND_PLAYER case MP_UPDATE_PLAYING_LIST: @@ -673,10 +656,10 @@ static void _mp_all_view_on_event(void *thiz, MpViewEvent_e event) case MP_PAUSE_PLAYBACK: case MP_PLAYING_TRACK_CHANGED: case MP_STOP_PLAYBACK:{ - if (index == MP_TAB_SONGS) { - mp_list_realized_item_part_update(list, "elm.icon.left", - ELM_GENLIST_ITEM_FIELD_CONTENT); - } + if (index == MP_TAB_SONGS) { + mp_list_realized_item_part_update(list, "elm.icon.left", + ELM_GENLIST_ITEM_FIELD_CONTENT); + } break; } default: @@ -697,12 +680,12 @@ static int _mp_all_view_init(Evas_Object * parent, MpAllView_t * view) view->on_event = _mp_all_view_on_event; view->all_view_layout = - mp_common_load_edj(view->layout, MP_EDJ_NAME, - "common_view_layout"); + mp_common_load_edj(view->layout, MP_EDJ_NAME, + "common_view_layout"); MP_CHECK_VAL(view->all_view_layout, -1); elm_object_part_content_set(view->layout, "list_content", - view->all_view_layout); + view->all_view_layout); return ret; } @@ -749,7 +732,7 @@ int mp_all_view_select_tab(MpAllView_t * view, MpTab_e tab) MP_CHECK_VAL(view, -1); elm_toolbar_item_selected_set(mp_util_toolbar_nth_item - (view->all_view_tabbar, tab), EINA_TRUE); + (view->all_view_tabbar, tab), EINA_TRUE); mp_view_update_options((MpView_t *) view); return 0; } -- 2.7.4