refactor(launch): drop QUrl intermediary and unused workingDir param#375
refactor(launch): drop QUrl intermediary and unused workingDir param#375ComixHe wants to merge 1 commit into
Conversation
Simplify Launch file-args handling by parsing QUrl inline from QStringList instead of a separate QList<QUrl> conversion. Removes unused workingDir parameter from processExec — working directory is resolved upstream via generateCommand. Pms: BUG-368227 BUG-370055 Signed-off-by: Yuming He <heyuming@deepin.org>
deepin pr auto review★ 总体评分:55分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 diff --git a/src/dbus/applicationservice.cpp b/src/dbus/applicationservice.cpp
index e960a641..ce2ce5cf 100644
--- a/src/dbus/applicationservice.cpp
+++ b/src/dbus/applicationservice.cpp
@@ -492,13 +492,12 @@ QDBusObjectPath ApplicationService::Launch(const QString &action, const QStringL
workingDir = std::move(optionPath);
}
- if (!workingDir.isEmpty() && QDir::isRelativePath(workingDir)) {
- qWarning() << "relative working dir is not supported: " << workingDir;
- workingDir.clear();
- }
+ if (!workingDir.isEmpty() && QDir::isRelativePath(workingDir)) {
+ workingDir = QDir::absolutePath(workingDir); // 转换为绝对路径
+ }
- auto cmds = generateCommand(optionsMap);
- auto task = processExec(execStr, fields, workingDir);
+ optionsMap["path"] = workingDir;
+
+ auto cmds = generateCommand(optionsMap);
+ auto task = processExec(execStr, fields);
if (!task) {
safe_sendErrorReply(QDBusError::InternalError, "Invalid Command.");
return {}; |
|
@ComixHe: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: BLumia, ComixHe 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 |
Simplify Launch file-args handling by parsing QUrl inline from QStringList instead of a separate QList conversion. Removes unused workingDir parameter from processExec — working directory is resolved upstream via generateCommand.
Pms: BUG-368227 BUG-370055