Skip to content

Commit

Permalink
fix: 修复解压性能劣化问题
Browse files Browse the repository at this point in the history
修复解压性能劣化问题

Bug: https://pms.uniontech.com/bug-view-215887.html
Bug: https://pms.uniontech.com/bug-view-216293.html
Log: 修复解压性能劣化问题
  • Loading branch information
myk1343 authored and deepin-bot[bot] committed Aug 25, 2023
1 parent 02e117b commit 8bdaebf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
3 changes: 1 addition & 2 deletions 3rdparty/interface/archiveinterface/cliinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ PluginFinishType CliInterface::extractFiles(const QList<FileEntry> &files, const
qInfo() << "解压目标路径 --- " << destPath;
}
bool bHandleLongName = false;
Common com;
bool bDlnfs = com.isSubpathOfDlnfs(options.strTargetPath);
bool bDlnfs = m_common->isSubpathOfDlnfs(options.strTargetPath);
QDir::setCurrent(destPath);
if (!m_extractOptions.bAllExtract) { // 提取部分文件
m_files.clear();
Expand Down
7 changes: 2 additions & 5 deletions 3rdparty/libarchive/libarchive/libarchiveplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ PluginFinishType LibarchivePlugin::extractFiles(const QList<FileEntry> &files, c
struct archive_entry *entry = nullptr;

QString extractDst;

bool bDlnfs = m_common->isSubpathOfDlnfs(options.strTargetPath);
// Iterate through all entries in archive.
int iIndex = 0; // 存储索引值
while (!QThread::currentThread()->isInterruptionRequested() && (archive_read_next_header(m_archiveReader.data(), &entry) == ARCHIVE_OK)) {
Expand Down Expand Up @@ -260,11 +260,8 @@ PluginFinishType LibarchivePlugin::extractFiles(const QList<FileEntry> &files, c
bool bLongName = false;
QString tempFilePathName;
QString strOriginName = entryName;

Common com;
bool bDlnfs = com.isSubpathOfDlnfs(options.strTargetPath);
if(!bDlnfs) {
QString sDir = com.handleLongNameforPath(strFilePath, entryName, m_mapLongDirName, m_mapRealDirValue);
QString sDir = m_common->handleLongNameforPath(strFilePath, entryName, m_mapLongDirName, m_mapRealDirValue);
if(sDir.length() > 0) {
strFilePath = sDir.endsWith(QDir::separator())?sDir.left(sDir.length() -1):sDir;
if(entryName.endsWith(QDir::separator())) {
Expand Down
7 changes: 3 additions & 4 deletions 3rdparty/libzipplugin/libzipplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ PluginFinishType LibzipPlugin::extractFiles(const QList<FileEntry> &files, const
} else {
m_dScaleSize = 100.0 / options.qSize;
}
m_bDlnfs = m_common->isSubpathOfDlnfs(options.strTargetPath);

// 执行解压操作
bool bHandleLongName = false;
Expand Down Expand Up @@ -784,10 +785,8 @@ ErrorType LibzipPlugin::extractEntry(zip_t *archive, zip_int64_t index, const Ex
}

QString tempFilePathName;
Common com;
bool bDlnfs = com.isSubpathOfDlnfs(options.strTargetPath);
if(!bDlnfs) {
QString sDir = com.handleLongNameforPath(strFilePath, strFileName, m_mapLongDirName, m_mapRealDirValue);
if(!m_bDlnfs) {
QString sDir = m_common->handleLongNameforPath(strFilePath, strFileName, m_mapLongDirName, m_mapRealDirValue);
if(sDir.length() > 0) {
strFilePath = sDir.endsWith(QDir::separator())?sDir.left(sDir.length() -1):sDir;
if(strFileName.endsWith(QDir::separator())) {
Expand Down
1 change: 1 addition & 0 deletions 3rdparty/libzipplugin/libzipplugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ class LibzipPlugin : public ReadWriteArchiveInterface
QMap<QString, int> m_mapLongDirName; // 长文件夹统计
QMap<QString, int> m_mapRealDirValue; // 长文件真实文件统计
QSet<QString> m_setLongName; // 存储被截取之后的文件名称(包含001之类的)
bool m_bDlnfs = false; //文件系统是否支持长文件
};

#endif // LIBZIPPLUGIN_H

0 comments on commit 8bdaebf

Please sign in to comment.