Skip to content

Commit b89d364

Browse files
myk1343deepin-bot[bot]
authored andcommitted
fix: 修复zip加密压缩包输入错误密码后应提示密码错误,解压失败
修复zip加密压缩包输入错误密码后应提示密码错误,解压失败 Bug: https://pms.uniontech.com/bug-view-301765.html Log: 修复zip加密压缩包输入错误密码后应提示密码错误,解压失败
1 parent 548dc71 commit b89d364

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

3rdparty/libzipplugin/libzipplugin.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,12 @@ PluginFinishType LibzipPlugin::extractFiles(const QList<FileEntry> &files, const
183183
zip_close(archive);
184184
return PFT_Cancel;
185185
} else { // 处理错误
186+
//密码错误, 给出错误提示
187+
if(ET_WrongPassword == m_eErrorType && !m_strPassword.isEmpty()) {
188+
zip_close(archive);
189+
m_strPassword = "";
190+
return PFT_Error;
191+
}
186192
// 判断是否需要密码,若需要密码,弹出密码输入对话框,用户输入密码之后,重新解压当前文件
187193
if (ET_WrongPassword == m_eErrorType || ET_NeedPassword == m_eErrorType) {
188194
PasswordNeededQuery query(strFileName);
@@ -227,6 +233,13 @@ PluginFinishType LibzipPlugin::extractFiles(const QList<FileEntry> &files, const
227233
zip_close(archive);
228234
return PFT_Cancel;
229235
} else { // 处理错误
236+
//密码错误, 给出错误提示
237+
if(ET_WrongPassword == m_eErrorType && !m_strPassword.isEmpty()) {
238+
zip_close(archive);
239+
m_strPassword = "";
240+
emit error(("Wrong password."));
241+
return PFT_Error;
242+
}
230243
// 判断是否需要密码,若需要密码,弹出密码输入对话框,用户输入密码之后,重新解压当前文件
231244
if (ET_WrongPassword == m_eErrorType || ET_NeedPassword == m_eErrorType) {
232245

0 commit comments

Comments
 (0)