fix: simplify DBus service check and add cache path prefix#113
Merged
18202781743 merged 1 commit intolinuxdeepin:masterfrom Jun 27, 2025
Merged
fix: simplify DBus service check and add cache path prefix#11318202781743 merged 1 commit intolinuxdeepin:masterfrom
18202781743 merged 1 commit intolinuxdeepin:masterfrom
Conversation
1. Removed redundant `isServiceActivatable()` check in ValueHandler since `isServiceRegistered()` is sufficient 2. Added explicit cache path prefix setting for global cache in DSGConfigResource to ensure proper cache location 3. Changes improve code clarity and ensure consistent cache behavior fix: 简化DBus服务检查并添加缓存路径前缀 1. 在ValueHandler中移除了多余的`isServiceActivatable()`检查,仅保留 `isServiceRegistered()`已足够 2. 在DSGConfigResource中为全局缓存添加了明确的路径前缀设置,确保缓存位置 正确 3. 这些改动提高了代码清晰度并保证了缓存行为的一致性
Reviewer's GuideThis PR streamlines the DBus service initialization by dropping the redundant activatable check and strengthens cache management by explicitly prefixing the global cache path, enhancing clarity and consistency. Sequence diagram for simplified DBus service check in ValueHandlersequenceDiagram
participant ValueHandler
participant DBusHandler
participant DBusService
ValueHandler->>DBusHandler: isServiceRegistered()
alt Service is registered
ValueHandler->>DBusHandler: createManager(appid, fileName, subpath)
DBusHandler-->>ValueHandler: ConfigGetter instance
else Service is not registered
ValueHandler-->>ValueHandler: return nullptr
end
Class diagram for ValueHandler and DBusHandler after DBus check simplificationclassDiagram
class ValueHandler {
+ConfigGetter* createManager()
}
class DBusHandler {
+static bool isServiceRegistered()
+ConfigGetter* createManager(QString appid, QString fileName, QString subpath)
}
ValueHandler --> DBusHandler : uses
Class diagram for DSGConfigResource and DConfigFile with explicit cache path prefixclassDiagram
class DSGConfigResource {
+bool reparse(QString appid)
+QString configPrefixPath()
}
class DConfigFile {
+GlobalCache* globalCache()
+Meta* meta()
}
class GlobalCache {
+void setCachePathPrefix(QString prefix)
}
DSGConfigResource --> DConfigFile : creates
DConfigFile --> GlobalCache : has
DSGConfigResource ..> GlobalCache : sets cache path prefix
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review关键摘要:
是否建议立即修改:
|
There was a problem hiding this comment.
Hey @18202781743 - I've reviewed your changes and they look great!
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
mhduiy
approved these changes
Jun 27, 2025
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, mhduiy 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 |
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.
isServiceActivatable()check in ValueHandlersince
isServiceRegistered()is sufficientDSGConfigResource to ensure proper cache location
fix: 简化DBus服务检查并添加缓存路径前缀
isServiceActivatable()检查,仅保留isServiceRegistered()已足够正确
Summary by Sourcery
Simplify the DBus service availability logic by eliminating an unnecessary check and ensure consistent cache behavior by explicitly prefixing the global cache path.
Enhancements: