Skip to content

Conversation

@18202781743
Copy link
Contributor

@18202781743 18202781743 commented Aug 6, 2025

  1. Removed NoDisplay app filtering in
    NotificationSetting::appItemsImpl() to ensure all apps are processed
  2. Added debug log in NotificationManager::Notify() to track when app
    names are translated from AM
  3. This fixes an issue where applications marked as NoDisplay were not
    being translated in the notification system

The change ensures that translation works for all applications
regardless of their NoDisplay status, while maintaining debug visibility
into translation operations.

fix: 处理通知设置中的NoDisplay应用

  1. 移除了NotificationSetting::appItemsImpl()中对NoDisplay应用的过滤,确
    保所有应用都被处理
  2. 在NotificationManager::Notify()中添加了调试日志,用于跟踪何时从AM翻译
    应用名称
  3. 修复了标记为NoDisplay的应用在通知系统中未被翻译的问题

此更改确保无论应用的NoDisplay状态如何,翻译都能正常工作,同时保持对翻译
操作的调试可见性。

Summary by Sourcery

Restore processing of NoDisplay apps in notification settings and add debug logging for app name translations to ensure translations apply universally.

Bug Fixes:

  • Fix missing notification translation for applications marked as NoDisplay by removing their filtering from appItemsImpl.

Enhancements:

  • Add debug log in NotificationManager::Notify to track when app names are translated from the application manager.

1. Removed NoDisplay app filtering in
NotificationSetting::appItemsImpl() to ensure all apps are processed
2. Added debug log in NotificationManager::Notify() to track when app
names are translated from AM
3. This fixes an issue where applications marked as NoDisplay were not
being translated in the notification system

The change ensures that translation works for all applications
regardless of their NoDisplay status, while maintaining debug visibility
into translation operations.

fix: 处理通知设置中的NoDisplay应用

1. 移除了NotificationSetting::appItemsImpl()中对NoDisplay应用的过滤,确
保所有应用都被处理
2. 在NotificationManager::Notify()中添加了调试日志,用于跟踪何时从AM翻译
应用名称
3. 修复了标记为NoDisplay的应用在通知系统中未被翻译的问题

此更改确保无论应用的NoDisplay状态如何,翻译都能正常工作,同时保持对翻译
操作的调试可见性。
@sourcery-ai
Copy link

sourcery-ai bot commented Aug 6, 2025

Reviewer's Guide

This change removes the NoDisplay filter in appItemsImpl to ensure all applications are processed for notifications and adds a debug log in Notify to trace when app names are translated, fixing missing translations for NoDisplay-marked apps.

Sequence diagram for Notify with translated app name and debug log

sequenceDiagram
    participant NotificationManager
    participant NotificationSetting
    NotificationManager->>NotificationSetting: appValue(appId, AppName)
    alt AppName is not empty
        NotificationManager->>NotificationManager: Log debug message (AppName is translated)
        NotificationManager->>NotificationManager: Use translated app name
    else AppName is empty
        NotificationManager->>NotificationManager: Use original appName
    end
Loading

Class diagram for NotificationSetting and NotificationManager changes

classDiagram
    class NotificationSetting {
        +QList<AppItem> appItemsImpl() const
    }
    class NotificationManager {
        +uint Notify(const QString &appName, uint replacesId, const QString &body, ...)
    }
    NotificationManager --> NotificationSetting : uses
Loading

File-Level Changes

Change Details Files
Include all apps by removing NoDisplay filtering in appItemsImpl
  • Removed retrieval of NoDisplayRole flag
  • Deleted conditional skip of nodisplay apps
  • Adjusted loop to process every app entry
panels/notification/server/notificationsetting.cpp
Add debug logging in Notify for app name translations
  • Inserted qCDebug log in the else branch
  • Logged translated appId to notifyLog
panels/notification/server/notificationmanager.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

@deepin-ci-robot
Copy link

deepin pr auto review

关键摘要:

  • notificationmanager.cpp中新增的日志输出可能会泄露敏感信息,应该避免在日志中记录appId
  • notificationsetting.cpp中的代码删除了检查NoDisplayRole的逻辑,可能会影响应用程序的显示设置。

是否建议立即修改:

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

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

@18202781743 18202781743 merged commit c7790af into linuxdeepin:master Aug 7, 2025
9 of 10 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