Skip to content

Conversation

@LiHua000
Copy link
Contributor

@LiHua000 LiHua000 commented Jan 5, 2026

control the version of watermark

Log: as title

Summary by Sourcery

Adjust watermark feature version range to maintain compatibility with specific DTK versions.

Bug Fixes:

  • Fix build failure caused by incorrect DTK watermark API version range checks.

Build:

  • Update DTK version condition to exclude versions with incompatible watermark interfaces while supporting 5.6.8.10.

control the version of watermark

Log: as title
@sourcery-ai
Copy link

sourcery-ai bot commented Jan 5, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjusts the DTK version range used to detect the custom watermark API to avoid a build-time mismatch with newer DTK versions, while documenting the special-case version that still provides the struct-based watermark interface.

File-Level Changes

Change Details Files
Tighten the DTK version range condition used to select the struct-based custom watermark implementation.
  • Update preprocessor condition to cap the upper DTK version bound at 5.6.8.10 instead of 5.6.9.0
  • Extend the surrounding comment to document that version 5.6.8.10 also exposes the watermark interface
src/main.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

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 - I've found 1 issue, and left some high level feedback:

  • The updated condition DTK_VERSION < DTK_VERSION_CHECK(5, 6, 8, 10) excludes 5.6.8.10, which contradicts the new comment stating that 5.6.8.10 also has the interface; consider adjusting the comparison (e.g., <= 5.6.8.10 or keeping < 5.6.9.0) so the code matches the intent.
  • To make this version logic easier to maintain and reason about, consider extracting the DTK version range into a helper function or named constants instead of embedding the boundary checks directly in the preprocessor condition.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The updated condition `DTK_VERSION < DTK_VERSION_CHECK(5, 6, 8, 10)` excludes 5.6.8.10, which contradicts the new comment stating that 5.6.8.10 also has the interface; consider adjusting the comparison (e.g., `<= 5.6.8.10` or keeping `< 5.6.9.0`) so the code matches the intent.
- To make this version logic easier to maintain and reason about, consider extracting the DTK version range into a helper function or named constants instead of embedding the boundary checks directly in the preprocessor condition.

## Individual Comments

### Comment 1
<location> `src/main.cpp:65-66` </location>
<code_context>
     // 主线水印接口在 5.6.9 之后引入.
-    // 因此,判断定制线:存在水印接口,版本不低于 5.4.42.7 且低于 5.6.9
-#if DTK_VERSION_CHECK(5, 4, 42, 7) <= DTK_VERSION && DTK_VERSION < DTK_VERSION_CHECK(5, 6, 9, 0)
+    // 因此,判断定制线:存在水印接口,版本不低于 5.4.42.7 且低于 5.6.9(部分镜像上存在5.6.8.10版本,也存在该接口)
+#if DTK_VERSION_CHECK(5, 4, 42, 7) <= DTK_VERSION && DTK_VERSION < DTK_VERSION_CHECK(5, 6, 8, 10)
     //接口变动为结构体
     data.text = mapwaterMark.value("text").toString();
</code_context>

<issue_to_address>
**issue (bug_risk):** Version range condition likely excludes 5.6.8.10 despite the comment claiming support.

The condition `DTK_VERSION < DTK_VERSION_CHECK(5, 6, 8, 10)` excludes 5.6.8.10, even though the comment says this version has the watermark interface. Previously, `< DTK_VERSION_CHECK(5, 6, 9, 0)` included 5.6.8.10. If 5.6.8.10 should be handled, consider `<= DTK_VERSION_CHECK(5, 6, 8, 10)` or otherwise adjust the bounds so they match the intended supported versions and the comment.
</issue_to_address>

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.

@LiHua000
Copy link
Contributor Author

LiHua000 commented Jan 6, 2026

/merge

@deepin-bot deepin-bot bot merged commit 04d1a34 into linuxdeepin:release/eagle Jan 6, 2026
14 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.

2 participants