Skip to content

Bugfix/pms 370701 - #1680

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
xujin177:bugfix/PMS-370701
Jul 30, 2026
Merged

Bugfix/pms 370701#1680
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
xujin177:bugfix/PMS-370701

Conversation

@xujin177

@xujin177 xujin177 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

fix: handle QDBusArgument type in hint conversion
Add support for QDBusArgument image data when converting notification
hints to strings, preventing serialization failures for notifications
containing image hints via D-Bus.

Log: Fixed notification hint serialization for image data

Influence:

  1. Test notifications with image data sent via D-Bus
  2. Verify hint string conversion for various data types
  3. Ensure compatibility with existing notification handling
  4. Test edge cases with empty or invalid QDBusArgument data

fix: 处理提示转换中的 QDBusArgument 类型

当将通知提示转换为字符串时,增加对 QDBusArgument 图像数据的支持,防止包
含通过 D-Bus 传递的图像提示的通知出现序列化失败的问题。

Log: 修复了图像数据的通知提示序列化问题

Influence:

  1. 测试通过 D-Bus 发送带图像数据的通知
  2. 验证各种数据类型的提示字符串转换
  3. 确保与现有通知处理的兼容性
  4. 测试空或无效 QDBusArgument 数据的边界情况

PMS: BUG-370701

@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.

Sorry @xujin177, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@github-actions

Copy link
Copy Markdown

TAG Bot

TAG: 2.0.52
EXISTED: no
DISTRIBUTION: unstable

@deepin-ci-robot

Copy link
Copy Markdown

Hi @xujin177. Thanks for your PR.

I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@sourcery-ai

sourcery-ai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Reviewer's Guide

Refactors notification icon resolution into NotifyEntity, adjusts QML plugin/appalet wiring for the notification center, and fixes several integration issues including DBus image decoding and docking keyboard interactivity.

Sequence diagram for notification state updates through QML NotifyAccessor

sequenceDiagram
    actor User
    participant Panel as Panel_visible
    participant QML as DS_applet_notificationserver
    participant Accessor as NotifyAccessor

    User->>Panel: toggle visible
    Panel->>Accessor: Binding enabled = Panel.visible

    Panel->>QML: DS.applet("org.deepin.ds.notificationserver")
    Panel->>Accessor: Binding dataUpdater = DS.applet(...)

    QML-->>Accessor: onNotificationStateChanged(id, processedType)
    Accessor->>Accessor: onNotificationStateChanged(id, processedType)
    Accessor-->>Accessor: entityReceived(id)
    Accessor-->>Accessor: stagingEntityClosed(id)
Loading

File-Level Changes

Change Details Files
Move notification icon resolution logic (including DBus image decoding and base64 handling) from BubbleItem into NotifyEntity and expose it via appIconResolved().
  • Removed image decoding helpers and imagePathOfNotification() from BubbleItem and replaced BubbleItem::appIcon() to use NotifyEntity::appIconResolved().
  • Added QImage/QBuffer/QDBusArgument/QRegularExpression includes and reimplemented copyLineRGB32, copyLineARGB32, decodeImageFromDBusArgument(), decodeImageToBase64(), and imagePathOfNotification() in notifyentity.cpp with minor safety improvements.
  • Introduced NotifyEntity::appIconResolved() that first consults hints for image-data/icon_data/desktop-entry, then falls back to the plain appIcon, returning a base64 data URI when appropriate.
  • Updated NotifyModel and NotifyStagingModel to use appIconResolved() instead of appIcon() for NotifyIconName role.
  • Extended convertHintsToString() to serialize QDBusArgument-encoded images into base64 data URIs.
