Update path replacement function 55/185755/2 accepted/tizen/unified/20180813.061456 submit/tizen/20180809.003539 submit/tizen/20180810.064017
authorMinje Ahn <minje.ahn@samsung.com>
Thu, 2 Aug 2018 04:58:46 +0000 (13:58 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Tue, 7 Aug 2018 07:48:30 +0000 (16:48 +0900)
Use hardcording instead of storae API (because of storage API changes)

Change-Id: Iaa2e9ac383f5d773e5370993cb3eb31f7a86ef6a
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
packaging/capi-media-thumbnail-util.spec
src/thumbnail_util.c

index 7bfbd40..7b1fd15 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       capi-media-thumbnail-util
 Summary:    A media thumbnail util library in Tizen Native API
-Version: 0.1.16
+Version: 0.1.17
 Release:    1
 Group:      Multimedia/API
 License:    Apache-2.0
index 16e3ef2..eb83aa9 100755 (executable)
 
 int __thumbnail_util_replace_path(const char *path, char *replace_path)
 {
-       int ret = THUMBNAIL_UTIL_ERROR_NONE;
-       char *old_path = NULL;
-
        if (!STRING_VALID(path)) {
                thumbnail_util_error("Invalid path");
                return THUMBNAIL_UTIL_ERROR_INVALID_PARAMETER;
        }
 
-       ret = storage_get_root_directory(STORAGE_TYPE_INTERNAL, &old_path);
-       if (ret != STORAGE_ERROR_NONE) {
-               thumbnail_util_error("storage_get_root_directory failed");
-               return THUMBNAIL_UTIL_ERROR_INVALID_OPERATION;
-       }
-
-       if (strncmp(path, old_path, strlen(old_path)) == 0) {
+       if (strncmp(path, MEDIA_ROOT_PATH_INTERNAL_OLD, strlen(MEDIA_ROOT_PATH_INTERNAL_OLD)) == 0) {
                thumbnail_util_sec_debug("Old path[%s]", path);
-               snprintf(replace_path, MAX_PATH_SIZE, "%s%s", tzplatform_getenv(TZ_USER_CONTENT), path + strlen(old_path));
+               snprintf(replace_path, MAX_PATH_SIZE, "%s%s", tzplatform_getenv(TZ_USER_CONTENT), path + strlen(MEDIA_ROOT_PATH_INTERNAL_OLD));
        } else {
                snprintf(replace_path, MAX_PATH_SIZE, "%s", path);
        }
 
-       SAFE_FREE(old_path);
-
        if (!STRING_VALID(replace_path)) {
                thumbnail_util_error("replace failed");
                return THUMBNAIL_UTIL_ERROR_INVALID_OPERATION;