Skip to content

Commit 34bee3d

Browse files
author
zhangjiarui
committed
fix(editor): check parent MIME types to support subtype files in isMimeTypeSupport
- Retain QMimeType object to enable parent type lookup - Add parentMimeTypes() fallback to match subtypes against whitelist 修复(editor): 在 isMimeTypeSupport 中检查父 MIME 类型以支持子类型文件打开 Log: 通过父 MIME 类型继承关系扩展白名单匹配范围,修复子类型文件无法打开的问题 Bug: https://pms.uniontech.com/bug-view-362023.html
1 parent 86ad04a commit 34bee3d

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/common/utils.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2011-2023 UnionTech Software Technology Co., Ltd.
1+
// SPDX-FileCopyrightText: 2011-2026 UnionTech Software Technology Co., Ltd.
22
//
33
// SPDX-License-Identifier: GPL-3.0-or-later
44

@@ -539,6 +539,7 @@ bool Utils::isMimeTypeSupport(const QString &filepath)
539539
textMimeTypes << "application/cmd"
540540
<< "application/javascript"
541541
<< "application/json"
542+
<< "application/schema+json"
542543
<< "application/pkix-cert"
543544
<< "application/octet-stream"
544545
<< "application/sql"
@@ -564,6 +565,7 @@ bool Utils::isMimeTypeSupport(const QString &filepath)
564565
<< "application/x-yaml"
565566
<< "application/x-pem-key"
566567
<< "application/xml"
568+
<< "application/xhtml+xml"
567569
<< "application/yaml"
568570
<< "application/x-zerosize"
569571
<< "image/svg+xml"

0 commit comments

Comments
 (0)