panels/notification/bubble/bubbleitem.cpp
panels/notification/common/notifyentity.cpp
panels/notification/common/notifyentity.h
panels/notification/center/notifymodel.cpp
panels/notification/center/notifystagingmodel.cpp
Decouple the notification center QML plugin from the dde-shell applet and move runtime wiring into QML, introducing a separate applet library target.
  • Changed the QML module target name to notificationcenterpanelplugin, marked it SHARED, and moved the C++ plugin sources into the qt_add_qml_module(SOURCES) list.
  • Added a new notificationcenterapplet SHARED library containing the panel/proxy/dbus adaptor implementation and linked it separately from the QML plugin.
  • Adjusted resource and target_link_libraries calls to use notificationcenterpanelplugin and notificationcenterapplet where appropriate.
  • Updated installation to install the QML plugin target and package the notificationcenterapplet via ds_install_package().
panels/notification/center/CMakeLists.txt
Rewire NotifyAccessor lifecycle and connections so that its state and notification updates are driven from QML rather than from the C++ NotificationCenterPanel.
  • Removed DataAccessorProxy and NotifyAccessor usage/connection setup from NotificationCenterPanel::init() and visibility handling.
  • Changed NotifyAccessor to inherit QObject properly, use DataAccessorProxy::instance() in its singleton initializer, and add QML-exposed properties enabled and dataUpdater with change notifications.
  • Made setDataUpdater() and setEnabled() early-return on no-op and emit their corresponding signals when changed.
  • Exposed onNotificationStateChanged() as a Q_INVOKABLE slot instead of a private slot and kept the early-enabled check.
  • Added QML bindings in notification center main.qml to keep NotifyAccessor.enabled in sync with Panel.visible and NotifyAccessor.dataUpdater bound to the notificationserver applet, and established a QML-side Connections block to forward notificationStateChanged() to NotifyAccessor.onNotificationStateChanged().
panels/notification/center/notificationcenterpanel.cpp
panels/notification/center/notifyaccessor.cpp
panels/notification/center/notifyaccessor.h
panels/notification/center/package/main.qml
Adjust dock window keyboard interactivity and ensure notification shared library links against QtGui for image handling.
  • Changed dock package main window KeyboardInteractivity from OnDemand to None in order to alter dock focus/keyboard behavior.
  • Added Qt::Gui to ds-notification-shared target_link_libraries so that image-related code (QImage, etc.) links correctly.
panels/dock/package/main.qml
panels/notification/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

@xujin177
xujin177 force-pushed the bugfix/PMS-370701 branch 2 times, most recently from 455ad7b to 8ac7fd0 Compare July 30, 2026 02:03
Add support for QDBusArgument image data when converting notification
hints to strings, preventing serialization failures for notifications
containing image hints via D-Bus.

Log: Fixed notification hint serialization for image data

Influence:
1. Test notifications with image data sent via D-Bus
2. Verify hint string conversion for various data types
3. Ensure compatibility with existing notification handling
4. Test edge cases with empty or invalid QDBusArgument data

fix: 处理提示转换中的 QDBusArgument 类型

当将通知提示转换为字符串时,增加对 QDBusArgument 图像数据的支持,防止包
含通过 D-Bus 传递的图像提示的通知出现序列化失败的问题。

Log: 修复了图像数据的通知提示序列化问题

Influence:
1. 测试通过 D-Bus 发送带图像数据的通知
2. 验证各种数据类型的提示字符串转换
3. 确保与现有通知处理的兼容性
4. 测试空或无效 QDBusArgument 数据的边界情况

PMS: BUG-370701
@xujin177
xujin177 force-pushed the bugfix/PMS-370701 branch from 8ac7fd0 to 68931b8 Compare July 30, 2026 02:13
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, xujin177

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

@xujin177

Copy link
Copy Markdown
Contributor Author

/merge

@deepin-bot

deepin-bot Bot commented Jul 30, 2026

Copy link
Copy Markdown

This pr cannot be merged! (status: blocked)

@xujin177

Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot

deepin-bot Bot commented Jul 30, 2026

Copy link
Copy Markdown

This pr force merged! (status: blocked)

@deepin-bot
deepin-bot Bot merged commit e911bc3 into linuxdeepin:master Jul 30, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants