ukui-bluetooth/0003-fix-restart-the-system-Bluetooth-core-dump.patch

46 lines
1.6 KiB
Diff

From e62a6729d4457b7e77fa4968e045866c16e24a6d Mon Sep 17 00:00:00 2001
From: tanyulong <tanyulong@kylinos.cn>
Date: Mon, 1 Nov 2021 10:32:54 +0800
Subject: [PATCH] fix restart the system Bluetooth core dump
---
ukui-bluetooth/main/featureswidget.cpp | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/ukui-bluetooth/main/featureswidget.cpp b/ukui-bluetooth/main/featureswidget.cpp
index 300f51f..ff3f623 100644
--- a/ukui-bluetooth/main/featureswidget.cpp
+++ b/ukui-bluetooth/main/featureswidget.cpp
@@ -86,14 +86,21 @@ FeaturesWidget::FeaturesWidget(QWidget *parent)
qDebug() << m_manager->registerAgent(bluetoothAgent)->errorText();
qDebug() << m_adapter->isPowered() << "===========" << m_manager->isBluetoothBlocked();
- if(settings->get("switch").toString() == "false"){
- if (!m_manager->isBluetoothBlocked())
- m_manager->setBluetoothBlocked(true);
- }else{
- if(m_manager->isBluetoothBlocked()){
- m_manager->setBluetoothBlocked(false);
- }
+// if(settings->get("switch").toString() == "false"){
+// if (!m_manager->isBluetoothBlocked())
+// m_manager->setBluetoothBlocked(true);
+// }else{
+// if(m_manager->isBluetoothBlocked()){
+// m_manager->setBluetoothBlocked(false);
+// }
+// }
+
+ bool value;
+ if(value != settings->get("switch").toBool()){
+ Turn_on_or_off_bluetooth(value);
}
+ if (value = settings->get("switch").toBool() )
+
if(File_save_path.isEmpty()){
settings->set("file-save-path",QVariant::fromValue(QDir::homePath()));
--
2.30.0