Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/common/dbus/updatedbusproxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
QDBusPendingCall CanRollback();
QDBusPendingCall ConfirmRollback(bool confirm);

bool managerInterIsValid() const { return m_managerInter && m_managerInter->serviceValid(); }
bool managerInterIsValid() const { return m_managerInter && m_managerInter->isValid(); }

Check warning on line 98 in src/common/dbus/updatedbusproxy.h

View workflow job for this annotation

GitHub Actions / cppcheck

The function 'managerInterIsValid' is never used.

QDBusPendingCall Poweroff(bool reboot = false);

Expand Down
2 changes: 1 addition & 1 deletion src/dde-update/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
27 changes: 18 additions & 9 deletions src/dde-update/updateworker.cpp
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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());
}
}
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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<QDBusObjectPath> reply = m_dbusProxy->CheckUpgrade(updateMode, static_cast<int>(stage));
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this);
connect(watcher, &QDBusPendingCallWatcher::finished, this, [this, watcher] {
Expand Down
3 changes: 2 additions & 1 deletion src/dde-update/updateworker.h
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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);
Expand Down
Loading