start timer at updatehandle init
This commit is contained in:
parent
4f725d3c79
commit
eb496113c3
|
@ -0,0 +1,150 @@
|
|||
From: yafeng shen <shenyafeng@kylinos.cn>
|
||||
Date: Tue, 23 Jul 2024 17:04:07 +0800
|
||||
Subject: start timer at updatehandle init
|
||||
|
||||
---
|
||||
.../kylin-update-notify-immutable.pro | 2 +-
|
||||
kylin-update-notify-immutable/src/updatehandle.cpp | 9 +++++----
|
||||
kylin-update-notify-immutable/src/updatewidget.cpp | 11 ++++-------
|
||||
kylin-update-notify/kylin-update-notify.pro | 2 +-
|
||||
kylin-update-notify/src/updatehandle.cpp | 8 +++++---
|
||||
kylin-update-notify/src/updatewidget.cpp | 11 ++++-------
|
||||
6 files changed, 20 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/kylin-update-notify-immutable/kylin-update-notify-immutable.pro b/kylin-update-notify-immutable/kylin-update-notify-immutable.pro
|
||||
index 450bff3..b3d37bf 100644
|
||||
--- a/kylin-update-notify-immutable/kylin-update-notify-immutable.pro
|
||||
+++ b/kylin-update-notify-immutable/kylin-update-notify-immutable.pro
|
||||
@@ -1,7 +1,7 @@
|
||||
QT += core gui dbus network KWindowSystem sql
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
-CONFIG += c++11 link_pkgconfig
|
||||
+CONFIG += c++11 link_pkgconfig debug
|
||||
|
||||
# 项目名
|
||||
TARGET = kylin-background-upgrade
|
||||
diff --git a/kylin-update-notify-immutable/src/updatehandle.cpp b/kylin-update-notify-immutable/src/updatehandle.cpp
|
||||
index 8e04ed5..3147f0a 100644
|
||||
--- a/kylin-update-notify-immutable/src/updatehandle.cpp
|
||||
+++ b/kylin-update-notify-immutable/src/updatehandle.cpp
|
||||
@@ -4,6 +4,10 @@
|
||||
|
||||
updatehandle::updatehandle(QString getnum1,QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
+ timerDownload = new QTimer(this);
|
||||
+ connect(timerDownload, SIGNAL(timeout()), this, SLOT(downloadTimeout()));
|
||||
+ timerDownload->start(20*60*1000);
|
||||
+ qDebug()<<"timer start";
|
||||
argnum = getnum1;
|
||||
|
||||
initTranslator(); //加载翻译文件
|
||||
@@ -71,9 +75,6 @@ void updatehandle::initDbus()
|
||||
*/
|
||||
void updatehandle::initUI(QString argnum)
|
||||
{
|
||||
- timerDownload = new QTimer(this);
|
||||
- connect(timerDownload, SIGNAL(timeout()), this, SLOT(downloadTimeout()));
|
||||
-
|
||||
if(argnum.contains("--check-immediately")){
|
||||
qDebug()<<"exec --check-immediately";
|
||||
} else if(argnum.contains("--check-upgrade")) {
|
||||
@@ -311,7 +312,7 @@ void updatehandle::handleCrucial(QStringList checkCrucialAll)
|
||||
}
|
||||
checkCrucial = crucialPackage;
|
||||
qDebug()<<"Checking for inactivity in silent upgrading ...";
|
||||
- timerDownload->start(20*60*1000);
|
||||
+
|
||||
if (powerState) { //判断是否获取到电量
|
||||
if (powerNum.toInt()<powerSize) { //判断电量是否达到警戒值
|
||||
qDebug()<<"超出设定电源警戒值,判断包大小是否符合继续下载条件";
|
||||
diff --git a/kylin-update-notify-immutable/src/updatewidget.cpp b/kylin-update-notify-immutable/src/updatewidget.cpp
|
||||
index 054dd15..ef46e46 100644
|
||||
--- a/kylin-update-notify-immutable/src/updatewidget.cpp
|
||||
+++ b/kylin-update-notify-immutable/src/updatewidget.cpp
|
||||
@@ -515,13 +515,10 @@ void updatewidget::agreeBtnClicked()
|
||||
}
|
||||
file.close();
|
||||
QProcess p(0);
|
||||
- if (_is_2107&&!_is_openkylin()) {
|
||||
- p.startDetached("ukui-control-center --upgrade");
|
||||
- qDebug()<<"exec --upgrade";
|
||||
- } else {
|
||||
- p.startDetached("ukui-control-center -m upgrade");
|
||||
- qDebug()<<"exec -m upgrade";
|
||||
- }
|
||||
+
|
||||
+ p.startDetached("ukui-control-center -m upgrade");
|
||||
+ qDebug()<<"exec -m upgrade";
|
||||
+
|
||||
p.waitForStarted();
|
||||
qDebug()<<"Open the control panel and start updating immediately, exit tray program!";
|
||||
exit(0);
|
||||
diff --git a/kylin-update-notify/kylin-update-notify.pro b/kylin-update-notify/kylin-update-notify.pro
|
||||
index 450bff3..b3d37bf 100644
|
||||
--- a/kylin-update-notify/kylin-update-notify.pro
|
||||
+++ b/kylin-update-notify/kylin-update-notify.pro
|
||||
@@ -1,7 +1,7 @@
|
||||
QT += core gui dbus network KWindowSystem sql
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
-CONFIG += c++11 link_pkgconfig
|
||||
+CONFIG += c++11 link_pkgconfig debug
|
||||
|
||||
# 项目名
|
||||
TARGET = kylin-background-upgrade
|
||||
diff --git a/kylin-update-notify/src/updatehandle.cpp b/kylin-update-notify/src/updatehandle.cpp
|
||||
index 8e04ed5..eb8e7bc 100644
|
||||
--- a/kylin-update-notify/src/updatehandle.cpp
|
||||
+++ b/kylin-update-notify/src/updatehandle.cpp
|
||||
@@ -4,6 +4,10 @@
|
||||
|
||||
updatehandle::updatehandle(QString getnum1,QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
+ timerDownload = new QTimer(this);
|
||||
+ connect(timerDownload, SIGNAL(timeout()), this, SLOT(downloadTimeout()));
|
||||
+ timerDownload->start(20*60*1000);
|
||||
+ qDebug()<<"timer start";
|
||||
argnum = getnum1;
|
||||
|
||||
initTranslator(); //加载翻译文件
|
||||
@@ -71,8 +75,6 @@ void updatehandle::initDbus()
|
||||
*/
|
||||
void updatehandle::initUI(QString argnum)
|
||||
{
|
||||
- timerDownload = new QTimer(this);
|
||||
- connect(timerDownload, SIGNAL(timeout()), this, SLOT(downloadTimeout()));
|
||||
|
||||
if(argnum.contains("--check-immediately")){
|
||||
qDebug()<<"exec --check-immediately";
|
||||
@@ -311,7 +313,7 @@ void updatehandle::handleCrucial(QStringList checkCrucialAll)
|
||||
}
|
||||
checkCrucial = crucialPackage;
|
||||
qDebug()<<"Checking for inactivity in silent upgrading ...";
|
||||
- timerDownload->start(20*60*1000);
|
||||
+
|
||||
if (powerState) { //判断是否获取到电量
|
||||
if (powerNum.toInt()<powerSize) { //判断电量是否达到警戒值
|
||||
qDebug()<<"超出设定电源警戒值,判断包大小是否符合继续下载条件";
|
||||
diff --git a/kylin-update-notify/src/updatewidget.cpp b/kylin-update-notify/src/updatewidget.cpp
|
||||
index 054dd15..ef46e46 100644
|
||||
--- a/kylin-update-notify/src/updatewidget.cpp
|
||||
+++ b/kylin-update-notify/src/updatewidget.cpp
|
||||
@@ -515,13 +515,10 @@ void updatewidget::agreeBtnClicked()
|
||||
}
|
||||
file.close();
|
||||
QProcess p(0);
|
||||
- if (_is_2107&&!_is_openkylin()) {
|
||||
- p.startDetached("ukui-control-center --upgrade");
|
||||
- qDebug()<<"exec --upgrade";
|
||||
- } else {
|
||||
- p.startDetached("ukui-control-center -m upgrade");
|
||||
- qDebug()<<"exec -m upgrade";
|
||||
- }
|
||||
+
|
||||
+ p.startDetached("ukui-control-center -m upgrade");
|
||||
+ qDebug()<<"exec -m upgrade";
|
||||
+
|
||||
p.waitForStarted();
|
||||
qDebug()<<"Open the control panel and start updating immediately, exit tray program!";
|
||||
exit(0);
|
|
@ -1,2 +1,3 @@
|
|||
0001-1.3.2.1-ok13.1.patch
|
||||
0002-fix.patch
|
||||
0003-start-timer-at-updatehandle-init.patch
|
||||
|
|
Loading…
Reference in New Issue