Skip to content

fix(build): add missing sources and includes to qmake pri files - #355

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
add-uos:fix-qmake-build-missing-sources
Sep 1, 2026
Merged

fix(build): add missing sources and includes to qmake pri files#355
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
add-uos:fix-qmake-build-missing-sources

Conversation

@add-uos

@add-uos add-uos commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

问题

新增的护眼模块(eyeprotection)和 RestoreTipWidget 只更新了 CMakeLists.txt,qmake 工程文件(.pri)缺失对应源文件与头文件搜索路径,导致 qmake 构建失败:

  • 编译错误:fatal error: EyeProtectionManager.h: No such file or directory
  • 链接错误:undefined reference to RestoreTipWidget::*

修改内容

文件 改动
reader/eyeprotection/eyeprotection.pri 新增,声明护眼模块源文件与头文件
reader/src.pri 增加 eyeprotection 的 INCLUDEPATH 并 include 其 pri
reader/widgets/widgets.pri 补上遗漏的 RestoreTipWidget.h/.cpp
reader/document/document.pri xps_support 条件块补上遗漏的 XpsTextExtractor.h/.cpp(隐患预防)

已对全部 7 个模块目录与 pri 列表做全量比对,无其他遗漏。

自测

deb-builder-launcher.sh ll 构建通过(4分2秒),产物 layer 导出成功。

【版本号】:deepin-reader > 6.5.60
【自测环境镜像版本】:V25
【代码地址】:本 PR
【根因分析】:新增文件只更新了 CMake 通配符自动收录的 CMakeLists.txt,漏改了 qmake 手写显式列表的 .pri 文件
【影响范围】:仅影响 qmake 构建,不改变代码逻辑
【自测结果截图/视频】:通过,见备注
【自测架构】: x86

Summary by Sourcery

Update qmake project files so all required reader modules, headers, and sources are included during builds.

Bug Fixes:

  • Fix qmake builds by registering the eye-protection module and previously omitted widget and XPS source files in the project configuration.

Build:

  • Complete qmake include paths and source/header lists for newly added and conditionally compiled components.

New eyeprotection module and RestoreTipWidget were added to CMakeLists
but missing from qmake pri files, causing build and link failure.
Also add XpsTextExtractor to the xps_support conditional block.

新增护眼模块与RestoreTipWidget时只更新了CMakeLists.txt,
qmake工程缺失对应源文件与头文件搜索路径,导致编译链接失败。
同时补全xps_support条件编译块中遗漏的XpsTextExtractor。

Log: 修复qmake工程缺失新模块文件导致的构建失败
Influence: qmake构建恢复正常,可正确编译护眼模块、RestoreTipWidget
及XPS文本提取器。
@sourcery-ai

sourcery-ai Bot commented Sep 1, 2026

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

Reviewer's Guide

Fixes qmake builds by synchronizing manually maintained pri files with the newly added eye-protection, RestoreTipWidget, and XPS text-extractor files; no runtime logic changes are introduced.

File-Level Changes

Change Details Files
Register the eye-protection module in the qmake build graph, including its implementation files and local header search path.
  • Add a dedicated pri file listing EyeProtectionManager and EyeProtectionAction headers and sources.
  • Expose the module include directory and include the new pri from the reader project configuration.
reader/eyeprotection/eyeprotection.pri
reader/src.pri
Complete qmake source and header registration for widgets and conditionally built XPS support.
  • Add RestoreTipWidget declarations and implementation to the widget lists.
  • Add XpsTextExtractor declarations and implementation under the xps_support condition.
reader/widgets/widgets.pri
reader/document/document.pri

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 reviewed your changes and they look great!


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
Copy Markdown

deepin pr auto review

🤖 AI 代码审查报告

总体评分: 99 分 (通过阈值: 70分)

Pass


📊 总体评价

项目 结果
审查结论 代码审查通过
评分详情 本次 PR 修复 qmake 构建配置缺失问题,新增护眼模块和 RestoreTipWidget 的源文件声明及头文件搜索路径。变更内容为纯构建配置文件(.pri),语法正确、逻辑清晰、无安全漏洞。代码结构遵循项目既有模式,变更最小化且聚焦。
项目名称 linuxdeepin/deepin-reader
PR 地址 #355
提交 SHA bb2aae5
分析模式 全量分析

📝 代码变更概要

本次 PR 修复 qmake 构建配置缺失问题,共修改 4 个 .pri 文件(新增 15 行,删除 0 行):

