Skip to content

feat: move dde-session-shell.conf to /var/lib/dde-session-shell for V25#74

Merged
Ivy233 merged 1 commit into
linuxdeepin:masterfrom
Ivy233:bugfix/BUG-356947
Jul 14, 2026
Merged

feat: move dde-session-shell.conf to /var/lib/dde-session-shell for V25#74
Ivy233 merged 1 commit into
linuxdeepin:masterfrom
Ivy233:bugfix/BUG-356947

Conversation

@Ivy233

@Ivy233 Ivy233 commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

将 dde-session-shell.conf 从 /usr/share/dde-session-shell 迁移到 /var/lib/dde-session-shell。 仅对 ENABLE_DSS_SNIPE (V25) 生效,V20 保持原有 /usr/share/dde-session-shell 路径不变。 通过条件编译区分:CMakeLists.txt 使用 if(DDE_SESSION_SHELL_SNIPE), constants.h 使用 #ifdef ENABLE_DSS_SNIPE。

Log: 将 dde-session-shell.conf 迁移到 /var/lib/dde-session-shell (仅 V25)
PMS: BUG-356947

Summary by Sourcery

Move dde-session-shell.conf to /var/lib/dde-session-shell when DSS snipe is enabled while keeping the existing path otherwise, and align configuration lookup comments with the new conditional paths.

Enhancements:

  • Add conditional install path for dde-session-shell.conf based on DDE_SESSION_SHELL_SNIPE/ENABLE_DSS_SNIPE.
  • Update session_ui_configs to use the appropriate dde-session-shell.conf location depending on build configuration.
  • Clarify greeter tips window comments to reference session_ui_configs rather than a hardcoded configuration path.

@sourcery-ai

sourcery-ai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Conditionally relocate dde-session-shell.conf from /usr/share/dde-session-shell to /var/lib/dde-session-shell for V25 builds, and make the runtime config lookup respect that conditional path while keeping V20 behavior unchanged.

File-Level Changes

Change Details Files
Make installation path of dde-session-shell.conf depend on DDE_SESSION_SHELL_SNIPE (V25 vs V20).
  • Wrap install() of dde-session-shell.conf in a CMake if(DDE_SESSION_SHELL_SNIPE) / else() block.
  • Use /var/lib/dde-session-shell/ as the destination when DDE_SESSION_SHELL_SNIPE is enabled.
  • Retain ${CMAKE_INSTALL_DATADIR}/dde-session-shell/ as the destination when DDE_SESSION_SHELL_SNIPE is disabled.
CMakeLists.txt
Align runtime config lookup paths with the new conditional install location.
  • Guard dde-session-shell.conf path in session_ui_configs with #ifdef ENABLE_DSS_SNIPE to choose /var/lib/dde-session-shell or /usr/share/dde-session-shell.
  • Update comments in LoginTipsWindow to describe reading dde-session-shell.conf via session_ui_configs rather than a hard-coded /usr/share path.
src/global_util/constants.h
src/lightdm-deepin-greeter/logintipswindow.cpp

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The build option name (DDE_SESSION_SHELL_SNIPE) and the C/C++ macro (ENABLE_DSS_SNIPE) differ; consider aligning them or clearly wiring them together in CMake to avoid configuration drift or confusion.
  • The path to dde-session-shell.conf is now hardcoded in both CMakeLists.txt and constants.h; consider centralizing this path in a single configuration mechanism to reduce the chance of future mismatches between install location and runtime lookup.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The build option name (DDE_SESSION_SHELL_SNIPE) and the C/C++ macro (ENABLE_DSS_SNIPE) differ; consider aligning them or clearly wiring them together in CMake to avoid configuration drift or confusion.
- The path to dde-session-shell.conf is now hardcoded in both CMakeLists.txt and constants.h; consider centralizing this path in a single configuration mechanism to reduce the chance of future mismatches between install location and runtime lookup.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

将 dde-session-shell.conf 从 /usr/share/dde-session-shell 迁移到 /var/lib/dde-session-shell。
仅对 ENABLE_DSS_SNIPE (V25) 生效,V20 保持原有 /usr/share/dde-session-shell 路径不变。
通过条件编译区分:CMakeLists.txt 使用 if(DDE_SESSION_SHELL_SNIPE),
constants.h 使用 #ifdef ENABLE_DSS_SNIPE。

Log: 将 dde-session-shell.conf 迁移到 /var/lib/dde-session-shell (仅 V25)
PMS: BUG-356947
@Ivy233 Ivy233 force-pushed the bugfix/BUG-356947 branch from 07557c1 to bec3cdf Compare July 13, 2026 09:54
deepin-ci-robot added a commit to linuxdeepin/dde-session-shell-snipe that referenced this pull request Jul 13, 2026
Synchronize source files from linuxdeepin/dde-session-shell.

Source-pull-request: linuxdeepin/dde-session-shell#74
@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

★ 总体评分:95分

■ 【总体评价】

代码通过条件编译和CMake变量实现了配置文件安装路径的动态切换,修复了路径硬编码问题
逻辑清晰且修复了注释与代码不一致的问题,但CMake变量与C++宏的联动需确保正确

■ 【详细分析】

  • 1.语法逻辑(基本正确)✓

CMakeLists.txt使用if (DDE_SESSION_SHELL_SNIPE)控制安装路径,constants.h使用#ifdef ENABLE_DSS_SNIPE控制读取路径,logintipswindow.cpp更新了注释。语法均正确。
潜在问题:CMakeLists.txt中的变量DDE_SESSION_SHELL_SNIPEconstants.h中的宏ENABLE_DSS_SNIPE名称不一致,若CMake中未正确将变量转换为宏定义传递给编译器,将导致安装路径与读取路径不匹配的严重逻辑错误。
建议:确认CMakeLists.txt中存在类似add_compile_definitions(ENABLE_DSS_SNIPE)target_compile_definitions(... PRIVATE ENABLE_DSS_SNIPE)的逻辑,确保两者联动正确。

  • 2.代码质量(良好)✓

修改了logintipswindow.cpp中硬编码路径的注释,改为引用session_ui_configs,提高了注释的可维护性。条件编译结构清晰。
潜在问题:版权年份更新为2026,当前年份通常为2024,存在超前或笔误嫌疑。
建议:核实版权年份是否应为当前年份。

  • 3.代码性能(无性能问题)✓

修改仅涉及编译期条件分支和安装路径配置,不影响运行时性能。
潜在问题:无
建议:无需优化

  • 4.代码安全(存在0个安全漏洞)✓

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个
本次修改仅涉及路径字符串变更和注释更新,不存在外部输入处理,未引入安全漏洞。
建议:无

■ 【改进建议代码示例】

# CMakeLists.txt 中确保变量与宏联动
if (DDE_SESSION_SHELL_SNIPE)
    install(FILES files/dde-session-shell.conf DESTINATION /var/lib/dde-session-shell/)
    add_compile_definitions(ENABLE_DSS_SNIPE)
else()
    install(FILES files/dde-session-shell.conf DESTINATION ${CMAKE_INSTALL_DATADIR}/dde-session-shell/)
endif()

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: fly602, Ivy233

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Ivy233 Ivy233 merged commit 5bc6eb9 into linuxdeepin:master Jul 14, 2026
18 checks passed
Ivy233 pushed a commit to linuxdeepin/dde-session-shell-snipe that referenced this pull request Jul 14, 2026
Synchronize source files from linuxdeepin/dde-session-shell.

Source-pull-request: linuxdeepin/dde-session-shell#74
@Ivy233 Ivy233 deleted the bugfix/BUG-356947 branch July 14, 2026 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants