From: hj kim Date: Tue, 28 Apr 2020 23:32:53 +0000 (+0900) Subject: remove 'isReadOnly'. readOnly() of File can replace it X-Git-Tag: submit/tizen/20200602.021203~33 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F60%2F232160%2F3;p=platform%2Fcore%2Fapi%2Fmetadata-editor.git remove 'isReadOnly'. readOnly() of File can replace it Change-Id: I467df758aa84a3cbf47aaefcc27ac79f5370be0a --- diff --git a/include/metadata_editor_private.h b/include/metadata_editor_private.h index a266ead..47e2840 100755 --- a/include/metadata_editor_private.h +++ b/include/metadata_editor_private.h @@ -88,7 +88,6 @@ extern "C" { typedef struct { TagLib::File* file; int filetype; - bool isReadOnly; } metadata_editor_s; #ifdef __cplusplus diff --git a/src/metadata_editor.cpp b/src/metadata_editor.cpp index 3858e8b..c2ffd52 100755 --- a/src/metadata_editor.cpp +++ b/src/metadata_editor.cpp @@ -66,7 +66,7 @@ static int __check_metadata_set_parameter(metadata_editor_s *metadata) ret = __check_metadata_parameter(metadata); metadata_editor_retvm_if(ret != METADATA_EDITOR_ERROR_NONE, ret, "fail to __check_metadata_parameter"); - metadata_editor_retvm_if(metadata->isReadOnly, METADATA_EDITOR_ERROR_PERMISSION_DENIED, "File is readonly. Unable to modify"); + metadata_editor_retvm_if(metadata->file->readOnly(), METADATA_EDITOR_ERROR_PERMISSION_DENIED, "File is readonly. Unable to modify"); return METADATA_EDITOR_ERROR_NONE; } @@ -784,7 +784,6 @@ extern "C" int metadata_editor_create(metadata_editor_h *metadata) { _metadata->file = NULL; _metadata->filetype = METADATA_EDITOR_FORMAT_NOTYPE; // Specify file type out of range - _metadata->isReadOnly = true; // Handle unexisting file as readonly // Save the structure in the metadata *metadata = (metadata_editor_h)_metadata; @@ -819,7 +818,6 @@ extern "C" int metadata_editor_set_path(metadata_editor_h metadata, const char * _metadata->file = NULL; _metadata->filetype = METADATA_EDITOR_FORMAT_NOTYPE; - _metadata->isReadOnly = true; } try { @@ -867,7 +865,6 @@ extern "C" int metadata_editor_set_path(metadata_editor_h metadata, const char * _metadata->file = _file; _metadata->filetype = media_type; - _metadata->isReadOnly = _file->readOnly(); return METADATA_EDITOR_ERROR_NONE; }