文件 变更说明
reader/document/document.pri 在 xps_support 条件块中补充遗漏的 XpsTextExtractor.h/.cpp(隐患预防)
reader/eyeprotection/eyeprotection.pri 新增文件,声明护眼模块 EyeProtectionManager 和 EyeProtectionAction 的源文件与头文件
reader/src.pri 增加 eyeprotection 的 INCLUDEPATH 并 include 其 pri 文件
reader/widgets/widgets.pri 补充遗漏的 RestoreTipWidget.h/.cpp

🔍 详细分析

1. 语法逻辑 ✅

评分: 25/25 ✓ 通过

评价词: 语法正确,逻辑清晰

潜在问题:
✅ 未发现明显问题

分析说明:

  • qmake .pri 语法全部正确:HEADERS +=SOURCES +=INCLUDEPATH +=include() 均为合法 qmake 指令
  • 行继续符(\)使用正确
  • $$PWD 变量使用正确,指向当前 .pri 文件所在目录
  • xps_support 条件块结构正确,新增文件正确放置在条件块内
  • 新增的 eyeprotection.pri 文件结构与项目中其他模块 .pri 文件一致

2. 代码质量 ✅

评分: 24/25 ✓ 通过

评价词: 代码结构清晰

潜在问题:

  1. reader/eyeprotection/eyeprotection.pri(新文件):缺少模块说明注释。虽然 .pri 文件通常不需要注释,但添加简要模块说明有助于后续维护。

建议:

  • 建议在新文件 eyeprotection.pri 头部添加一行注释说明模块用途,如 # Eye Protection module - sources and headers

分析说明:

  • 变更最小化且聚焦,仅添加必要的源文件声明和头文件搜索路径
  • 新文件 eyeprotection.pri 遵循项目既有 .pri 文件的结构模式
  • INCLUDEPATH 在 src.prieyeprotection.pri 中均有设置,这是 qmake 标准做法(模块自包含 + 父文件引用),非重复代码
  • 无残留调试代码,无敏感注释

3. 代码性能 ✅

评分: 20/20 ✓ 通过

评价词: 性能良好,资源使用合理

潜在问题:
✅ 未发现明显问题

分析说明:

  • 本次变更为构建配置文件(.pri),无运行时性能影响
  • 无算法复杂度问题
  • 无资源使用不当

4. 代码安全 🔒

评分: 30/30 ✓ 通过

存在0个安全漏洞

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个

安全漏洞详情:
✅ 未发现安全漏洞

安全扫描工具结果说明:

安全扫描器报告了 3 个"高危路径遍历"告警,经 AI 审计全部判定为误报

文件 行号 告警类型 判定 原因
reader/src.pri 29 路径遍历 误报 $$PWD/../resources/ 是 qmake 内置变量引用同级目录,非用户输入。该行不属于本次 PR 变更。
reader/src.pri 33 路径遍历 误报 $$PWD/../3rdparty/ 是引用第三方库目录的标准 qmake 写法,非用户输入。该行不属于本次 PR 变更。
reader/src.pri 34 路径遍历 误报 LIBS += -L$$PWD/../3rdparty/ 是链接第三方库的标准 qmake 写法,非用户输入。该行不属于本次 PR 变更。

OCR 审查结果: 0 条评论,"Looks good to me."

分析说明:

  • 本次 PR 变更不涉及用户输入处理
  • 无硬编码密钥或敏感信息
  • 无命令注入风险(qmake 变量展开在构建时由开发者控制)
  • 无缓冲区溢出风险
  • 无路径遍历风险($$PWD 是构建时变量,非运行时用户输入)

💡 改进建议

# reader/eyeprotection/eyeprotection.pri
# Eye Protection module - sources and headers

HEADERS += \
    $$PWD/EyeProtectionManager.h \
    $$PWD/EyeProtectionAction.h

SOURCES += \
    $$PWD/EyeProtectionManager.cpp \
    $$PWD/EyeProtectionAction.cpp

INCLUDEPATH += $$PWD

📋 审查清单

审查项 结果
语法逻辑 - 无编译错误、无内存泄漏、无空指针风险
语法逻辑 - 边界条件处理完善、异常捕获完整
代码质量 - 关键函数有注释、无大量重复代码
代码质量 - 无残留调试代码、敏感信息已清理
代码性能 - 算法复杂度合理、无频繁系统调用
代码性能 - 资源及时释放、无不必要的内存拷贝
代码安全 - 用户输入已校验、无命令/SQL注入风险
代码安全 - 无硬编码密钥、无敏感信息泄露
代码安全 - 缓冲区操作有边界检查、文件路径已净化

本报告由 AI 代码审查工具自动生成
扫描时间:2026-09-01 12:10:00

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: add-uos, lzwind

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

@add-uos

add-uos commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

/merge

@deepin-bot
deepin-bot Bot merged commit 526ae4a into linuxdeepin:master Sep 1, 2026
9 checks passed
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