refactor: use QDBusServiceWatcher to detect frontend exit#201
Merged
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom Apr 22, 2026
Merged
refactor: use QDBusServiceWatcher to detect frontend exit#201deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
deepin-bot[bot] merged 1 commit intolinuxdeepin:masterfrom
Conversation
There was a problem hiding this comment.
Sorry @wangrong1069, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
Warning
详情 {
"unset": {
"service/main.cpp": {
"b": [
" qunsetenv(\"DISPLAY\");"
]
}
}
} |
|
Note
详情{
"application/main.cpp": [
{
"line": " const QString acknowledgementLink = \"https://www.deepin.org/acknowledgments/deepin_reader\";",
"line_number": 124,
"rule": "S35",
"reason": "Url link | c08ef69076"
}
]
} |
Replace polling-based frontend exit detection with event-driven DBus NameOwnerChanged signal monitoring. Changes: - Use QDBusServiceWatcher to monitor frontend DBus name unregistration - Remove QTimer-based /proc/<pid>/exe polling - Simplify command-line arguments (remove PID, keep DBus name only) Benefits: - Event-driven instead of polling, more efficient - No dependency on Linux-specific /proc filesystem - More reliable detection via DBus daemon guarantees Task: https://pms.uniontech.com/task-view-388685.html
|
Warning
详情 {
"unset": {
"service/main.cpp": {
"b": [
" qunsetenv(\"DISPLAY\");"
]
}
}
} |
|
Note
详情{
"application/main.cpp": [
{
"line": " const QString acknowledgementLink = \"https://www.deepin.org/acknowledgments/deepin_reader\";",
"line_number": 124,
"rule": "S35",
"reason": "Url link | c08ef69076"
}
]
} |
|
Note
详情{
"application/main.cpp": [
{
"line": " const QString acknowledgementLink = \"https://www.deepin.org/acknowledgments/deepin_reader\";",
"line_number": 124,
"rule": "S35",
"reason": "Url link | c08ef69076"
}
]
} |
deepin pr auto reviewGit Diff 代码审查总体评价这段代码修改将服务进程监控前端进程的方式从基于PID的轮询检查改为基于DBus服务名称的监控。这是一个很好的改进,利用了Qt提供的DBus服务监听机制,避免了轮询带来的资源浪费,并提高了响应速度。 详细分析1. 语法逻辑优点:
改进建议:
2. 代码质量优点:
改进建议:
3. 代码性能优点:
改进建议:
4. 代码安全优点:
改进建议:
总结这是一次很好的代码改进,将基于轮询的监控方式改为基于事件驱动的方式,提高了代码的效率和可靠性。主要建议是添加DBus服务名称的格式验证和DBus连接状态的检查,以提高代码的健壮性。 |
lzwind
approved these changes
Apr 22, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lzwind, wangrong1069 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.
No description provided.