fix(bluetooth): add audio-headset/audio-headphones icon mappings - #493
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdds missing Bluetooth device type to icon mappings so taskbar device icons match the control center for audio headsets/headphones. Sequence diagram for Bluetooth device type to icon mapping fixsequenceDiagram
participant BlueZ
participant BluetoothAdapterItem
participant Device
participant TaskbarUI
BlueZ->>BluetoothAdapterItem: deviceType (audio-headset)
BluetoothAdapterItem->>Device: deviceType2Icon[deviceType]
Device-->>BluetoothAdapterItem: pheadset
BluetoothAdapterItem->>TaskbarUI: setIcon(bluetooth_pheadset)
BlueZ->>BluetoothAdapterItem: deviceType (audio-headphones)
BluetoothAdapterItem->>Device: deviceType2Icon[deviceType]
Device-->>BluetoothAdapterItem: pheadset
BluetoothAdapterItem->>TaskbarUI: setIcon(bluetooth_pheadset)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
db5cbe3 to
f22c83f
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, caixr23 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 |
f22c83f to
0ee57a6
Compare
1. Add audio-headset and audio-headphones entries to deviceType2Icon, mapping both to pheadset to match audio-card, so the taskbar renders bluetooth_pheadset instead of falling back to bluetooth_other 2. Update SPDX copyright year to 2026 PMS: BUG-275675 fix: 任务栏蓝牙音频设备图标与控制中心对齐 1. 在 deviceType2Icon 中补充 audio-headset 和 audio-headphones 条目, 均映射到 pheadset,与 audio-card 一致,使任务栏渲染 bluetooth_pheadset 而非回退到 bluetooth_other 2. 更新 SPDX 版权年份至 2026 PMS: BUG-275675
0ee57a6 to
cb5ea1b
Compare
deepin pr auto review★ 总体评分:100分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 // 当前代码已足够优秀,无需改进,以下为确认后的最终形态
QMap<QString, QString> Device::deviceType2Icon = {
{"input-gaming", "other"},
{"input-tablet", "touchpad"},
{"audio-card", "pheadset"},
{"audio-headset", "pheadset"},
{"audio-headphones", "pheadset"},
{"network-wireless", "lan"},
{"camera-video", "vidicon"},
{"printer", "print"},
}; |
根因分析
PMS 275675:连接蓝牙音箱时,控制中心与任务栏蓝牙列表的设备图标不一致。
任务栏(dde-tray-loader)的
deviceType2Icon缺少audio-headset和audio-headphones条目。当 BlueZ 返回这些值时,QMap::operator[]返回空字符串,bluetoothadapteritem.cpp回退到bluetooth_other,而控制中心显示bluetooth_pheadset,导致不一致。修复方案
在
plugins/dde-dock/bluetooth/componments/device.cpp的deviceType2Icon中补充audio-headset和audio-headphones条目,映射到pheadset(与audio-card一致),使任务栏与控制中心图标对齐。改动
1 个文件,2 行新增。低风险,
bluetooth_pheadset_16px.svg资源已存在。Summary by Sourcery
Bug Fixes:
audio-headsetandaudio-headphonesBluetooth device types so they display the correct headset icon instead of the generic Bluetooth icon in the taskbar.