Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Ivy233 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 |
Reviewer's GuideThe PR aligns local CMake warning behavior with dpkg-buildpackage and hardens build-tree runtime behavior by improving translation placement, optional configuration checks, QML/Wayland metadata, drag previews, tooltip null handling, and D-Bus re-registration. Sequence diagram for safe optional configuration migrationsequenceDiagram
participant Shell
participant Filesystem
participant DConfig
Shell->>Shell: dconfigMetaExists(newAppId, newName)
Shell->>Shell: dconfigMetaExists(oldAppId, oldName)
alt Either metadata file is missing
Shell-->>Shell: return false
else Both metadata files exist
Shell->>DConfig: create(newAppId, newName, newPath)
Shell->>DConfig: create(oldAppId, oldName, oldPath)
DConfig-->>Shell: DConfig instances
Shell->>DConfig: isValid()
end
Sequence diagram for optional plugin translation loadingsequenceDiagram
participant AppletLoader
participant QDir
participant QTranslator
participant QApplication
AppletLoader->>QDir: exists(pluginTranslationDir)
alt Translation directory is missing
AppletLoader-->>AppletLoader: Skip translation loading
else Translation directory exists
AppletLoader->>QTranslator: load(locale, pluginId, suffix, pluginTranslationDir)
alt Matching translation loads
QTranslator-->>AppletLoader: true
AppletLoader->>QApplication: installTranslator(translator)
else No matching translation loads
QTranslator-->>AppletLoader: false
AppletLoader-->>AppletLoader: deleteLater()
end
end
Flow diagram for safer dock drag previews and tooltip positioningflowchart TD
A[Drag starts] --> B["grabToImage(callback, Qt.size(item.width, item.height))"]
B --> C[Set Drag.imageSource]
D[Tooltip position binding] --> E{shellSurface exists?}
E -->|Yes| F[Calculate surface-relative position]
E -->|No| G[Use zero position]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
TAG Bot New tag: 2.0.54 |
|
TAG Bot New tag: 2.0.55 |
|
TAG Bot New tag: 2.0.56 |
85e8a59 to
e37dfed
Compare
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="cmake/DDEShellPackageMacros.cmake" line_range="86-88" />
<code_context>
+ # Generate the qm files directly into the build-tree package directory, so
+ # that running dde-shell from the build tree can find the translations.
+ # (OUTPUT_LOCATION is honored by qt_add_translations since Qt 6.8.)
+ set_source_files_properties(${TRANSLATION_FILES}
+ PROPERTIES OUTPUT_LOCATION "${package_dirs}/translations"
+ )
add_custom_target(${_config_PACKAGE}_translation ALL
</code_context>
<issue_to_address>
**issue (broader_impact):** On supported Qt versions where `qt_add_translations` does not honor `OUTPUT_LOCATION` (Qt 5 and Qt 6 before 6.8), the generated `.qm` files are not placed in the build-tree package's `translations` directory, so running dde-shell from the build tree still cannot load these translations.
**Triggers:** When the project is built with Qt 5 or Qt 6 older than 6.8.
**Suggested fix:** Require Qt 6.8 or newer for this behavior, or retain a version-specific output configuration for older Qt versions.
</issue_to_address>aec9962 to
4322d26
Compare
4322d26 to
d8e9dd1
Compare
Fix runtime and build warnings in dde-shell: - Generate package translations in the build-tree package directory so local runs can load them. - Derive the dock Wayland extension classes directly from the non-template Qt base classes (QWaylandCompositorExtension, QWaylandShellSurface) and implement extensionInterface() explicitly, so qmltyperegistrar can resolve their base types. - Skip missing plugin translation directories without warning. - Correct the old configuration subpath calculation in DConfig migrations. - Guard tooltip positioning when the tray shell surface is temporarily null. 修复 dde-shell 及任务栏的运行时和构建告警: - 将插件翻译直接生成到构建树 package 目录,确保本地运行时能够加载。 - dock 的 Wayland 扩展类改为直接继承非模板 Qt 基类(QWaylandCompositorExtension、QWaylandShellSurface),并显式实现 extensionInterface(),使 qmltyperegistrar 能够解析其基类类型。 - 插件翻译目录不存在时跳过加载,避免产生告警。 - 修正 DConfig 迁移中旧配置 subpath 的计算。 - tray shell surface 暂时为空时保护 tooltip 位置计算。 PMS: TASK-394335
d8e9dd1 to
915aab7
Compare
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 语法正确,逻辑清晰,无需修改 2. 代码质量 ✅评价: 优秀 ✅ 通过 潜在问题:
建议: 建议将 PluginScale 也迁移到 QWaylandCompositorExtension 非模板基类以保持一致性,或移除冗余的 extensionInterface() override 3. 代码性能 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: 性能良好,资源使用合理,无需优化 4. 代码安全 🔒评价: 优秀 ✅ 通过
安全漏洞详情: 建议: 安全合规,无需安全加固 💡 改进建议代码示例// 建议:将 PluginScale 也迁移到非模板基类,保持一致性
class PluginScale : public QWaylandCompositorExtension, public QtWaylandServer::wp_fractional_scale_v1
{
Q_OBJECT
public:
PluginScale(PluginScaleManager *manager, QWaylandSurface *surface, const QWaylandResource &resource);
const struct wl_interface *extensionInterface() const override
{
return QtWaylandServer::wp_fractional_scale_v1::interface();
}
void wp_fractional_scale_v1_destroy(Resource *resource) override;
};
// 同时在 pluginmanagerextension.cpp 中更新构造函数:
PluginScale::PluginScale(PluginScaleManager *manager, QWaylandSurface *surface, const QWaylandResource &resource)
: QWaylandCompositorExtension(nullptr)
, m_manager(manager)
, m_surface(surface)
{
init(resource.resource());
setExtensionContainer(surface);
QWaylandCompositorExtension::initialize();
}本报告由 AI 代码审查工具自动生成 |
Fix compiler and QML runtime warnings across dde-shell and the dock.
The changes address:
.qmfiles directly into the build-tree package directory viaqt_add_translations'QM_OUTPUT_DIRECTORY(compatible with Qt versions before 6.8), and skip missing plugin translation directories quietly inappletloader.cpp.pluginmanagerextension,xdgactivationmanager) from the non-template Qt base classes (QWaylandCompositorExtension,QWaylandShellSurface) and implementextensionInterface()explicitly, so the base types can be resolved.dconfigMigrate()(previously miscomputed fromnewFirstIndex, producing malformed resource paths such as/org.deepin.dde.network/).SurfacePopup.qmlagainst a temporarily nullshellSurface.Note: optimizing the logging for missing DConfig resources is handled on the dtkcore side (the two warnings
Can't acquire config managerandDConfig is invalidare printed by dtkcore, and the meta lookup is dde-dconfig-daemon's internal logic), so no caller-side metadata check is added in this PR. The subpath calculation fix above is kept as it is a plain path-computation bug.Log: fix runtime warnings across shell and dock
PMS: TASK-394335
Summary by Sourcery
Eliminate shell and dock compiler and runtime warnings by fixing translation handling, Wayland type resolution, DConfig migration paths, and transient tooltip state handling.
Bug Fixes:
Enhancements:
Build: