Skip to content

Conversation

@myk1343
Copy link
Contributor

@myk1343 myk1343 commented Apr 14, 2025

适配103x编译

task: https://pms.uniontech.com/task-view-365161.html
Log: 适配103x编译

适配103x编译

task: https://pms.uniontech.com/task-view-365161.html
Log: 适配103x编译
@deepin-ci-robot
Copy link

deepin pr auto review

代码审查意见:

  1. 代码格式和风格

    • #if#else条件编译块中,connect语句的缩进不一致。建议统一缩进,保持代码整洁。
  2. 条件编译的使用

    • 使用条件编译来处理不同版本的DTK库是合理的,但应确保在所有情况下都有适当的处理逻辑。如果DTK_VERSION小于5.4.10.0,代码中缺少对paintRequestSync函数的声明和定义,可能会导致编译错误。
  3. 信号和槽的连接

    • #else分支中,使用了SIGNALSLOT宏来连接信号和槽,这是Qt4的写法。如果项目使用的是Qt5或更高版本,建议使用connect函数的现代语法。
  4. 代码可读性

    • #if#else条件编译块中,connect语句的重复部分较多,可以考虑提取公共代码块以提高可读性。
  5. 错误处理

    • #else分支中,如果paintRequestSync函数没有正确实现,可能会导致未定义行为。应确保该函数在所有情况下都能正确处理传入的参数。
  6. 资源管理

    • DPrintPreviewDialog对象在函数结束时会被销毁,但如果exec()返回值是QDialog::Rejected,则可能需要手动释放资源。

综合以上意见,建议对代码进行如下修改:

#if DTK_VERSION > DTK_VERSION_CHECK(5, 4, 10, 0)
    connect(&printDialog,
            QOverload<DPrinter *, const QVector<int> &>::of(&DPrintPreviewDialog::paintRequested),
            this,
            &QuickPrintPrivate::asyncPrint);
#else
    connect(&printDialog, SIGNAL(paintRequested(DPrinter *)),
            this, SLOT(paintRequestSync(DPrinter *)));
#endif

并确保paintRequestSync函数在所有情况下都有正确的实现,并且在#else分支中处理所有可能的错误情况。

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: max-lvs, myk1343

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

@max-lvs max-lvs merged commit ea9338f into linuxdeepin:develop/eagle Apr 14, 2025
18 of 20 checks passed
@myk1343 myk1343 deleted the uploadcode branch May 9, 2025 08:39
lichaofan2008 pushed a commit to lichaofan2008/image-editor that referenced this pull request Dec 19, 2025
deepin-bot bot pushed a commit that referenced this pull request Dec 23, 2025
适配103x编译

task: https://pms.uniontech.com/task-view-365161.html
Log: 适配103x编译

v20 BUG 分支合一到v25主线
Task: https://pms.uniontech.com/task-view-383475.html
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