fix(plugins): Update sound tray icon when audio card info changes#421
Merged
ComixHe merged 1 commit intolinuxdeepin:masterfrom Jan 29, 2026
Merged
fix(plugins): Update sound tray icon when audio card info changes#421ComixHe merged 1 commit intolinuxdeepin:masterfrom
ComixHe merged 1 commit intolinuxdeepin:masterfrom
Conversation
Log: Update sound tray icon when audio card info changes Pms: BUG-349027 Signed-off-by: ComixHe <heyuming@deepin.org>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideWire the sound tray view to refresh when the audio card information changes so the tray icon stays in sync with current hardware state. Sequence diagram for updating sound tray icon on audio card info changesequenceDiagram
participant AudioHardware
participant SoundModel
participant SoundView
AudioHardware->>SoundModel: audio card info changes
SoundModel-->>SoundModel: updateCardsInfo()
SoundModel-->>SoundView: cardsInfoChanged
SoundView-->>SoundView: refresh()
SoundView-->>SoundView: refreshIcon()
Class diagram for SoundModel and SoundView signal-slot updateclassDiagram
class SoundModel {
+ref() SoundModel
+volumeChanged
+muteStateChanged
+cardsInfoChanged
}
class SoundView {
+SoundView(parent)
+refresh()
+refreshIcon()
}
SoundModel <.. SoundView : observes
SoundModel --> SoundView : volumeChanged -> refresh
SoundModel --> SoundView : muteStateChanged -> refresh
SoundModel --> SoundView : cardsInfoChanged -> refresh
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- For consistency with the other SoundModel signal connections (which use Qt::QueuedConnection) and to avoid potential cross-thread UI updates, consider specifying a connection type for cardsInfoChanged -> refresh as well or documenting why a direct connection is safe here.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- For consistency with the other SoundModel signal connections (which use Qt::QueuedConnection) and to avoid potential cross-thread UI updates, consider specifying a connection type for cardsInfoChanged -> refresh as well or documenting why a direct connection is safe here.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
deepin pr auto review这段代码主要是在 1. 语法逻辑
2. 代码质量
3. 代码性能
4. 代码安全
总结与修改建议建议修改后的代码如下,主要增加了连接类型以保持一致性和安全性: diff --git a/plugins/dde-dock/sound/soundview.cpp b/plugins/dde-dock/sound/soundview.cpp
index 12361d47..ea2f49b6 100644
--- a/plugins/dde-dock/sound/soundview.cpp
+++ b/plugins/dde-dock/sound/soundview.cpp
@@ -42,6 +42,7 @@ SoundView::SoundView(QWidget *parent)
connect(&SoundModel::ref(), &SoundModel::volumeChanged, this, &SoundView::refresh, Qt::QueuedConnection);
connect(&SoundModel::ref(), &SoundModel::muteStateChanged, this, &SoundView::refresh, Qt::QueuedConnection);
- connect(&SoundModel::ref(), &SoundModel::cardsInfoChanged, this, &SoundView::refresh);
+ connect(&SoundModel::ref(), &SoundModel::cardsInfoChanged, this, &SoundView::refresh, Qt::QueuedConnection);
connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, [ = ] {
refreshIcon();
});修改理由:
|
yixinshark
approved these changes
Jan 29, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: ComixHe, yixinshark The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Log: Update sound tray icon when audio card info changes
Pms: BUG-349027
Summary by Sourcery
Bug Fixes: