chore: cherry-pick commits from release/eagle branch#113
Merged
deepin-bot[bot] merged 4 commits intolinuxdeepin:masterfrom Nov 28, 2025
Merged
chore: cherry-pick commits from release/eagle branch#113deepin-bot[bot] merged 4 commits intolinuxdeepin:masterfrom
deepin-bot[bot] merged 4 commits intolinuxdeepin:masterfrom
Conversation
Command execution rectification Log: Command execution rectification
cmd modify Task: https://pms.uniontech.com/task-view-361913.html Log: cmd modify
下载移除dht文件 Task: https://pms.uniontech.com/task-view-368187.html Log: 下载移除dht文件
df47696 to
8346c69
Compare
Added conditional compilation for Qt6 to handle the different split method signature and added bounds checking to prevent accessing array index 6 when the parts array has fewer elements. Log: Fix Qt6 build.
Contributor
deepin pr auto review我来对这段代码进行审查:
// 1. 将runPipeProcess移到工具类中
class ProcessUtils {
public:
static QStringList runPipeProcess(const QString &command, const QString &filter, int timeoutMs = 30000) {
QProcess process;
process.start(command);
if (!process.waitForFinished(timeoutMs)) {
qWarning() << "Command timeout:" << command;
process.kill();
return QStringList();
}
if (process.exitCode() != 0) {
qWarning() << "Command failed with exit code:" << process.exitCode();
return QStringList();
}
QString output = process.readAllStandardOutput();
QStringList lines = output.split('\n', Qt::SkipEmptyParts);
if (filter.isEmpty()) {
return lines;
}
return lines.filter(filter, Qt::CaseInsensitive);
}
};
// 2. 改进进程终止逻辑
int Aria2RPCInterface::killAria2cProc() {
QStringList pids = ProcessUtils::runPipeProcess("ps -eo pid,cmd", m_aria2cCmd);
for (const QString &pid : pids) {
QProcess killProcess;
killProcess.start("kill", QStringList() << "-TERM" << pid);
if (!killProcess.waitForFinished(5000)) {
qWarning() << "Failed to gracefully terminate process" << pid << ", forcing kill";
killProcess.start("kill", QStringList() << "-KILL" << pid);
killProcess.waitForFinished(5000);
}
}
return 0;
}
// 3. 使用常量定义路径和命令
namespace Constants {
const QString SESSION_CACHE_PATH = QDir::homePath() + "/.cache/uos-aria2c.session";
const QString ARIA2C_CMD = "aria2c";
// ... 其他常量
}
这些修改将提高代码的可维护性、安全性和性能。 |
lzwind
approved these changes
Nov 28, 2025
Contributor
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lzwind, re2zero The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Contributor
Author
|
/merge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cherry pick the commits from release/eagle branch which has fixed some issues.
Log: cherry-pick commits from release/eagle branch.