Skip to content

Conversation

@pengfeixx
Copy link
Contributor

Added XPS format support

Log: Added XPS format support

Added XPS format support

Log: Added XPS format support
@deepin-ci-robot
Copy link

deepin pr auto review

代码审查意见:

  1. CMakeLists.txt:

    • CMakeLists.txt中添加了XPS_SUPPORT选项,但没有对应的注释说明其用途和作用。建议添加注释来解释这个选项的用途。
  2. deepin_reader.pro:

    • deepin_reader.pro中添加了xps_support配置,但没有对应的注释说明其用途和作用。建议添加注释来解释这个配置的用途。
  3. Application.cpp:

    • Application.cpp中,setApplicationDescription函数根据XPS_SUPPORT_ENABLED宏定义来设置应用程序描述。建议将这段代码封装成一个函数,以提高代码的可读性和可维护性。
  4. Global.cpp:

    • Global.cpp中,fileType函数根据XPS_SUPPORT_ENABLED宏定义来处理.xps文件和application/vnd.ms-xpsdocument MIME类型。建议将这段代码封装成一个函数,以提高代码的可读性和可维护性。
  5. Global.h:

    • Global.h中,FileType枚举根据XPS_SUPPORT_ENABLED宏定义来添加XPS类型。建议将这段代码封装成一个宏定义,以提高代码的可读性和可维护性。
  6. Model.cpp:

    • Model.cpp中,getDocument函数根据XPS_SUPPORT_ENABLED宏定义来处理XPS文件类型。建议将这段代码封装成一个函数,以提高代码的可读性和可维护性。
  7. XpsDocument.cpp:

    • XpsDocument.cpp中,XpsDocument类实现了对XPS文件的支持,包括解析、渲染和属性获取等功能。代码较长,建议将一些功能拆分成独立的函数,以提高代码的可读性和可维护性。
  8. XpsDocument.h:

    • XpsDocument.h中,XpsPageData结构体和XpsPage类定义了XPS页面的数据结构和操作方法。建议添加注释来解释每个成员变量的用途。
  9. document.pri:

    • document.pri中,根据xps_support配置来包含或排除XpsDocument.hXpsDocument.cpp文件。建议添加注释来解释这个配置的用途。
  10. Central.cpp:

    • Central.cpp中,addFilesWithDialog函数根据XPS_SUPPORT_ENABLED宏定义来设置文件对话框的文件过滤器。建议将这段代码封装成一个函数,以提高代码的可读性和可维护性。
  11. CentralDocPage.cpp:

    • CentralDocPage.cpp中,addFileAsync函数根据XPS_SUPPORT_ENABLED宏定义来处理文件类型。建议将这段代码封装成一个函数,以提高代码的可读性和可维护性。
  12. CentralNavPage.cpp:

    • CentralNavPage.cpp中,CentralNavPage类的构造函数根据XPS_SUPPORT_ENABLED宏定义来设置格式支持的标签文本。建议将这段代码封装成一个函数,以提高代码的可读性和可维护性。

总体来说,代码中添加了对XPS文件格式的支持,但需要进一步优化代码结构和注释,以提高代码的可读性和可维护性。

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: lzwind, pengfeixx

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

@pengfeixx pengfeixx merged commit d7bf224 into linuxdeepin:master Aug 15, 2025
6 checks passed
@pengfeixx pengfeixx deleted the xpssupport branch August 15, 2025 08:50
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