Skip to content

Conversation

@deepin-mozart
Copy link
Contributor

@deepin-mozart deepin-mozart commented Nov 6, 2025

should use qt6 lupate instead of qt5

Log:
Change-Id: Ic71413da1f26a2d8e122498704ce5968f0d67cd8

Summary by Sourcery

Update CMakeLists to locate and use the Qt6 lupdate command

Bug Fixes:

  • Fix compile failure by adding lupdate-Qt6 to the find_program search

Enhancements:

  • Specify common Qt6 binary paths for lupdate

should use qt6 lupate instead of qt5

Log:
Change-Id: Ic71413da1f26a2d8e122498704ce5968f0d67cd8
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deepin-mozart

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

The pull request process is described 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

@sourcery-ai
Copy link

sourcery-ai bot commented Nov 6, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Refactors the CMake find_program call to prioritize and locate the Qt6 lupdate executable by extending the search names and adding explicit path hints.

Flow diagram for updated lupdate command search logic in CMake

flowchart TD
    A["Start CMake build (Release mode)"] --> B["For each TS file in translations/"]
    B --> C["find_program LUPDATE_COMMAND with names: lupdate-Qt6, lupdate, lupdate-qt${QT_VERSION_MAJOR}, lupdate-qt4, lupdate-pro"]
    C --> D["Search in paths: /usr/lib/qt6/bin, /usr/bin"]
    D --> E{"LUPDATE_COMMAND found?"}
    E -- Yes --> F["Process TS file"]
    E -- No --> G["CMake FATAL_ERROR: lupdate command not found"]
Loading

File-Level Changes

Change Details Files
Enhanced lupdate discovery for Qt6
  • Inserted lupdate-Qt6 at the top of the NAMES list
  • Added PATHS including /usr/lib/qt6/bin and /usr/bin
  • Retained fallback names for Qt5 and Qt4 compatibility
assets/CMakeLists.txt

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

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes - here's some feedback:

  • Leverage CMake's built-in Qt6 LinguistTools module (find_package(Qt6 COMPONENTS LinguistTools REQUIRED)) to obtain the lupdate executable instead of manual find_program logic.
  • Avoid hardcoding POSIX bin paths (like /usr/lib/qt6/bin); prefer using CMAKE_PREFIX_PATH or Qt6 installation variables for better cross-platform support.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Leverage CMake's built-in Qt6 LinguistTools module (find_package(Qt6 COMPONENTS LinguistTools REQUIRED)) to obtain the lupdate executable instead of manual find_program logic.
- Avoid hardcoding POSIX bin paths (like /usr/lib/qt6/bin); prefer using CMAKE_PREFIX_PATH or Qt6 installation variables for better cross-platform support.

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.

@deepin-ci-robot
Copy link

deepin pr auto review

我来帮你审查这个CMakeLists.txt的改动:

  1. 语法逻辑:
  • 修改后的代码语法正确,CMake命令使用规范
  • find_program命令的参数组织更清晰,使用多行格式提高可读性
  1. 代码质量改进:
  • 优点:
    • 增加了更具体的搜索路径,提高了找到lupdate的概率
    • 按优先级排序搜索名称(Qt6优先)
    • 代码格式更规范,提高了可读性
  • 建议:
    • 可以考虑添加NO_DEFAULT_PATH选项来限制搜索范围,避免找到系统中不合适的版本
  1. 性能改进:
  • 增加了具体的搜索路径(/usr/lib/qt6/bin和/usr/bin),可以减少搜索时间
  • 将Qt6相关的名称放在前面,如果系统使用Qt6可以更快找到
  1. 安全性改进:
  • 建议添加:
    • 对找到的lupdate命令进行版本检查
    • 验证找到的命令是否可执行
    • 可以考虑使用find_package查找Qt,然后使用Qt提供的工具路径

改进建议版本:

find_program(LUPDATE_COMMAND
    NAMES
        lupdate-Qt6
        lupdate
        lupdate-qt${QT_VERSION_MAJOR}
        lupdate-qt4
        lupdate-pro
    PATHS
        /usr/lib/qt6/bin
        /usr/bin
    NO_DEFAULT_PATH
)

if (NOT LUPDATE_COMMAND)
    message(FATAL_ERROR "lupdate command not found")
endif()

# 验证命令是否可执行
if (NOT EXISTS "${LUPDATE_COMMAND}" OR NOT EXECUTABLE "${LUPDATE_COMMAND}")
    message(FATAL_ERROR "lupdate command at ${LUPDATE_COMMAND} is not executable")
endif()

这些改动提高了代码的健壮性和可靠性,同时保持了良好的性能。

@deepin-mozart
Copy link
Contributor Author

/forcemerge

@deepin-bot
Copy link

deepin-bot bot commented Nov 6, 2025

This pr force merged! (status: blocked)

@deepin-bot deepin-bot bot merged commit 7badad1 into linuxdeepin:master Nov 6, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants