From: Nilesh Trimbake Date: Fri, 5 Apr 2019 11:19:54 +0000 (+0530) Subject: Remove deprecated media info & media content API's X-Git-Tag: submit/tizen/20190408.070916^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=49266dd83de8743fe6c2c93f70dd56d7eecb74e5;p=profile%2Fmobile%2Fapps%2Fnative%2Fgallery.git Remove deprecated media info & media content API's This patch remove following deprecated API's: 1. media_folder_set_order 2. media_folder_update_to_db 3. media_folder_get_modified_time Change-Id: If924b57e408ae3ddbb1ef30c321dc32aa2ad2812 --- diff --git a/inc/data/gl-data-type.h b/inc/data/gl-data-type.h index b5e84e3..00c3db1 100644 --- a/inc/data/gl-data-type.h +++ b/inc/data/gl-data-type.h @@ -79,7 +79,6 @@ extern "C" { char *display_name; /*album name */ char *path; /*the full path of this folder */ int type; /*storage type */ - time_t mtime; /*modified time */ int count; /*the media count in this folder */ }; @@ -109,7 +108,6 @@ extern "C" { char *media_uuid; /*media uuid */ image_meta_h image_h; /*the handle of operating this image */ int orientation; /*the orientation of this image */ - char *burstshot_id; /*the tag of burst shot */ }; struct _gl_video_t { diff --git a/src/2dview/gl-albums.c b/src/2dview/gl-albums.c index 8c7f7d0..e1943e4 100644 --- a/src/2dview/gl-albums.c +++ b/src/2dview/gl-albums.c @@ -910,13 +910,11 @@ void _gl_update_list_data(void *data) Elm_Object_Item *f_it = elm_gengrid_first_item_get(ad->albuminfo.view); gl_cluster *album_item = NULL; Eina_List *list = NULL; - int i = 1, ret; + int i = 1; if (f_it) { album_item = elm_object_item_data_get(f_it); if (album_item && album_item->cluster) { list = eina_list_append(list, album_item); - media_folder_set_order(album_item->cluster->folder_h, i); - media_folder_update_to_db(album_item->cluster->folder_h); i++; album_item = NULL; } @@ -928,8 +926,6 @@ void _gl_update_list_data(void *data) album_item = elm_object_item_data_get(f_it); if (album_item && album_item->cluster) { list = eina_list_append(list, album_item); - ret = media_folder_set_order(album_item->cluster->folder_h, i); - ret = media_folder_update_to_db(album_item->cluster->folder_h); i++; album_item = NULL; } diff --git a/src/2dview/gl-thumbs.c b/src/2dview/gl-thumbs.c index db5428a..8d2d883 100644 --- a/src/2dview/gl-thumbs.c +++ b/src/2dview/gl-thumbs.c @@ -812,13 +812,6 @@ static int __gl_thumbs_idler_append_items(void *data) /* Check the first item of previous appending, maybe it's a burst item */ gitem = eina_list_nth(media_elist, i - 1); - if (gitem && gitem->item && - gitem->item->type == MEDIA_CONTENT_TYPE_IMAGE && - gitem->item->image_info && gitem->item->image_info->burstshot_id) { - burstshot_id = gitem->item->image_info->burstshot_id; - gl_dbgW("Update burstshot item!"); - elm_gengrid_item_update(gitem->elm_item); - } gitem = NULL; for (; i < cnt; i++) { gitem = eina_list_nth(media_elist, i); @@ -2167,20 +2160,9 @@ bool _gl_thumbs_is_append(gl_item * gitem, char **burstshot_id) GL_CHECK_FALSE(burstshot_id); bool b_to_append = false; - if (gitem->item->type == MEDIA_CONTENT_TYPE_IMAGE && - gitem->item->image_info && gitem->item->image_info->burstshot_id) { - /* First birstshot item, two jacent birstshot items */ - if (*burstshot_id == NULL || - g_strcmp0(*burstshot_id, - gitem->item->image_info->burstshot_id)) { - *burstshot_id = gitem->item->image_info->burstshot_id; - b_to_append = true; - } - } else { - /* Normal item(not burstshot) */ - b_to_append = true; - *burstshot_id = NULL; - } + /* Normal item(not burstshot) */ + b_to_append = true; + *burstshot_id = NULL; return b_to_append; } @@ -2355,8 +2337,7 @@ int _gl_thumbs_rotate_view(void *data) } gitem = elm_object_item_data_get(it); - if (gitem && gitem->item && gitem->item->image_info && - gitem->item->image_info->burstshot_id) { + if (gitem && gitem->item && gitem->item->image_info) { /* Realize burstshot item again */ elm_gengrid_item_update(it); } diff --git a/src/data/gl-data-type.c b/src/data/gl-data-type.c index 2053ca7..d846271 100644 --- a/src/data/gl-data-type.c +++ b/src/data/gl-data-type.c @@ -65,7 +65,6 @@ static int __gl_data_type_free_media(gl_media_s ** item) image_meta_destroy(tmp_item->image_info->image_h); tmp_item->image_info->image_h = NULL; } - GL_FREEIF(tmp_item->image_info->burstshot_id); GL_FREEIF(tmp_item->image_info->media_uuid); GL_FREE(tmp_item->image_info); } else if (MEDIA_CONTENT_TYPE_VIDEO == tmp_item->type && diff --git a/src/data/gl-data.c b/src/data/gl-data.c index 3da9d89..73dacb4 100644 --- a/src/data/gl-data.c +++ b/src/data/gl-data.c @@ -158,11 +158,8 @@ static int __gl_data_get_cluster_list(void *data, bool b_update) /* Get all contents(including local and cloud) for albums list */ g_strlcpy(filter.cond, GL_CONDITION_IMAGE_VIDEO, CONDITION_LENGTH); filter.sort_type = MEDIA_CONTENT_ORDER_ASC; - if (ad->maininfo.reorder) { - g_strlcpy(filter.sort_keyword, FOLDER_ORDER, KEYWORD_LENGTH); - } else { - g_strlcpy(filter.sort_keyword, FOLDER_NAME, KEYWORD_LENGTH); - } + g_strlcpy(filter.sort_keyword, FOLDER_NAME, KEYWORD_LENGTH); + filter.collate_type = MEDIA_CONTENT_COLLATE_NOCASE; filter.offset = GL_GET_ALL_RECORDS; filter.count = GL_GET_ALL_RECORDS; @@ -1334,11 +1331,6 @@ int _gl_data_selected_list_remove(void *data, gl_item * gitem) gl_item *current = NULL; Eina_List *l = NULL; bool b_removed = false; - char *burstshot_id = NULL; - if (gitem->item->type == MEDIA_CONTENT_TYPE_IMAGE && - gitem->item->image_info) { - burstshot_id = gitem->item->image_info->burstshot_id; - } EINA_LIST_FOREACH(ad->selinfo.elist, l, current) { if (current == NULL || current->item == NULL || @@ -1347,29 +1339,20 @@ int _gl_data_selected_list_remove(void *data, gl_item * gitem) continue; } if (!g_strcmp0(current->item->uuid, gitem->item->uuid) || - (burstshot_id && - current->item->type == MEDIA_CONTENT_TYPE_IMAGE && - current->item->image_info && - current->item->image_info->burstshot_id && - !g_strcmp0(burstshot_id, - current->item->image_info->burstshot_id))) { + (current->item->type == MEDIA_CONTENT_TYPE_IMAGE)) { if (gitem->item->storage_type != GL_STORE_T_PHONE) { ad->selinfo.disable_hide_cnt--; } /* Update selected images count */ if (current->item->type == MEDIA_CONTENT_TYPE_IMAGE && - ad->selinfo.images_cnt > 0) { + ad->selinfo.images_cnt > 0) { ad->selinfo.images_cnt--; } ad->selinfo.elist = eina_list_remove(ad->selinfo.elist, - current); - if (burstshot_id == NULL) { - break; - } else { - current->checked = gitem->checked; - b_removed = true; - } + current); + current->checked = gitem->checked; + b_removed = true; } else if (b_removed) { /* Already removed and not more items, quit */ break; diff --git a/src/data/gl-local-data.c b/src/data/gl-local-data.c index b3dcc98..3cab415 100644 --- a/src/data/gl-local-data.c +++ b/src/data/gl-local-data.c @@ -181,12 +181,6 @@ static bool __gl_local_data_get_album_list_cb(media_folder_h folder, goto GL_LOCAL_FAILED; } - if (media_folder_get_modified_time(folder, &(album->mtime)) != - MEDIA_CONTENT_ERROR_NONE) { - gl_dbgE("Get modified time failed!"); - goto GL_LOCAL_FAILED; - } - if (media_folder_get_name(folder, &(album->display_name)) != MEDIA_CONTENT_ERROR_NONE) { gl_dbgE("Get folder name failed!"); @@ -383,12 +377,6 @@ static bool __gl_local_data_get_media_list_cb(media_info_h media, gl_dbgE("Get image orientation failed!"); goto GL_LOCAL_FAILED; } - if (image_meta_get_burst_id - (image_handle, - &(image_info->burstshot_id)) != MEDIA_CONTENT_ERROR_NONE) { - image_info->burstshot_id = NULL; - gl_dbgE("Get burstshot_id failed!"); - } if (image_meta_destroy(image_handle) != MEDIA_CONTENT_ERROR_NONE) { gl_dbgE("Destroy image handle failed!");