再改回来,使用登出用户操作测试时出现了其它问题

This commit is contained in:
赵民勇 2022-09-17 11:19:56 +08:00
parent 76137966f5
commit 6eca263e55
4 changed files with 5 additions and 28 deletions

View File

@ -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();

View File

@ -372,22 +372,15 @@ 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);
}
Utils::wait(2);
reboot(RB_AUTOBOOT);
} else {

View File

@ -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:
// 环境检测

View File

@ -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);