feat: set desktop file names and install desktop entries#437
Conversation
Reviewer's GuideThis PR standardizes application metadata and desktop integration across all dde-session-ui components by setting consistent Qt application properties, adding and installing org.deepin.dde.* .desktop files, updating copyright years, and optimizing the touchscreen dialog flow when a device is already associated. Sequence diagram for optimized touchscreen dialog launch flowsequenceDiagram
actor User
participant DesktopEnv
participant TouchscreenDialog as dde_touchscreen_dialog
participant Display
participant TouchscreenSetting
User ->> DesktopEnv: launch org.deepin.dde.touchscreen-dialog.desktop
DesktopEnv ->> TouchscreenDialog: start main(argc, argv)
TouchscreenDialog ->> TouchscreenDialog: setOrganizationName
TouchscreenDialog ->> TouchscreenDialog: setApplicationName
TouchscreenDialog ->> TouchscreenDialog: setDesktopFileName
TouchscreenDialog ->> Display: touchMap()
Display -->> TouchscreenDialog: touchMap
alt [touchUUID in touchMap]
TouchscreenDialog ->> TouchscreenDialog: qDebug
TouchscreenDialog -->> DesktopEnv: exit 0
else [touchUUID not in touchMap]
TouchscreenDialog ->> TouchscreenSetting: TouchscreenSetting(touchUUID)
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- In the top-level CMakeLists.txt, consider using CMAKE_CURRENT_SOURCE_DIR instead of CMAKE_SOURCE_DIR when globbing desktop files so this still works correctly if the project is added as a subdirectory of a larger build.
- For consistency and potential minor performance benefits, you may want to wrap the string literals passed to setOrganizationName and setApplicationName in QStringLiteral, as you already do for setDesktopFileName.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In the top-level CMakeLists.txt, consider using CMAKE_CURRENT_SOURCE_DIR instead of CMAKE_SOURCE_DIR when globbing desktop files so this still works correctly if the project is added as a subdirectory of a larger build.
- For consistency and potential minor performance benefits, you may want to wrap the string literals passed to setOrganizationName and setApplicationName in QStringLiteral, as you already do for setDesktopFileName.
## Individual Comments
### Comment 1
<location path="dde-touchscreen-dialog/src/main.cpp" line_range="55-61" />
<code_context>
- TouchscreenSetting s(posArguments.first());
+ // 如果该触摸设备已被关联到屏幕,则不再弹出选择窗口
+ const QString &touchUUID = posArguments.first();
+ const auto touchMap = display.touchMap();
+ if (touchMap.contains(touchUUID)) {
+ qDebug() << "touchscreen already associated:" << touchUUID << "->" << touchMap[touchUUID];
+ return 0;
</code_context>
<issue_to_address>
**suggestion (performance):** Avoid copying the entire touch map when a const reference is sufficient.
If `display.touchMap()` returns a large container, copying it each time adds unnecessary overhead. Prefer binding a const reference:
```cpp
const auto &touchMap = display.touchMap();
```
```suggestion
// 如果该触摸设备已被关联到屏幕,则不再弹出选择窗口
const QString &touchUUID = posArguments.first();
const auto &touchMap = display.touchMap();
if (touchMap.contains(touchUUID)) {
qDebug() << "touchscreen already associated:" << touchUUID << "->" << touchMap[touchUUID];
return 0;
}
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
1. Add org.deepin.dde.* desktop files for all dde-session-ui applications 2. Set DesktopFileName property in all application main.cpp files 3. Set proper application names and organization names consistently 4. Install desktop files to share/applications directory via CMake 5. Update copyright years from 2023 to 2026 across all files 6. Add optimization to skip touchscreen dialog if device already associated 7. Ensure consistent application metadata for session UI components Log: Added desktop entry files and enabled proper installation for dde- session-ui applications Influence: 1. Verify all desktop files are installed in /usr/share/applications/ 2. Test each application starts correctly via its desktop entry 3. Confirm application name and desktop file name consistency 4. Verify touchscreen dialog skips when device already associated 5. Check copyright header update does not affect functionality 6. Test reset-password-dialog with new desktop file name setting feat: 为所有dde-session-ui应用设置桌面文件名并安装桌面入口文件 1. 为所有dde-session-ui应用程序添加org.deepin.dde.*桌面文件 2. 在所有应用程序的main.cpp中设置DesktopFileName属性 3. 统一设置正确的应用程序名称和组织名称 4. 通过CMake将桌面文件安装到share/applications目录 5. 将所有文件的版权年份从2023更新至2026 6. 优化触摸屏对话框,若设备已关联则跳过显示 7. 确保会话UI组件的应用程序元数据一致性 Log: 新增dde-session-ui应用的桌面入口文件并启用安装 Influence: 1. 验证所有桌面文件已安装至/usr/share/applications/ 2. 测试每个应用程序通过桌面文件正确启动 3. 确认应用程序名称和桌面文件名称的一致性 4. 验证触摸屏对话框在设备已关联时跳过显示 5. 检查版权头更新不影响功能 6. 使用新的桌面文件名设置测试重置密码对话框 PMS: BUG-366057
deepin pr auto review★ 总体评分:75分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 diff --git a/dde-touchscreen-dialog/src/main.cpp b/dde-touchscreen-dialog/src/main.cpp
index ade16e9b..12345678 100644
--- a/dde-touchscreen-dialog/src/main.cpp
+++ b/dde-touchscreen-dialog/src/main.cpp
@@ -21,8 +21,7 @@ using namespace org::deepin::dde;
int main(int argc, char *argv[])
{
DApplication app(argc, argv);
app.setOrganizationName("deepin");
app.setApplicationName("dde-touchscreen-dialog");
app.setDesktopFileName(QStringLiteral("org.deepin.dde.touchscreen-dialog"));
- app.setQuitOnLastWindowClosed(false);
app.setQuitOnLastWindowClosed(true);
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, BLumia 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 |
applications
associated
Log: Added desktop entry files and enabled proper installation for dde-
session-ui applications
Influence:
feat: 为所有dde-session-ui应用设置桌面文件名并安装桌面入口文件
Log: 新增dde-session-ui应用的桌面入口文件并启用安装
Influence:
PMS: BUG-366057
Summary by Sourcery
Add desktop entry integration and metadata normalization for dde-session-ui applications, including a small behavioral optimization in the touchscreen dialog.
New Features:
Enhancements:
Build: