From a5780a95988374499ba07082c41658933291e47a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=AF=E7=BA=A2=E5=8B=8B?= Date: Tue, 25 Jun 2024 14:24:23 +0800 Subject: [PATCH] Fix wrong usage of qthread MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 侯红勋 --- 0001-fix-object-created-in-wrong-thread.patch | 59 +++++++++++++++++++ ukui-control-center.spec | 6 +- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 0001-fix-object-created-in-wrong-thread.patch diff --git a/0001-fix-object-created-in-wrong-thread.patch b/0001-fix-object-created-in-wrong-thread.patch new file mode 100644 index 0000000..2a51bdb --- /dev/null +++ b/0001-fix-object-created-in-wrong-thread.patch @@ -0,0 +1,59 @@ +From 4a7799b78457d9fa9017fa5a2f5b0d4c4c7ec9af Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=E4=BE=AF=E7=BA=A2=E5=8B=8B?= +Date: Tue, 25 Jun 2024 14:21:22 +0800 +Subject: [PATCH] fix object created in wrong thread +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: 侯红勋 +--- + plugins/time-language/datetime/datetime.cpp | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +diff --git a/plugins/time-language/datetime/datetime.cpp b/plugins/time-language/datetime/datetime.cpp +index 86e0518..e657a08 100644 +--- a/plugins/time-language/datetime/datetime.cpp ++++ b/plugins/time-language/datetime/datetime.cpp +@@ -783,6 +783,12 @@ void DateTime::synctimeFormatSlot(bool status,bool outChange) + connect(syncThread, &CGetSyncRes::finished, this, [=](){ + syncThread->deleteLater(); + ui->radioButton_2->setEnabled(true); ++ if (syncThreadFlag == false) { //创建线程一直查时间同步是否成功 ++ CSyncTime *syncTimeThread = new CSyncTime(this,successMSG,failMSG); ++ connect(syncTimeThread,SIGNAL(finished()),syncTimeThread,SLOT(deleteLater())); ++ syncTimeThread->start(); ++ syncThreadFlag = true; ++ } + }); + syncThread->start(); + ui->radioButton_2->setEnabled(false); +@@ -954,6 +960,7 @@ CGetSyncRes::~CGetSyncRes() + } + void CGetSyncRes::run() + { ++ syncThreadFlag = false; + for(qint8 i = 0; i < 80; ++i) { + if (this->dataTimeUI->getSyncStatus() == false) { + this->dataTimeUI->syncNetworkRetLabel->setText(""); +@@ -971,16 +978,11 @@ void CGetSyncRes::run() + } else { //同步时间成功 + DateTime::syncRTC(); + this->dataTimeUI->syncNetworkRetLabel->setText(successMSG); ++ syncThreadFlag = true; + return; + } + } + this->dataTimeUI->syncNetworkRetLabel->setText(failMSG); +- if (syncThreadFlag == false) { //创建线程一直查时间同步是否成功 +- CSyncTime *syncTimeThread = new CSyncTime(this->dataTimeUI,successMSG,failMSG); +- connect(syncTimeThread,SIGNAL(finished()),syncTimeThread,SLOT(deleteLater())); +- syncTimeThread->start(); +- syncThreadFlag = true; +- } + return; + } + +-- +2.33.0 + diff --git a/ukui-control-center.spec b/ukui-control-center.spec index effe9df..3dcd7ba 100644 --- a/ukui-control-center.spec +++ b/ukui-control-center.spec @@ -1,6 +1,6 @@ Name: ukui-control-center Version: 3.1.2 -Release: 31 +Release: 32 Summary: utilities to configure the UKUI desktop License: GPL-2+ URL: http://www.ukui.org @@ -29,6 +29,7 @@ Patch24: fix-changeusertype-error.patch Patch25: update-formats_loacle-and-language.patch Patch26: fix-cpuinfo-error-of-ukui-control-center-3.1.2.patch Patch27: ukui-control-center-3.1.2-repair-freelogin-autologin-not-available.patch +Patch28: 0001-fix-object-created-in-wrong-thread.patch Patch200: fix-build-error-of-libkscreen-qt5-5.27.6.patch Patch201: fix-build-error-of-clang.patch @@ -151,6 +152,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Tue Jun 25 2024 houhongxun - 3.1.2-32 +- fix wrong usage of qthread + * Tue May 28 2024 peijiankang - 3.1.2-31 - Type:bugfix - ID :NA