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
17 changes: 16 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,19 @@ debian/.debhelper
debian/deepin-compressor
debian/deepin-compressor.debhelper.log
debian/deepin-compressor.substvars
debian/files
debian/files

# vscode
.vscode/

# cursor
.specstory/
.cursor/
.cursorindexingignore

# ai
CLAUDE.md
AGENTS.md
.trellis
.claude
.agents
48 changes: 46 additions & 2 deletions 3rdparty/interface/archiveinterface/cliinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ PluginFinishType CliInterface::extractFiles(const QList<FileEntry> &files, const
m_extractOptions = options;

if (!bLnfs) {
if (arcData.listRootEntry.isEmpty() && options.qSize < FILE_MAX_SIZE) {
if (arcData.listRootEntry.isEmpty()) {
emit signalprogress(1);
setProperty("list", "tmpList");
list();
Expand Down Expand Up @@ -1323,7 +1323,51 @@ bool CliInterface::handleLongNameExtract(const QList<FileEntry> &files)
pProcess->setProgram(m_cliProps->property("extractProgram").toString(),
m_cliProps->extractArgs(absoluteDestinationPath, fileList, false, password));
pProcess->start();
pProcess->waitForFinished(-1);

// 检测加密文件解压时的密码提示,避免进程卡死
if (password.isEmpty()) {
bool bPasswordEntered = false;
while (!pProcess->waitForFinished(200)) {
if (pProcess->bytesAvailable() > 0) {
QByteArray output = pProcess->readAllStandardOutput();
QStringList lines = QString::fromLocal8Bit(output).split('\n');
for (const QString &line : lines) {
if (isPasswordPrompt(line)) {
pProcess->kill();
pProcess->waitForFinished(3000);

PasswordNeededQuery query(m_strArchiveName);
emit signalQuery(&query);
query.waitForResponse();

if (query.responseCancelled()) {
m_eErrorType = ET_NeedPassword;
return false;
}

password = query.password();
DataManager::get_instance().archiveData().strPassword = password;

// 带密码参数重新启动解压进程
pProcess->setPtyChannels(KPtyProcess::StdinChannel);
pProcess->setOutputChannelMode(KProcess::MergedChannels);
pProcess->setNextOpenMode(QIODevice::ReadWrite | QIODevice::Unbuffered | QIODevice::Text);
pProcess->setProgram(m_cliProps->property("extractProgram").toString(),
m_cliProps->extractArgs(absoluteDestinationPath, fileList, false, password));
pProcess->start();
pProcess->waitForFinished(-1);

bPasswordEntered = true;
break;
}
}
if (bPasswordEntered)
break;
}
}
} else {
pProcess->waitForFinished(-1);
}
}
}
pProcess->deleteLater();
Expand Down
1 change: 0 additions & 1 deletion src/source/archivemanager/singlejob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ void SingleJob::initConnections()
connect(m_pInterface, &ReadOnlyArchiveInterface::signalCurFileName, this, &SingleJob::signalCurFileName, Qt::ConnectionType::UniqueConnection);
connect(m_pInterface, &ReadOnlyArchiveInterface::signalFileWriteErrorName, this, &SingleJob::signalFileWriteErrorName, Qt::ConnectionType::UniqueConnection);
connect(m_pInterface, &ReadOnlyArchiveInterface::signalQuery, this, &SingleJob::signalQuery, Qt::ConnectionType::AutoConnection);
connect(m_pInterface, &ReadOnlyArchiveInterface::error, this, &SingleJob::slotError, Qt::AutoConnection);
}

void SingleJob::slotFinished(PluginFinishType eType)
Expand Down
Loading