From 6eca263e55bebbf896f8b3cf8f030d57f5904ee5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=B0=91=E5=8B=87?= Date: Sat, 17 Sep 2022 11:19:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=8D=E6=94=B9=E5=9B=9E=E6=9D=A5=EF=BC=8C?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E7=99=BB=E5=87=BA=E7=94=A8=E6=88=B7=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E6=B5=8B=E8=AF=95=E6=97=B6=E5=87=BA=E7=8E=B0=E4=BA=86?= =?UTF-8?q?=E5=85=B6=E5=AE=83=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backup-daemon/mybackupmanager.cpp | 7 ------- backup-daemon/systemrestoreproxy.cpp | 17 +++++------------ backup-daemon/workerfactory.h | 6 ------ kybackup/module/systemrestore.cpp | 3 --- 4 files changed, 5 insertions(+), 28 deletions(-) diff --git a/backup-daemon/mybackupmanager.cpp b/backup-daemon/mybackupmanager.cpp index 9b956bb..a2d521c 100755 --- a/backup-daemon/mybackupmanager.cpp +++ b/backup-daemon/mybackupmanager.cpp @@ -199,13 +199,6 @@ int MyBackupManager::goRestore(const BackupWrapper& backupWrapper) connect(worker, &Worker::progress, this, [&](int rate) { emit this->progress(int(BackupState::WORKING), rate); }); - connect(worker, &Worker::otherSignal, this, [&](int type) { - // 结束ukui-session-tools的锁定,以便后面的用户登出操作 - if (Worker::OtherSignal::UKUI_SESSION_LOCK_END == type) { - this->uninhibit(); - emit this->sendRestoreResult(true); - } - }); connect(worker, &Worker::workResult, this, [&] (bool result) { emit this->sendRestoreResult(result); this->finished(); diff --git a/backup-daemon/systemrestoreproxy.cpp b/backup-daemon/systemrestoreproxy.cpp index 7df8df6..6f8ca32 100755 --- a/backup-daemon/systemrestoreproxy.cpp +++ b/backup-daemon/systemrestoreproxy.cpp @@ -372,23 +372,16 @@ void SystemRestoreProxy::restoreSystem() break; } if (FACTORY_BACKUP_UUID == m_curUuid && m_backupWrapper.m_type == BackupType::RESTORE_SYSTEM) { - emit this->otherSignal(UKUI_SESSION_LOCK_END); - Utils::wait(5); - // 出厂还原有的机器上删除/home/xxx有残留,故在此再强制删除一下,sudo rm -rf命令一遍还删除不了(报错:无法删除/home/xx/.config:目录非空,应该是删除后又自动生成了),多删除几次还不是非常干净,^_^ removeHome(QString(Utils::getSysRootPath() + "/home").replace("//", "/")); removeHome(QString(Utils::getSysRootPath() + "/data/home").replace("//", "/")); - - QProcess::execute("sync"); - Utils::wait(2); - emit this->workResult(result); - } else { - QProcess::execute("sync"); - Utils::wait(5); - emit this->workResult(result); - Utils::wait(3); } + QProcess::execute("sync"); + Utils::wait(5); + emit this->workResult(result); + Utils::wait(2); + reboot(RB_AUTOBOOT); } else { emit this->workResult(result); diff --git a/backup-daemon/workerfactory.h b/backup-daemon/workerfactory.h index f24bb53..b827721 100755 --- a/backup-daemon/workerfactory.h +++ b/backup-daemon/workerfactory.h @@ -11,10 +11,6 @@ class Worker : public QObject { Q_OBJECT -public: - enum OtherSignal{ - UKUI_SESSION_LOCK_END, - }; public: explicit Worker(); virtual ~Worker(); @@ -28,8 +24,6 @@ signals: void workResult(bool result); // 任务取消 void cancel(); - // 其它信号 - void otherSignal(int type); public slots: // 环境检测 diff --git a/kybackup/module/systemrestore.cpp b/kybackup/module/systemrestore.cpp index b4bd1e4..4c2dd84 100755 --- a/kybackup/module/systemrestore.cpp +++ b/kybackup/module/systemrestore.cpp @@ -963,9 +963,6 @@ void SystemRestore::initLastWidget() labelError2->setVisible(false); retry->setVisible(false); homePage->setVisible(false); - - Utils::wait(2); - QProcess::execute("ukui-session-tools --logout"); } else { resultLogo->setThemeIconSchema("dialog-error", ":/symbos/dialog-error"); resultLogo->setVisible(true);