From eff56b7b867f6fe466726cb7dfe4b82cf156e75d Mon Sep 17 00:00:00 2001 From: tanyulong2021 Date: Mon, 1 Nov 2021 10:36:58 +0800 Subject: [PATCH] using rfkill to restart the soft connection, restart the system Bluetooth core dump --- ...start-the-system-Bluetooth-core-dump.patch | 45 +++++++++++++++++++ ukui-bluetooth.spec | 7 ++- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 0003-fix-restart-the-system-Bluetooth-core-dump.patch diff --git a/0003-fix-restart-the-system-Bluetooth-core-dump.patch b/0003-fix-restart-the-system-Bluetooth-core-dump.patch new file mode 100644 index 0000000..a16d8d1 --- /dev/null +++ b/0003-fix-restart-the-system-Bluetooth-core-dump.patch @@ -0,0 +1,45 @@ +From e62a6729d4457b7e77fa4968e045866c16e24a6d Mon Sep 17 00:00:00 2001 +From: tanyulong +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 + diff --git a/ukui-bluetooth.spec b/ukui-bluetooth.spec index 344af9e..120b83c 100644 --- a/ukui-bluetooth.spec +++ b/ukui-bluetooth.spec @@ -2,7 +2,7 @@ Name: ukui-bluetooth Version: 1.0.0 -Release: 3 +Release: 4 Summary: Advanced ukui bluetooth License: GPLv2+ URL: http://www.ukui.org @@ -10,6 +10,7 @@ Source0: %{name}-%{version}.tar.gz patch0: 0001-fix-Bluetooth-pulled-up-by-the-session-manager-and-exits-abnormally.patch patch1: 0002-fix-ukui-bluetooth-will-have-a-segfault-when-times-out.patch +patch2: 0003-fix-restart-the-system-Bluetooth-core-dump.patch BuildRequires: gsettings-qt-devel BuildRequires: glib2-devel @@ -40,6 +41,7 @@ Simple bluetooth tool for ukui desktop environment %setup -q %patch0 -p1 %patch1 -p1 +%patch2 -p1 %build mkdir build && cd build @@ -75,6 +77,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Mon Nov 1 2021 tanyulong - 1.0.0-4 +- After using rfkill to restart the soft connection, restart the system Bluetooth core dump + * Sat Oct 30 2021 tanyulong - 1.0.0-3 - After the Bluetooth pairing between the mobile phone and the system has timed out, and ukui-bluetooth will have a segmentation error