feat: add user-level desktop file handling in uninstaller#49
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: wjyrich 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 GuideExtend the uninstaller script to detect and clean up user-level .desktop entries in ~/.local/share/applications, removing both the desktop file and any referenced icon with clear exit codes, while preserving existing system-wide logic. Sequence diagram for user-level desktop file uninstallationsequenceDiagram
actor User
participant Uninstaller as dde-appwiz-uninstaller.sh
participant FileSystem
User->>Uninstaller: Run uninstaller with user-level .desktop file path
Uninstaller->>Uninstaller: Detect user-level desktop file
Uninstaller->>FileSystem: Read Icon path from .desktop file
Uninstaller->>FileSystem: Remove .desktop file
alt .desktop file removed successfully
Uninstaller->>FileSystem: Remove associated icon (if exists)
alt Icon removed
Uninstaller->>User: Success message for desktop file and icon
else Icon not removed
Uninstaller->>User: Warning message for icon
end
else .desktop file removal failed
Uninstaller->>User: Error message
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 @wjyrich - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `scripts/dde-appwiz-uninstaller.sh:20` </location>
<code_context>
+ echo "Detected user-level desktop file: '$DESKTOP_FILE_PATH'"
+
+ # Read the Icon path from the desktop file
+ ICON_PATH=$(grep "^Icon=" "$DESKTOP_FILE_PATH" 2>/dev/null | cut -d'=' -f2-)
+
+ # For user-level desktop files, just remove the file
</code_context>
<issue_to_address>
Parsing the Icon path may not handle icon themes or relative paths.
The code assumes the Icon entry is a direct file path, but it may be a theme icon name or relative path. Please add logic to handle these cases or document this limitation.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| echo "Detected user-level desktop file: '$DESKTOP_FILE_PATH'" | ||
|
|
||
| # Read the Icon path from the desktop file | ||
| ICON_PATH=$(grep "^Icon=" "$DESKTOP_FILE_PATH" 2>/dev/null | cut -d'=' -f2-) |
There was a problem hiding this comment.
suggestion: Parsing the Icon path may not handle icon themes or relative paths.
The code assumes the Icon entry is a direct file path, but it may be a theme icon name or relative path. Please add logic to handle these cases or document this limitation.
BLumia
left a comment
There was a problem hiding this comment.
浏览器快捷方式的卸载不要走卸载系统软件包的逻辑,毕竟实质上不是一回事。
可以单独加逻辑对浏览器创建的网页快捷方式进行卸载(仅能匹配限定的几个主流浏览器就行),或者暂时搁置这个需求后续我来搞。
1. Added recursive symlink resolution with loop detection for desktop files 2. Implemented special handling for Chrome PWA applications 3. Added cleanup of associated icon files when uninstalling Chrome PWAs 4. Improved error handling and debug logging 5. Added QSet include for tracking visited symlink paths The changes address two main issues: 1. Symlinks to desktop files weren't being properly resolved, which could cause uninstallation failures 2. Chrome Progressive Web Apps created special desktop entries that needed custom uninstallation logic The new symlink resolution handles nested symlinks safely while preventing infinite loops, and the Chrome PWA handling ensures proper cleanup of both desktop entries and their icons. fix: 改进符号链接解析和 Chrome PWA 处理 1. 为桌面文件添加了带循环检测的递归符号链接解析 2. 实现了对 Chrome PWA 应用的特殊处理 3. 卸载 Chrome PWA 时添加了关联图标文件的清理 4. 改进了错误处理和调试日志 5. 添加了 QSet 包含用于跟踪访问过的符号链接路径 这些更改解决了两个主要问题: 1. 桌面文件的符号链接未被正确解析,可能导致卸载失败 2. Chrome 渐进式网页应用创建的特殊桌面条目需要自定义卸载逻辑 新的符号链接解析功能安全地处理嵌套符号链接同时防止无限循环,而 Chrome PWA 处理确保正确清理桌面条目及其关联图标 Pms: BUG-315791
deepin pr auto review关键摘要:
是否建议立即修改:
建议的修改:
|
|
TAG Bot New tag: 0.1.19 |
|
TAG Bot New tag: 0.1.20 |
|
TAG Bot New tag: 0.1.21 |
feat: 在卸载程序中添加用户级桌面文件处理
Pms: BUG-315791
Summary by Sourcery
Add special handling to the uninstaller for user-level desktop files by detecting and removing them along with any associated icons, while preserving existing system-wide logic and enhancing cleanup of user-installed applications
New Features:
Enhancements: