Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions 3rdparty/libzipplugin/libzipplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ PluginFinishType LibzipPlugin::extractFiles(const QList<FileEntry> &files, const
return PFT_Error;
}

PasswordNeededQuery query(strFileName);
// 全部解压时显示压缩包名称
PasswordNeededQuery query(m_strArchiveName);
emit signalQuery(&query);
query.waitForResponse();

Expand Down Expand Up @@ -260,7 +261,9 @@ PluginFinishType LibzipPlugin::extractFiles(const QList<FileEntry> &files, const
// 判断是否需要密码,若需要密码,弹出密码输入对话框,用户输入密码之后,重新解压当前文件
if (ET_WrongPassword == m_eErrorType || ET_NeedPassword == m_eErrorType) {

PasswordNeededQuery query(strFileName);
// 根据解压文件数量决定显示的名称:单文件显示文件名,多文件显示压缩包名
QString displayName = (m_listCurIndex.count() == 1) ? strFileName : m_strArchiveName;
PasswordNeededQuery query(displayName);
emit signalQuery(&query);
query.waitForResponse();

Expand Down
13 changes: 4 additions & 9 deletions src/source/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1270,20 +1270,15 @@ void MainWindow::slotCompress(const QVariant &val)
bUseLibarchive = false;
#endif

// 判断zip格式是否使用了中文加密
bool zipPasswordIsChinese = false;
bool useLibzipForPassword = false;
if ("application/zip" == m_stCompressParameter.strMimeType) {
for (const QChar &ch : m_stCompressParameter.strPassword) {
if (ch.unicode() >= 0x4E00 && ch.unicode() <= 0x9FA5) {
zipPasswordIsChinese = true;
break;
}
if (!m_stCompressParameter.strPassword.isEmpty()) {
useLibzipForPassword = true;
}
}

UiTools::AssignPluginType eType = UiTools::APT_Auto; // 默认自动选择插件
if (true == zipPasswordIsChinese) {
// 对zip的中文加密使用libzip插件
if (true == useLibzipForPassword) {
eType = UiTools::APT_Libzip;
} else if ((false == options.bSplit) && true == bUseLibarchive && "application/zip" == m_stCompressParameter.strMimeType) {
// 考虑到华为arm平台 zip压缩 性能提升,只针对zip类型的压缩才会考虑到是否特殊处理arm平台,分卷情况不做此处理
Expand Down