From 43ebafe6dc13803b0f7adddc20d6bbdc92aa97d7 Mon Sep 17 00:00:00 2001 From: Martchus Date: Fri, 24 Sep 2021 21:54:22 +0200 Subject: [PATCH] Improve error message when trying to assign attachments to format not supporting it See https://github.com/Martchus/tageditor/issues/74 --- CMakeLists.txt | 2 +- cli/mainfeatures.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b8a422..e2ab392 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ set(META_GUI_OPTIONAL true) set(META_JS_SRC_DIR renamingutility) set(META_VERSION_MAJOR 3) set(META_VERSION_MINOR 5) -set(META_VERSION_PATCH 0) +set(META_VERSION_PATCH 1) set(META_ADD_DEFAULT_CPP_UNIT_TEST_APPLICATION ON) # add project files diff --git a/cli/mainfeatures.cpp b/cli/mainfeatures.cpp index e9a2480..7e00d2a 100644 --- a/cli/mainfeatures.cpp +++ b/cli/mainfeatures.cpp @@ -853,6 +853,9 @@ void setTagInfo(const SetTagInfoArgs &args) } attachmentsModified |= currentInfo.next(container, diag); } + } else if (fileInfo.attachmentsParsingStatus() == ParsingStatus::NotSupported) { + diag.emplace_back( + DiagLevel::Critical, "Unable to assign attachments because that is not supported for the file's format.", attachmentsContext); } else { diag.emplace_back(DiagLevel::Critical, "Unable to assign attachments because the container object has not been initialized.", attachmentsContext);