Skip to content

Commit 82a15e4

Browse files
fix: Specify plugin type for zip file handling in ArchiveManager
Updated the ArchiveManager to explicitly assign the libzip plugin when adding zip files, addressing compatibility issues with the pzip plugin. Enhanced logging to include the plugin type used during the interface creation. bug: https://pms.uniontech.com/bug-view-350661.html
1 parent 3f25437 commit 82a15e4

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/source/archivemanager/archivemanager.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,16 @@ bool ArchiveManager::addFiles(const QString &strArchiveFullPath, const QList<Fil
147147
{"describe", QString("Add File to package: ") + strArchiveFullPath}
148148
};
149149
EventLogUtils::get().writeLogs(obj);
150-
qDebug() << "Creating interface for adding files";
151-
m_pTempInterface = UiTools::createInterface(strArchiveFullPath, true);
150+
// workaround:
151+
// pzip 仅支持新建压缩,目前先将zip 追加时显式指定使用 libzip 插件
152+
UiTools::AssignPluginType eType = UiTools::APT_Auto;
153+
CustomMimeType mimeType = determineMimeType(strArchiveFullPath);
154+
if (mimeType.name() == QLatin1String("application/zip")) {
155+
eType = UiTools::APT_Libzip;
156+
}
157+
158+
qDebug() << "Creating interface for adding files, plugin type:" << eType;
159+
m_pTempInterface = UiTools::createInterface(strArchiveFullPath, true, eType);
152160

153161
if (m_pTempInterface) {
154162
qDebug() << "Creating AddJob";

0 commit comments

Comments
 (0)