Remove 'isOpen'. 'file' in metadata_editor_s can replace it 59/232159/4
authorhj kim <backto.kim@samsung.com>
Tue, 28 Apr 2020 23:25:38 +0000 (08:25 +0900)
committerhj kim <backto.kim@samsung.com>
Wed, 6 May 2020 07:26:50 +0000 (07:26 +0000)
Change-Id: I027aa484b8173ab26a3e38a4b1986f4d04bc8cca

include/metadata_editor_private.h
src/metadata_editor.cpp

index ffcd21e..a266ead 100755 (executable)
@@ -88,7 +88,6 @@ extern "C" {
 typedef struct {
        TagLib::File*   file;
        int     filetype;
-       bool    isOpen;
        bool    isReadOnly;
 } metadata_editor_s;
 
index 1533010..3858e8b 100755 (executable)
@@ -55,7 +55,6 @@ static int __check_metadata_parameter(metadata_editor_s *metadata)
 {
        metadata_editor_retvm_if(!metadata, METADATA_EDITOR_ERROR_INVALID_PARAMETER, "Invalid metadata");
        metadata_editor_retvm_if(!metadata->file, METADATA_EDITOR_ERROR_INVALID_PARAMETER, "File loading fail");
-       metadata_editor_retvm_if(!metadata->isOpen, METADATA_EDITOR_ERROR_PERMISSION_DENIED, "File does not exist or you have no rights to open it");
 
        return METADATA_EDITOR_ERROR_NONE;
 }
@@ -785,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->isOpen = false;                                              // File is not opened yet
        _metadata->isReadOnly = true;                                           // Handle unexisting file as readonly
 
        // Save the structure in the metadata
@@ -821,7 +819,6 @@ extern "C" int metadata_editor_set_path(metadata_editor_h metadata, const char *
 
                _metadata->file = NULL;
                _metadata->filetype = METADATA_EDITOR_FORMAT_NOTYPE;
-               _metadata->isOpen = false;
                _metadata->isReadOnly = true;
        }
 
@@ -870,7 +867,6 @@ extern "C" int metadata_editor_set_path(metadata_editor_h metadata, const char *
 
        _metadata->file = _file;
        _metadata->filetype = media_type;
-       _metadata->isOpen = true;
        _metadata->isReadOnly = _file->readOnly();
 
        return METADATA_EDITOR_ERROR_NONE;