diff --git a/src/common/dbus/updatedbusproxy.h b/src/common/dbus/updatedbusproxy.h index fd2b02d0..0f347fc3 100644 --- a/src/common/dbus/updatedbusproxy.h +++ b/src/common/dbus/updatedbusproxy.h @@ -95,7 +95,7 @@ class UpdateDBusProxy : public QObject QDBusPendingCall CanRollback(); QDBusPendingCall ConfirmRollback(bool confirm); - bool managerInterIsValid() const { return m_managerInter && m_managerInter->serviceValid(); } + bool managerInterIsValid() const { return m_managerInter && m_managerInter->isValid(); } QDBusPendingCall Poweroff(bool reboot = false); diff --git a/src/dde-update/main.cpp b/src/dde-update/main.cpp index 15378d88..2293020f 100644 --- a/src/dde-update/main.cpp +++ b/src/dde-update/main.cpp @@ -135,7 +135,7 @@ int main(int argc, char *argv[]) new FullScreenManager(createFrame); if (!whetherDoUpgrade) { - UpdateWorker::instance()->doCheckSystem(UpdateModel::instance()->updateMode(), UpdateModel::instance()->checkSystemStage()); + UpdateWorker::instance()->checkSystem(UpdateModel::instance()->updateMode(), UpdateModel::instance()->checkSystemStage()); } return app->exec(); diff --git a/src/dde-update/updateworker.cpp b/src/dde-update/updateworker.cpp index 02f8f326..a9390761 100644 --- a/src/dde-update/updateworker.cpp +++ b/src/dde-update/updateworker.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -76,6 +76,9 @@ void UpdateWorker::init() } else { if (m_waitingToCheckSystem) { m_waitingToCheckSystem = false; + if (m_waitServiceTimer->isActive()) { + m_waitServiceTimer->stop(); + } doCheckSystem(UpdateModel::instance()->updateMode(), UpdateModel::instance()->checkSystemStage()); } } @@ -108,6 +111,19 @@ void UpdateWorker::startUpdateProgress() doDistUpgradeIfCanBackup(); } +void UpdateWorker::checkSystem(int updateMode, UpdateModel::CheckSystemStage stage) +{ + qCInfo(logUpdateModal) << "Check system with update mode:" << updateMode << "check system stage:" << stage; + if (!m_dbusProxy->managerInterIsValid()) { + qCWarning(logUpdateModal) << "org.deepin.dde.Lastore1 interface is invalid, wait for service to be valid"; + m_waitingToCheckSystem = true; + m_waitServiceTimer->start(); + return; + } + + doCheckSystem(updateMode, stage); +} + void UpdateWorker::doDistUpgrade(bool doBackup) { qCInfo(logUpdateModal) << "Do dist upgrade, do backup: " << doBackup; @@ -387,14 +403,7 @@ void UpdateWorker::doDistUpgradeIfCanBackup() void UpdateWorker::doCheckSystem(int updateMode, UpdateModel::CheckSystemStage stage) { - qCInfo(logUpdateModal) << "Update mode:" << updateMode << ", check system stage:" << stage; - if (!m_dbusProxy->managerInterIsValid()) { - qCWarning(logUpdateModal) << "org.deepin.dde.Lastore1 interface is invalid, wait for service to be valid"; - m_waitingToCheckSystem = true; - m_waitServiceTimer->start(); - return; - } - + qCInfo(logUpdateModal) << "doCheckSystem Update mode:" << updateMode << ", check system stage:" << stage; QDBusPendingReply reply = m_dbusProxy->CheckUpgrade(updateMode, static_cast(stage)); QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this); connect(watcher, &QDBusPendingCallWatcher::finished, this, [this, watcher] { diff --git a/src/dde-update/updateworker.h b/src/dde-update/updateworker.h index 0de3f038..6e5b92e2 100644 --- a/src/dde-update/updateworker.h +++ b/src/dde-update/updateworker.h @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2022 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -43,6 +43,7 @@ class UpdateWorker : public QObject void doCheckSystem(int updateMode, UpdateModel::CheckSystemStage stage); void doAction(UpdateModel::UpdateAction action); void startUpdateProgress(); + void checkSystem(int updateMode, UpdateModel::CheckSystemStage stage); bool checkPower(); void enableShortcuts(bool enable); void doPowerAction(bool reboot);