Remove unused parameter 18/194118/1
authorMinje Ahn <minje.ahn@samsung.com>
Thu, 29 Nov 2018 07:18:19 +0000 (16:18 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Thu, 29 Nov 2018 07:18:19 +0000 (16:18 +0900)
Delete unused DB handle

Change-Id: Icda51ad05dbca4c3bc0c75ee11ea64bda1ab1a02
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
include/media-svc.h
plugin/media-content-plugin.c
src/common/media-svc-util.c
src/common/media-svc.c
src/include/common/media-svc-util.h

index 0f6869e..152ee51 100755 (executable)
@@ -62,7 +62,7 @@ int media_svc_get_pinyin(const char *src_str, char **pinyin_str);
 int media_svc_check_pinyin_support(bool *support);
 int media_svc_update_item_begin(int data_cnt);
 int media_svc_update_item_end(uid_t uid);
-int media_svc_update_item_meta(MediaSvcHandle *handle, const char *file_path, const char *storage_id, int storage_type, uid_t uid);
+int media_svc_update_item_meta(const char *file_path, const char *storage_id, int storage_type, uid_t uid);
 
 int media_svc_generate_uuid(char **uuid);
 int media_svc_check_storage(MediaSvcHandle *handle, const char *storage_id, char **storage_path, int *validity, uid_t uid);
index c0952da..f6d85c8 100755 (executable)
@@ -66,12 +66,12 @@ int check_item_exist(void *handle, const char *storage_id, const char *file_path
        return ret;
 }
 
-int insert_item_begin(void *handle, int item_cnt, int with_noti, int from_pid)
+int insert_item_begin(int item_cnt, int with_noti, int from_pid)
 {
        return media_svc_insert_item_begin(item_cnt, with_noti, from_pid);
 }
 
-int insert_item_end(void *handle, uid_t uid)
+int insert_item_end(uid_t uid)
 {
        return media_svc_insert_item_end(uid);
 }
@@ -81,7 +81,7 @@ int insert_item(void *handle, const char *storage_id, const char *file_path, int
        return media_svc_insert_item_bulk(handle, storage_id, storage_type, file_path, uid);
 }
 
-int set_all_storage_items_validity(void *handle, const char *storage_id, int storage_type, int validity, uid_t uid)
+int set_all_storage_items_validity(const char *storage_id, int storage_type, int validity, uid_t uid)
 {
        return media_svc_set_all_storage_items_validity(storage_id, storage_type, validity, uid);
 }
@@ -91,17 +91,17 @@ int set_folder_item_validity(void *handle, const char *storage_id, const char *f
        return media_svc_set_folder_items_validity(handle, storage_id, folder_path, validity, recursive, uid);
 }
 
-int set_item_validity_begin(void *handle, int item_cnt)
+int set_item_validity_begin(int item_cnt)
 {
        return media_svc_set_item_validity_begin(item_cnt);
 }
 
-int set_item_validity_end(void *handle, uid_t uid)
+int set_item_validity_end(uid_t uid)
 {
        return media_svc_set_item_validity_end(uid);
 }
 
-int set_item_validity(void *handle, const char *storage_id, const char *file_path, int storage_type, int validity, uid_t uid)
+int set_item_validity(const char *storage_id, const char *file_path, int storage_type, int validity, uid_t uid)
 {
        return media_svc_set_item_validity(storage_id, file_path, validity, uid);
 }
@@ -144,7 +144,7 @@ int update_folder_time(void *handle, const char *storage_id, char *folder_path,
        return MS_MEDIA_ERR_NONE;
 }
 
-int get_uuid(void * handle, char **uuid)
+int get_uuid(char **uuid)
 {
        return media_svc_generate_uuid(uuid);
 }
@@ -190,22 +190,22 @@ int get_storage_list(void *handle, char ***storage_list, char ***storage_id_list
        return media_svc_get_storage_list(handle, storage_list, storage_id_list, count);
 }
 
-int update_item_begin(void *handle, int item_cnt)
+int update_item_begin(int item_cnt)
 {
        return media_svc_update_item_begin(item_cnt);
 }
 
-int update_item_end(void *handle, uid_t uid)
+int update_item_end(uid_t uid)
 {
        return media_svc_update_item_end(uid);
 }
 
-int update_item_meta(void *handle, const char *file_path, const char *storage_id, int storage_type, uid_t uid)
+int update_item_meta(const char *file_path, const char *storage_id, int storage_type, uid_t uid)
 {
-       return media_svc_update_item_meta(handle, file_path, storage_id, storage_type, uid);
+       return media_svc_update_item_meta(file_path, storage_id, storage_type, uid);
 }
 
-int insert_item_scan(void * handle, const char *storage_id, const char *file_path, int storage_type, uid_t uid)
+int insert_item_scan(void *handle, const char *storage_id, const char *file_path, int storage_type, uid_t uid)
 {
        /* For scanner V2 */
        return MS_MEDIA_ERR_NONE;
@@ -241,27 +241,27 @@ int delete_invalid_folder_by_path(void **handle, const char *storage_id, const c
        return MS_MEDIA_ERR_NONE;
 }
 
-int insert_folder_begin(void * handle, int item_cnt)
+int insert_folder_begin(int item_cnt)
 {
        return media_svc_insert_folder_begin(item_cnt);
 }
 
-int insert_folder_end(void *handle, uid_t uid)
+int insert_folder_end(uid_t uid)
 {
        return media_svc_insert_folder_end(uid);
 }
 
-int insert_folder(void * handle, const char *storage_id, const char *file_path, int storage_type, uid_t uid)
+int insert_folder(void *handle, const char *storage_id, const char *file_path, int storage_type, uid_t uid)
 {
        return media_svc_insert_folder(handle, storage_id, storage_type, file_path, uid);
 }
 
-int delete_invalid_folder(void * handle, const char *storage_id, int storage_type, uid_t uid)
+int delete_invalid_folder(const char *storage_id, int storage_type, uid_t uid)
 {
        return media_svc_delete_invalid_folder(storage_id, storage_type, uid);
 }
 
-int set_folder_validity(void * handle, const char *storage_id, const char* start_path, int validity, bool is_recursive, uid_t uid)
+int set_folder_validity(void *handle, const char *storage_id, const char* start_path, int validity, bool is_recursive, uid_t uid)
 {
        return media_svc_set_folder_validity(handle, storage_id, start_path, validity, is_recursive, uid);
 }
@@ -296,17 +296,17 @@ int change_validity_item_batch(void **handle, const char *storage_id, const char
        return MS_MEDIA_ERR_NONE;
 }
 
-int check_folder_exist(void * handle, const char *storage_id, const char *folder_path)
+int check_folder_exist(void *handle, const char *storage_id, const char *folder_path)
 {
        return media_svc_check_folder_exist_by_path(handle, storage_id, folder_path);
 }
 
-int get_folder_id(void * handle, const char *storage_id, const char *path, char *folder_id)
+int get_folder_id(void *handle, const char *storage_id, const char *path, char *folder_id)
 {
        return media_svc_get_folder_id(handle, storage_id, path, folder_id);
 }
 
-int get_media_type(void *handle, const char *path, int *mediatype)
+int get_media_type(const char *path, int *mediatype)
 {
        return media_svc_get_media_type(path, mediatype);
 }
index 6f408a3..39cbdaa 100755 (executable)
@@ -992,7 +992,7 @@ ERROR:
        return 0;
 }
 
-int _media_svc_extract_image_metadata(sqlite3 *handle, media_svc_content_info_s *content_info)
+int _media_svc_extract_image_metadata(media_svc_content_info_s *content_info)
 {
        double value = 0.0;
        int orient_value = 0;
@@ -1189,7 +1189,7 @@ GET_WIDTH_HEIGHT:
        return MS_MEDIA_ERR_NONE;
 }
 
-int _media_svc_extract_music_metadata_for_update(sqlite3 *handle, media_svc_content_info_s *content_info, media_svc_media_type_e media_type)
+int _media_svc_extract_music_metadata_for_update(media_svc_content_info_s *content_info, media_svc_media_type_e media_type)
 {
        MMHandleType tag = 0;
        char *p = NULL;
index ae2ab93..6ae6450 100755 (executable)
@@ -324,7 +324,7 @@ int media_svc_insert_item_bulk(MediaSvcHandle *handle, const char *storage_id, m
        || (media_type == MEDIA_SVC_MEDIA_TYPE_SCSA))
                media_svc_debug("Do nothing[%d]", media_type);
        else if (media_type == MEDIA_SVC_MEDIA_TYPE_IMAGE)
-               ret = _media_svc_extract_image_metadata(db_handle, &content_info);
+               ret = _media_svc_extract_image_metadata(&content_info);
        else
                ret = _media_svc_extract_media_metadata(db_handle, &content_info, uid);
        media_svc_retv_del_if(ret != MS_MEDIA_ERR_NONE, ret, &content_info);
@@ -413,7 +413,7 @@ int media_svc_insert_item_immediately(MediaSvcHandle *handle, const char *storag
        || (media_type == MEDIA_SVC_MEDIA_TYPE_SCSA)) {
                /*Do nothing.*/
        } else if (media_type == MEDIA_SVC_MEDIA_TYPE_IMAGE) {
-               ret = _media_svc_extract_image_metadata(db_handle, &content_info);
+               ret = _media_svc_extract_image_metadata(&content_info);
        } else {
                ret = _media_svc_extract_media_metadata(db_handle, &content_info, uid);
        }
@@ -758,7 +758,7 @@ int media_svc_refresh_item(MediaSvcHandle *handle, const char *storage_id, ms_us
        || (media_type == MEDIA_SVC_MEDIA_TYPE_SCSA))
                media_svc_debug("Do nothing [%d]", media_type);
        else if (media_type == MEDIA_SVC_MEDIA_TYPE_IMAGE)
-               ret = _media_svc_extract_image_metadata(db_handle, &content_info);
+               ret = _media_svc_extract_image_metadata(&content_info);
        else
                ret = _media_svc_extract_media_metadata(db_handle, &content_info, uid);
 
@@ -872,14 +872,11 @@ int media_svc_update_item_end(uid_t uid)
        return ret;
 }
 
-int media_svc_update_item_meta(MediaSvcHandle *handle, const char *file_path, const char *storage_id, int storage_type, uid_t uid)
+int media_svc_update_item_meta(const char *file_path, const char *storage_id, int storage_type, uid_t uid)
 {
        int ret = MS_MEDIA_ERR_NONE;
-       sqlite3 *db_handle = (sqlite3 *)handle;
-
-       media_svc_retvm_if(db_handle == NULL, MS_MEDIA_ERR_INVALID_PARAMETER, "Handle is NULL");
-
        media_svc_media_type_e media_type;
+
        media_svc_retvm_if(!STRING_VALID(file_path), MS_MEDIA_ERR_INVALID_PARAMETER, "path is NULL");
        media_svc_retvm_if(__media_svc_check_storage(storage_type) != TRUE, MS_MEDIA_ERR_INVALID_PARAMETER, "Invalid storage_type");
 
@@ -892,7 +889,7 @@ int media_svc_update_item_meta(MediaSvcHandle *handle, const char *file_path, co
                return ret;
 
        if (media_type == MEDIA_SVC_MEDIA_TYPE_MUSIC)
-               ret = _media_svc_extract_music_metadata_for_update(db_handle, &content_info, media_type);
+               ret = _media_svc_extract_music_metadata_for_update(&content_info, media_type);
        else {
                _media_svc_destroy_content_info(&content_info);
                return MS_MEDIA_ERR_NONE;
index 7cb9be5..9398292 100755 (executable)
@@ -56,14 +56,14 @@ int _media_svc_get_file_time(const char *full_path);
 int _media_svc_set_default_value(media_svc_content_info_s *content_info, bool refresh);
 int _media_svc_set_media_info(media_svc_content_info_s *content_info, const char *storage_id, ms_user_storage_type_e storage_type,
                const char *path, media_svc_media_type_e *media_type, bool refresh);
-int _media_svc_extract_image_metadata(sqlite3 *handle, media_svc_content_info_s *content_info);
+int _media_svc_extract_image_metadata(media_svc_content_info_s *content_info);
 int _media_svc_extract_media_metadata(sqlite3 *handle, media_svc_content_info_s *content_info, uid_t uid);
 time_t __media_svc_get_timeline_from_str(const char *timstr);
 void _media_svc_destroy_content_info(media_svc_content_info_s *content_info);
 int _media_svc_create_thumbnail(const char *path, char *thumb_path, int max_length, media_svc_media_type_e media_type, uid_t uid);
 int _media_svc_get_pinyin_str(const char *src_str, char **pinyin_str);
 bool _media_svc_check_pinyin_support(void);
-int _media_svc_extract_music_metadata_for_update(sqlite3 *handle, media_svc_content_info_s *content_info, media_svc_media_type_e media_type);
+int _media_svc_extract_music_metadata_for_update(media_svc_content_info_s *content_info, media_svc_media_type_e media_type);
 int _media_svc_get_media_type(const char *path, int *mediatype);
 
 #ifdef __cplusplus