GUI: header editor: honor "use legacy MIME types for fonts" setting

This commit is contained in:
Moritz Bunkus 2021-07-19 22:25:59 +02:00
parent 7858db3ade
commit fe79909f44
No known key found for this signature in database
GPG Key ID: 74AF00ADF2E32C85
2 changed files with 6 additions and 2 deletions

View File

@ -34,6 +34,9 @@
could be interpreted as the 639-2 alpha-2 code for "Irish" or as the name of
the language called "Ga") and only worked with languages whose name was at
most three letters long.
* MKVToolNix GUI: header editor: the header editor will now honor the "use
legacy MIME types when adding font attachments" setting when adding new
attachments.
# Version 59.0.0 "Shining Star" 2021-07-10

View File

@ -45,6 +45,7 @@
#include "mkvtoolnix-gui/header_editor/unsigned_integer_value_page.h"
#include "mkvtoolnix-gui/main_window/main_window.h"
#include "mkvtoolnix-gui/util/basic_tree_view.h"
#include "mkvtoolnix-gui/util/file.h"
#include "mkvtoolnix-gui/util/file_dialog.h"
#include "mkvtoolnix-gui/util/header_view_manager.h"
#include "mkvtoolnix-gui/util/model.h"
@ -792,12 +793,12 @@ Tab::createAttachmentFromFile(QString const &fileName) {
if (!content)
return {};
auto mimeType = mtx::mime::guess_type_for_file(to_utf8(fileName));
auto mimeType = Util::detectMIMEType(fileName);
auto uid = create_unique_number(UNIQUE_ATTACHMENT_IDS);
auto fileData = new KaxFileData;
auto attachment = KaxAttachedPtr{
mtx::construct::cons<KaxAttached>(new KaxFileName, to_wide(QFileInfo{fileName}.fileName()),
new KaxMimeType, mimeType,
new KaxMimeType, to_utf8(mimeType),
new KaxFileUID, uid)
};