using rfkill to restart the soft connection, restart the system Bluetooth core dump

This commit is contained in:
tanyulong2021 2021-11-01 10:36:58 +08:00
parent 07873e43d4
commit eff56b7b86
2 changed files with 51 additions and 1 deletions

View File

@ -0,0 +1,45 @@
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

View File

@ -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 <tanyulong@kylinos.cn> - 1.0.0-4
- After using rfkill to restart the soft connection, restart the system Bluetooth core dump
* Sat Oct 30 2021 tanyulong <tanyulong@kylinos.cn> - 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