diff --git a/plugins/bluetooth/bloothadapterwidget.cpp b/plugins/bluetooth/bloothadapterwidget.cpp index d9d46e3a6..07e32e8bd 100644 --- a/plugins/bluetooth/bloothadapterwidget.cpp +++ b/plugins/bluetooth/bloothadapterwidget.cpp @@ -103,9 +103,8 @@ void BloothAdapterWidget::onOtherClicked(const QModelIndex &index) if (!device || device->state() == Device::State::StateConnected) return; - if (device->deviceType() == "audio-card" - && device->state() == Device::State::StateAvailable - && device->deviceType() == "pheadset") { + if ((device->deviceType() == "audio-headset" || device->deviceType() == "audio-headphones") + && device->state() == Device::State::StateAvailable) { return; } diff --git a/plugins/bluetooth/componments/bluetoothadapteritem.cpp b/plugins/bluetooth/componments/bluetoothadapteritem.cpp index 228bbf08a..c03d70740 100644 --- a/plugins/bluetooth/componments/bluetoothadapteritem.cpp +++ b/plugins/bluetooth/componments/bluetoothadapteritem.cpp @@ -88,20 +88,13 @@ void BluetoothDeviceItem::initConnect() void BluetoothDeviceItem::updateIconTheme(DGuiApplicationHelper::ColorType type) { - if (type == DGuiApplicationHelper::LightType) { - if (!m_device->deviceType().isEmpty()) { - m_deviceIcon = LightString.arg(m_device->deviceType()); - } else { - m_deviceIcon = LightString.arg("other"); - } - } else { - if (!m_device->deviceType().isEmpty()) { - m_deviceIcon = DarkString.arg(m_device->deviceType()); - } else { - m_deviceIcon = DarkString.arg("other"); - } + if (!m_device->deviceType().isEmpty()) { + m_deviceIcon = m_device->deviceType(); + m_labelAction->setIcon(QIcon::fromTheme(m_deviceIcon)); + return; } - m_labelAction->setIcon(QIcon(m_deviceIcon)); + m_deviceIcon = type == DGuiApplicationHelper::LightType ? LightString.arg("other") : DarkString.arg("other"); + m_labelAction->setIcon(QIcon::fromTheme(m_deviceIcon)); } void BluetoothDeviceItem::updateDeviceState(Device::State state) diff --git a/plugins/bluetooth/componments/device.cpp b/plugins/bluetooth/componments/device.cpp index 01445ca56..6fb3006cd 100644 --- a/plugins/bluetooth/componments/device.cpp +++ b/plugins/bluetooth/componments/device.cpp @@ -8,25 +8,6 @@ #include #include -QMap Device::deviceType2Icon = { - {"unknow", "other"}, - {"computer", "pc"}, - {"phone", "phone"}, - {"video-display", "vidicon"}, - {"multimedia-player", "tv"}, - {"scanner", "scaner"}, - {"input-keyboard", "keyboard"}, - {"input-mouse", "mouse"}, - {"input-gaming", "other"}, - {"input-tablet", "touchpad"}, - {"audio-card", "pheadset"}, - {"network-wireless", "lan"}, - {"camera-video", "vidicon"}, - {"printer", "print"}, - {"camera-photo", "camera"}, - {"modem", "other"} -}; - Device::Device(QObject *parent) : QObject(parent) , m_paired(false) @@ -97,7 +78,7 @@ void Device::setRssi(int rssi) void Device::setDeviceType(const QString &deviceType) { - m_deviceType = deviceType2Icon[deviceType]; + m_deviceType = deviceType; } QDebug &operator<<(QDebug &stream, const Device *device) diff --git a/plugins/bluetooth/componments/device.h b/plugins/bluetooth/componments/device.h index 4d8953759..dcfded829 100644 --- a/plugins/bluetooth/componments/device.h +++ b/plugins/bluetooth/componments/device.h @@ -21,9 +21,6 @@ public: }; Q_ENUM(State) -private: - static QMap deviceType2Icon; - public: explicit Device(QObject *parent = nullptr); ~Device(); diff --git a/plugins/bluetooth/resources/bluetooth.qrc b/plugins/bluetooth/resources/bluetooth.qrc index 0433881a9..4abc2b2ea 100644 --- a/plugins/bluetooth/resources/bluetooth.qrc +++ b/plugins/bluetooth/resources/bluetooth.qrc @@ -18,41 +18,7 @@ select.svg disconnect.svg disconnect_dark.svg - dark/buletooth_camera_dark.svg - dark/buletooth_clang_dark.svg - dark/buletooth_keyboard_dark.svg - dark/buletooth_lan_dark.svg - dark/buletooth_laptop_dark.svg - dark/buletooth_microphone_dark.svg - dark/buletooth_mouse_dark.svg dark/buletooth_other_dark.svg - dark/buletooth_pad_dark.svg - dark/buletooth_pc_dark.svg - dark/buletooth_pen_dark.svg - dark/buletooth_pheadset_dark.svg - dark/buletooth_phone_dark.svg - dark/buletooth_print_dark.svg - dark/buletooth_scaner_dark.svg - dark/buletooth_touchpad_dark.svg - dark/buletooth_tv_dark.svg - dark/buletooth_vidicon_dark.svg - light/buletooth_camera_light.svg - light/buletooth_clang_light.svg - light/buletooth_keyboard_light.svg - light/buletooth_lan_light.svg - light/buletooth_laptop_light.svg - light/buletooth_microphone_light.svg - light/buletooth_mouse_light.svg light/buletooth_other_light.svg - light/buletooth_pad_light.svg - light/buletooth_pc_light.svg - light/buletooth_pen_light.svg - light/buletooth_pheadset_light.svg - light/buletooth_phone_light.svg - light/buletooth_print_light.svg - light/buletooth_scaner_light.svg - light/buletooth_touchpad_light.svg - light/buletooth_tv_light.svg - light/buletooth_vidicon_light.svg diff --git a/plugins/bluetooth/resources/dark/buletooth_camera_dark.svg b/plugins/bluetooth/resources/dark/buletooth_camera_dark.svg deleted file mode 100644 index 24d902840..000000000 --- a/plugins/bluetooth/resources/dark/buletooth_camera_dark.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - buletooth_camera_dark - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/dark/buletooth_clang_dark.svg b/plugins/bluetooth/resources/dark/buletooth_clang_dark.svg deleted file mode 100644 index 967f22fd5..000000000 --- a/plugins/bluetooth/resources/dark/buletooth_clang_dark.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - buletooth_clang_dark - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/dark/buletooth_keyboard_dark.svg b/plugins/bluetooth/resources/dark/buletooth_keyboard_dark.svg deleted file mode 100644 index 08b35662b..000000000 --- a/plugins/bluetooth/resources/dark/buletooth_keyboard_dark.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - buletooth_keyboard_dark - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/dark/buletooth_lan_dark.svg b/plugins/bluetooth/resources/dark/buletooth_lan_dark.svg deleted file mode 100644 index 8e5330f0d..000000000 --- a/plugins/bluetooth/resources/dark/buletooth_lan_dark.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - buletooth_lan_dark - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/dark/buletooth_laptop_dark.svg b/plugins/bluetooth/resources/dark/buletooth_laptop_dark.svg deleted file mode 100644 index 078e6ac3c..000000000 --- a/plugins/bluetooth/resources/dark/buletooth_laptop_dark.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - buletooth_laptop_dark - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/dark/buletooth_microphone_dark.svg b/plugins/bluetooth/resources/dark/buletooth_microphone_dark.svg deleted file mode 100644 index 968445cc8..000000000 --- a/plugins/bluetooth/resources/dark/buletooth_microphone_dark.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - buletooth_microphone_dark - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/dark/buletooth_mouse_dark.svg b/plugins/bluetooth/resources/dark/buletooth_mouse_dark.svg deleted file mode 100644 index 7d054f548..000000000 --- a/plugins/bluetooth/resources/dark/buletooth_mouse_dark.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - buletooth_mouse_dark - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/dark/buletooth_pad_dark.svg b/plugins/bluetooth/resources/dark/buletooth_pad_dark.svg deleted file mode 100644 index 96e30c7d6..000000000 --- a/plugins/bluetooth/resources/dark/buletooth_pad_dark.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - buletooth_pad_dark - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/dark/buletooth_pc_dark.svg b/plugins/bluetooth/resources/dark/buletooth_pc_dark.svg deleted file mode 100644 index 6341d8e80..000000000 --- a/plugins/bluetooth/resources/dark/buletooth_pc_dark.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - buletooth_pc_dark - - - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/dark/buletooth_pen_dark.svg b/plugins/bluetooth/resources/dark/buletooth_pen_dark.svg deleted file mode 100644 index 1d3d6475a..000000000 --- a/plugins/bluetooth/resources/dark/buletooth_pen_dark.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - buletooth_pen_dark - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/dark/buletooth_pheadset_dark.svg b/plugins/bluetooth/resources/dark/buletooth_pheadset_dark.svg deleted file mode 100644 index 2b84e210c..000000000 --- a/plugins/bluetooth/resources/dark/buletooth_pheadset_dark.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - buletooth_pheadset_dark - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/dark/buletooth_phone_dark.svg b/plugins/bluetooth/resources/dark/buletooth_phone_dark.svg deleted file mode 100644 index 5bb529628..000000000 --- a/plugins/bluetooth/resources/dark/buletooth_phone_dark.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - buletooth_phone_dark - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/dark/buletooth_print_dark.svg b/plugins/bluetooth/resources/dark/buletooth_print_dark.svg deleted file mode 100644 index 4dc865b5d..000000000 --- a/plugins/bluetooth/resources/dark/buletooth_print_dark.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - buletooth_print_dark - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/dark/buletooth_scaner_dark.svg b/plugins/bluetooth/resources/dark/buletooth_scaner_dark.svg deleted file mode 100644 index 6f11f03f6..000000000 --- a/plugins/bluetooth/resources/dark/buletooth_scaner_dark.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - buletooth_scaner_dark - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/dark/buletooth_touchpad_dark.svg b/plugins/bluetooth/resources/dark/buletooth_touchpad_dark.svg deleted file mode 100644 index 21ccab5e9..000000000 --- a/plugins/bluetooth/resources/dark/buletooth_touchpad_dark.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - buletooth_touchpad_dark - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/dark/buletooth_tv_dark.svg b/plugins/bluetooth/resources/dark/buletooth_tv_dark.svg deleted file mode 100644 index f6ff9ed09..000000000 --- a/plugins/bluetooth/resources/dark/buletooth_tv_dark.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - buletooth_tv_dark - - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/dark/buletooth_vidicon_dark.svg b/plugins/bluetooth/resources/dark/buletooth_vidicon_dark.svg deleted file mode 100644 index 6d1f55b33..000000000 --- a/plugins/bluetooth/resources/dark/buletooth_vidicon_dark.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - buletooth_vidicon_dark - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/light/buletooth_camera_light.svg b/plugins/bluetooth/resources/light/buletooth_camera_light.svg deleted file mode 100644 index 926f08b22..000000000 --- a/plugins/bluetooth/resources/light/buletooth_camera_light.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - buletooth_camera_light - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/light/buletooth_clang_light.svg b/plugins/bluetooth/resources/light/buletooth_clang_light.svg deleted file mode 100644 index 1e3124b2d..000000000 --- a/plugins/bluetooth/resources/light/buletooth_clang_light.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - buletooth_clang_light - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/light/buletooth_keyboard_light.svg b/plugins/bluetooth/resources/light/buletooth_keyboard_light.svg deleted file mode 100644 index bb189deed..000000000 --- a/plugins/bluetooth/resources/light/buletooth_keyboard_light.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - buletooth_keyboard_light - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/light/buletooth_lan_light.svg b/plugins/bluetooth/resources/light/buletooth_lan_light.svg deleted file mode 100644 index d495b9846..000000000 --- a/plugins/bluetooth/resources/light/buletooth_lan_light.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - buletooth_lan_light - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/light/buletooth_laptop_light.svg b/plugins/bluetooth/resources/light/buletooth_laptop_light.svg deleted file mode 100644 index 0e132c2ce..000000000 --- a/plugins/bluetooth/resources/light/buletooth_laptop_light.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - buletooth_laptop_light - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/light/buletooth_microphone_light.svg b/plugins/bluetooth/resources/light/buletooth_microphone_light.svg deleted file mode 100644 index 8dac57029..000000000 --- a/plugins/bluetooth/resources/light/buletooth_microphone_light.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - buletooth_microphone_light - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/light/buletooth_mouse_light.svg b/plugins/bluetooth/resources/light/buletooth_mouse_light.svg deleted file mode 100644 index a9120efe6..000000000 --- a/plugins/bluetooth/resources/light/buletooth_mouse_light.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - buletooth_mouse_light - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/light/buletooth_pad_light.svg b/plugins/bluetooth/resources/light/buletooth_pad_light.svg deleted file mode 100644 index d5cf5589e..000000000 --- a/plugins/bluetooth/resources/light/buletooth_pad_light.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - buletooth_pad_light - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/light/buletooth_pc_light.svg b/plugins/bluetooth/resources/light/buletooth_pc_light.svg deleted file mode 100644 index c164df087..000000000 --- a/plugins/bluetooth/resources/light/buletooth_pc_light.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - buletooth_pc_light - - - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/light/buletooth_pen_light.svg b/plugins/bluetooth/resources/light/buletooth_pen_light.svg deleted file mode 100644 index d1d2a5771..000000000 --- a/plugins/bluetooth/resources/light/buletooth_pen_light.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - buletooth_pen_light - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/light/buletooth_pheadset_light.svg b/plugins/bluetooth/resources/light/buletooth_pheadset_light.svg deleted file mode 100644 index 8d08fdd87..000000000 --- a/plugins/bluetooth/resources/light/buletooth_pheadset_light.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - buletooth_pheadset_light - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/light/buletooth_phone_light.svg b/plugins/bluetooth/resources/light/buletooth_phone_light.svg deleted file mode 100644 index 0acfa2880..000000000 --- a/plugins/bluetooth/resources/light/buletooth_phone_light.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - buletooth_phone_light - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/light/buletooth_print_light.svg b/plugins/bluetooth/resources/light/buletooth_print_light.svg deleted file mode 100644 index fad7fd7d9..000000000 --- a/plugins/bluetooth/resources/light/buletooth_print_light.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - buletooth_print_light - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/light/buletooth_scaner_light.svg b/plugins/bluetooth/resources/light/buletooth_scaner_light.svg deleted file mode 100644 index d4c923ca7..000000000 --- a/plugins/bluetooth/resources/light/buletooth_scaner_light.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - buletooth_scaner_light - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/light/buletooth_touchpad_light.svg b/plugins/bluetooth/resources/light/buletooth_touchpad_light.svg deleted file mode 100644 index 3460b59a9..000000000 --- a/plugins/bluetooth/resources/light/buletooth_touchpad_light.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - buletooth_touchpad_light - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/light/buletooth_tv_light.svg b/plugins/bluetooth/resources/light/buletooth_tv_light.svg deleted file mode 100644 index b3dac2016..000000000 --- a/plugins/bluetooth/resources/light/buletooth_tv_light.svg +++ /dev/null @@ -1,8 +0,0 @@ - - - buletooth_tv_light - - - - - \ No newline at end of file diff --git a/plugins/bluetooth/resources/light/buletooth_vidicon_light.svg b/plugins/bluetooth/resources/light/buletooth_vidicon_light.svg deleted file mode 100644 index a9d13281f..000000000 --- a/plugins/bluetooth/resources/light/buletooth_vidicon_light.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - buletooth_vidicon_light - - - - \ No newline at end of file