Skip to content

Commit fd8b3c5

Browse files
committed
fix(compress): show tar filename during tar.7z compression
Display tar filename in progress when compressing tar.7z archives, improving user experience by showing meaningful progress information. 压缩tar.7z时显示tar文件名,提升用户体验。 Log: tar.7z压缩时提示tar文件名 PMS: BUG-356753 Influence: 压缩tar.7z格式时,进度提示显示tar文件名,用户可以看到正在处理的归档文件名称
1 parent c532d6d commit fd8b3c5

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

3rdparty/interface/archiveinterface/cliinterface.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -919,8 +919,13 @@ void CliInterface::handleProgress(const QString &line)
919919
qint64 percentage = compressedSize * 1024 * 1024 * 100 / m_filesSize;
920920

921921
emit signalprogress(percentage);
922-
// 无法获取正在压缩的某个文件名
923-
// emit signalCurFileName();
922+
// tar.7z 无法获取正在压缩的单个文件名,但可以提示正在打包成 tar 文件
923+
// 发送 tar 文件名提示(去掉 .7z 后缀,显示正在打包的 tar 文件名)
924+
QString tarFileName = QFileInfo(m_strArchiveName).fileName();
925+
if (tarFileName.endsWith(".7z", Qt::CaseInsensitive)) {
926+
tarFileName = tarFileName.left(tarFileName.length() - 3);
927+
}
928+
emit signalCurFileName(tarFileName);
924929
}
925930
}
926931
}

0 commit comments

Comments
 (0)