Skip to content

Commit

Permalink
fix: 修复点击压缩,在格式下拉列表中没有7z格式压缩的选项
Browse files Browse the repository at this point in the history
修复点击压缩,在格式下拉列表中没有7z格式压缩的选项

Bug: https://pms.uniontech.com/bug-view-246539.html
Log: 修复点击压缩,在格式下拉列表中没有7z格式压缩的选项
  • Loading branch information
myk1343 authored and deepin-bot[bot] committed Mar 18, 2024
1 parent 9e13248 commit 6086135
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/source/page/compresssettingpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,17 @@ void CompressSettingPage::refreshMenu()
QAction *pAction = nullptr;
bool bHas7z = false;
for (const QString &type : qAsConst(m_listSupportedMimeTypes)) {
if (QMimeDatabase().mimeTypeForName(type).preferredSuffix() == "7z") {
QMimeType mType = QMimeDatabase().mimeTypeForName(type);
// QStringList suffixLst = mType.globPatterns(); 支持的后缀名
QString suffix = mType.preferredSuffix();
if(type.contains("x-7z-compressed")) {
suffix = "7z";
}
if (suffix == "7z") {
bHas7z = true;
}

pAction = new QAction(QMimeDatabase().mimeTypeForName(type).preferredSuffix(), m_pTypeMenu);
pAction = new QAction(suffix, m_pTypeMenu);
pAction->setData(type);
m_pTypeMenu->addAction(pAction);

Expand Down

0 comments on commit 6086135

Please sign in to comment.