From 00559e3812e9ec75058112320307fd1d5b15f1a5 Mon Sep 17 00:00:00 2001 From: Lukasz Stanislawski Date: Sat, 1 Dec 2018 12:22:26 +0100 Subject: remove usage of deprecated APIs Some functionalities become broken after removal of APIs. They will be restored in following patches. Change-Id: I4da3499a10e0648a3dcb276274063fd1abe9adf8 --- include/data/folderdata.h | 1 - src/data/folderdata.c | 9 ++---- src/view/viewer.c | 72 ----------------------------------------------- 3 files changed, 2 insertions(+), 80 deletions(-) diff --git a/include/data/folderdata.h b/include/data/folderdata.h index 79a6894..6750dba 100644 --- a/include/data/folderdata.h +++ b/include/data/folderdata.h @@ -32,7 +32,6 @@ struct folder_info { char *id; char *name; char *path; - char *parent_id; int count; }; diff --git a/src/data/folderdata.c b/src/data/folderdata.c index d956e59..5232eec 100644 --- a/src/data/folderdata.c +++ b/src/data/folderdata.c @@ -165,7 +165,6 @@ static void _destroy_folder_info(struct folder_info *fi) free(fi->id); free(fi->name); free(fi->path); - free(fi->parent_id); free(fi); } @@ -245,12 +244,6 @@ static bool _get_each_folder_info(media_folder_h folder, void *data) goto err; } - if (media_folder_get_parent_folder_id(folder, &(fi->parent_id)) - != MEDIA_CONTENT_ERROR_NONE) { - _ERR("failed to fetch parent folder id"); - goto err; - } - if (media_folder_get_media_count_from_db(fi->id, filter, &(fi->count)) != MEDIA_CONTENT_ERROR_NONE) { _ERR("failed to get media count"); @@ -362,6 +355,8 @@ static bool _get_folder_list(struct folderdata *fd, char **path) return false; } + //FIXME change a method of loading subfolder + //due to deprecation of FOLDER_PARENT_FOLDER_ID if (strlen(buf)) { snprintf(s, sizeof(s), " OR FOLDER_PARENT_FOLDER_ID=\"%s\"", diff --git a/src/view/viewer.c b/src/view/viewer.c index 43838be..4ab58ef 100644 --- a/src/view/viewer.c +++ b/src/view/viewer.c @@ -459,7 +459,6 @@ static void _set_played_position(struct _priv *priv) app_media *am; int position; int duration; - int r; if (priv->viewer.cur != VIEWER_MOVIE) return; @@ -484,75 +483,6 @@ static void _set_played_position(struct _priv *priv) /* TIZEN doesn't suppport function for storing played postion anymore */ - r = video_meta_update_to_db(video); - if (r != MEDIA_CONTENT_ERROR_NONE) { - _ERR("failed to update db"); - return; - } - - app_media_update(am); -} - -static void _set_image_orientation(struct _priv *priv) -{ - app_media *am; - app_media_info *mi; - image_meta_h image; - media_content_orientation_e orient; - int r; - - if (priv->viewer.cur != VIEWER_PHOTO) - return; - - am = eina_list_nth(priv->playlist.list, priv->playlist.cur); - if (!am) { - _ERR("failed to get app_media"); - return; - } - - mi = _get_current_media_info(priv); - if (!mi) { - _ERR("failed to getting media info"); - return; - } - - image = app_media_get_image_handle(am); - if (!image) { - _ERR("failed to getting image handle"); - return; - } - - switch (mi->image->orientation) { - case MEDIA_CONTENT_ORIENTATION_NORMAL: - case MEDIA_CONTENT_ORIENTATION_NOT_AVAILABLE: - orient = MEDIA_CONTENT_ORIENTATION_ROT_270; - break; - case MEDIA_CONTENT_ORIENTATION_ROT_90: - orient = MEDIA_CONTENT_ORIENTATION_NORMAL; - break; - case MEDIA_CONTENT_ORIENTATION_ROT_180: - orient = MEDIA_CONTENT_ORIENTATION_ROT_90; - break; - case MEDIA_CONTENT_ORIENTATION_ROT_270: - orient = MEDIA_CONTENT_ORIENTATION_ROT_180; - break; - default: - orient = MEDIA_CONTENT_ORIENTATION_NORMAL; - break; - } - - r = image_meta_set_orientation(image, orient); - if (r != MEDIA_CONTENT_ERROR_NONE) { - _ERR("failed to set played position"); - return; - } - - r = image_meta_update_to_db(image); - if (r != MEDIA_CONTENT_ERROR_NONE) { - _ERR("failed to update db"); - return; - } - app_media_update(am); } @@ -1141,8 +1071,6 @@ static void _callback_photo(void *data, const char *ev) } else if (!strcmp(ev, SRC_BTN_GALLERY_NEXT)) { _viewer_next(priv); } else if (!strcmp(ev, SRC_BTN_ROTATE)) { - _set_image_orientation(priv); - priv->viewer.foc = BTN_LOC_ROTATE; _viewer_show(priv); } else if (!strcmp(ev, SRC_BTN_ZOOM)) { -- cgit v1.2.3