109348 【备份还原4.0.14】选择在移动设备上备份的系统进行系统还原时,在到还原中的步骤时,拔出移动设备,进度卡在100%不动
This commit is contained in:
parent
5db97cf5f4
commit
8dbd01c6d5
|
@ -17,6 +17,7 @@ UDiskDataBackupProxy::UDiskDataBackupProxy()
|
||||||
|
|
||||||
UDiskDataBackupProxy::~UDiskDataBackupProxy()
|
UDiskDataBackupProxy::~UDiskDataBackupProxy()
|
||||||
{
|
{
|
||||||
|
m_isForce = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -337,6 +338,7 @@ bool UDiskDataBackupProxy::backupDataToUdisk()
|
||||||
if (m_bCancel)
|
if (m_bCancel)
|
||||||
return ;
|
return ;
|
||||||
|
|
||||||
|
m_isForce = false;
|
||||||
m_isFinished = true;
|
m_isFinished = true;
|
||||||
if (result) {
|
if (result) {
|
||||||
m_backupPoint.m_state = BACKUP_PARSE_STATE_SUCCESS_STRTING;
|
m_backupPoint.m_state = BACKUP_PARSE_STATE_SUCCESS_STRTING;
|
||||||
|
@ -378,19 +380,23 @@ bool UDiskDataBackupProxy::backupDataToUdisk()
|
||||||
*/
|
*/
|
||||||
bool UDiskDataBackupProxy::checkDestDirExists()
|
bool UDiskDataBackupProxy::checkDestDirExists()
|
||||||
{
|
{
|
||||||
QDir dir(m_backupWrapper.m_prefixDestPath);
|
|
||||||
if (!dir.exists()) {
|
|
||||||
qCritical() << QString("dstDir %s is not exist!").arg(m_backupWrapper.m_prefixDestPath);
|
|
||||||
|
|
||||||
if (m_p)
|
|
||||||
m_p->stop();
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!m_isFinished)
|
if (!m_isFinished)
|
||||||
{
|
{
|
||||||
QTimer::singleShot(1*1000, this, &UDiskDataBackupProxy::checkDestDirExists);
|
// 拔掉U盘后,没有响应的场景(怀疑可能是某应用程序关闭引起,希望不是dbus服务关掉了)
|
||||||
|
if (m_isForce) {
|
||||||
|
emit this->workResult(false);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Utils::isDirEmpty(m_backupWrapper.m_prefixDestPath) && m_p != nullptr) {
|
||||||
|
qCritical() << QString("dstDir %s is not exist!").arg(m_backupWrapper.m_prefixDestPath);
|
||||||
|
m_p->stop();
|
||||||
|
// 10s钟后如果还没有退出,则强制退出
|
||||||
|
QTimer::singleShot(10*1000, this, &UDiskDataBackupProxy::checkDestDirExists);
|
||||||
|
m_isForce = true;
|
||||||
|
} else {
|
||||||
|
QTimer::singleShot(1*1000, this, &UDiskDataBackupProxy::checkDestDirExists);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -58,6 +58,9 @@ private:
|
||||||
|
|
||||||
// 备份系统
|
// 备份系统
|
||||||
bool backupDataToUdisk();
|
bool backupDataToUdisk();
|
||||||
|
|
||||||
|
// 强制结束标志(stop后没反应的情况,系统处于睡眠状态)
|
||||||
|
bool m_isForce;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // UDISKDATABACKUPPROXY_H
|
#endif // UDISKDATABACKUPPROXY_H
|
||||||
|
|
|
@ -163,6 +163,7 @@ bool UDiskDataRestoreProxy::checkUdiskExists()
|
||||||
// 拔掉U盘后,没有响应的场景(怀疑可能是某应用程序关闭引起,希望不是dbus服务关掉了)
|
// 拔掉U盘后,没有响应的场景(怀疑可能是某应用程序关闭引起,希望不是dbus服务关掉了)
|
||||||
if (m_isForce) {
|
if (m_isForce) {
|
||||||
emit this->workResult(false);
|
emit this->workResult(false);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Utils::isDirEmpty(m_backupPath) && m_p != nullptr) {
|
if (Utils::isDirEmpty(m_backupPath) && m_p != nullptr) {
|
||||||
|
|
|
@ -19,6 +19,7 @@ UDiskGhostImageProxy::UDiskGhostImageProxy()
|
||||||
m_p = nullptr;
|
m_p = nullptr;
|
||||||
m_bSuccess = false;
|
m_bSuccess = false;
|
||||||
m_isFinished = false;
|
m_isFinished = false;
|
||||||
|
m_isForce = false;
|
||||||
|
|
||||||
connect(this, &UDiskGhostImageProxy::cancel, this, &UDiskGhostImageProxy::cancelEx);
|
connect(this, &UDiskGhostImageProxy::cancel, this, &UDiskGhostImageProxy::cancelEx);
|
||||||
}
|
}
|
||||||
|
@ -203,6 +204,7 @@ void UDiskGhostImageProxy::doGhostImage()
|
||||||
if (m_bCancel)
|
if (m_bCancel)
|
||||||
return ;
|
return ;
|
||||||
|
|
||||||
|
m_isForce = false;
|
||||||
m_isFinished = true;
|
m_isFinished = true;
|
||||||
if (resultRsync) {
|
if (resultRsync) {
|
||||||
// QFileInfo fileInfo(m_kyimg);
|
// QFileInfo fileInfo(m_kyimg);
|
||||||
|
@ -252,21 +254,23 @@ void UDiskGhostImageProxy::doGhostImage()
|
||||||
*/
|
*/
|
||||||
bool UDiskGhostImageProxy::checkDestDirExists()
|
bool UDiskGhostImageProxy::checkDestDirExists()
|
||||||
{
|
{
|
||||||
QDir dir(m_backupWrapper.m_prefixDestPath);
|
|
||||||
if (!dir.exists()) {
|
|
||||||
qCritical() << QString("dstDir %s is not exist!").arg(m_backupWrapper.m_prefixDestPath);
|
|
||||||
|
|
||||||
if (m_mksquashfs)
|
|
||||||
m_mksquashfs->stop();
|
|
||||||
if (m_p)
|
|
||||||
m_p->stop();
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!m_isFinished)
|
if (!m_isFinished)
|
||||||
{
|
{
|
||||||
QTimer::singleShot(1*1000, this, &UDiskGhostImageProxy::checkDestDirExists);
|
// 拔掉U盘后,没有响应的场景(怀疑可能是某应用程序关闭引起,希望不是dbus服务关掉了)
|
||||||
|
if (m_isForce) {
|
||||||
|
emit this->workResult(false);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Utils::isDirEmpty(m_backupWrapper.m_prefixDestPath) && m_p != nullptr) {
|
||||||
|
qCritical() << QString("dstDir %s is not exist!").arg(m_backupWrapper.m_prefixDestPath);
|
||||||
|
m_p->stop();
|
||||||
|
// 10s钟后如果还没有退出,则强制退出
|
||||||
|
QTimer::singleShot(10*1000, this, &UDiskGhostImageProxy::checkDestDirExists);
|
||||||
|
m_isForce = true;
|
||||||
|
} else {
|
||||||
|
QTimer::singleShot(1*1000, this, &UDiskGhostImageProxy::checkDestDirExists);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -43,6 +43,8 @@ private:
|
||||||
bool m_bSuccess;
|
bool m_bSuccess;
|
||||||
// 是否结束
|
// 是否结束
|
||||||
bool m_isFinished;
|
bool m_isFinished;
|
||||||
|
// 强制结束标志(stop后没反应的情况,系统处于睡眠状态)
|
||||||
|
bool m_isForce;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ UDiskSystemBackupProxy::UDiskSystemBackupProxy()
|
||||||
m_calc = new CalcBackupSize(this);
|
m_calc = new CalcBackupSize(this);
|
||||||
m_isOnlyCheck = true;
|
m_isOnlyCheck = true;
|
||||||
m_mksquashfs = nullptr;
|
m_mksquashfs = nullptr;
|
||||||
|
m_isForce = false;
|
||||||
|
|
||||||
connect(this, &UDiskSystemBackupProxy::cancel, this, &UDiskSystemBackupProxy::cancelEx);
|
connect(this, &UDiskSystemBackupProxy::cancel, this, &UDiskSystemBackupProxy::cancelEx);
|
||||||
}
|
}
|
||||||
|
@ -511,6 +512,7 @@ bool UDiskSystemBackupProxy::backup(const QStringList &args)
|
||||||
if (m_bCancel)
|
if (m_bCancel)
|
||||||
return ;
|
return ;
|
||||||
|
|
||||||
|
m_isForce = false;
|
||||||
m_isFinished = true;
|
m_isFinished = true;
|
||||||
if (result) {
|
if (result) {
|
||||||
m_backupPoint.m_state = BACKUP_PARSE_STATE_SUCCESS_STRTING;
|
m_backupPoint.m_state = BACKUP_PARSE_STATE_SUCCESS_STRTING;
|
||||||
|
@ -565,23 +567,23 @@ void UDiskSystemBackupProxy::do_kylin_security(const QString& dstDir)
|
||||||
*/
|
*/
|
||||||
bool UDiskSystemBackupProxy::checkDestDirExists()
|
bool UDiskSystemBackupProxy::checkDestDirExists()
|
||||||
{
|
{
|
||||||
QDir dir(m_backupWrapper.m_prefixDestPath);
|
|
||||||
if (!dir.exists()) {
|
|
||||||
qCritical() << QString("dstDir %s is not exist!").arg(m_backupWrapper.m_prefixDestPath);
|
|
||||||
|
|
||||||
if (m_calc)
|
|
||||||
m_calc->stop();
|
|
||||||
if (m_mksquashfs)
|
|
||||||
m_mksquashfs->stop();
|
|
||||||
if (m_p)
|
|
||||||
m_p->stop();
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!m_isFinished)
|
if (!m_isFinished)
|
||||||
{
|
{
|
||||||
QTimer::singleShot(1*1000, this, &UDiskSystemBackupProxy::checkDestDirExists);
|
// 拔掉U盘后,没有响应的场景(怀疑可能是某应用程序关闭引起,希望不是dbus服务关掉了)
|
||||||
|
if (m_isForce) {
|
||||||
|
emit this->workResult(false);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Utils::isDirEmpty(m_backupWrapper.m_prefixDestPath) && m_p != nullptr) {
|
||||||
|
qCritical() << QString("dstDir %s is not exist!").arg(m_backupWrapper.m_prefixDestPath);
|
||||||
|
m_p->stop();
|
||||||
|
// 10s钟后如果还没有退出,则强制退出
|
||||||
|
QTimer::singleShot(10*1000, this, &UDiskSystemBackupProxy::checkDestDirExists);
|
||||||
|
m_isForce = true;
|
||||||
|
} else {
|
||||||
|
QTimer::singleShot(1*1000, this, &UDiskSystemBackupProxy::checkDestDirExists);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -115,6 +115,8 @@ private:
|
||||||
bool m_isOnlyCheck;
|
bool m_isOnlyCheck;
|
||||||
// img文件存放路径
|
// img文件存放路径
|
||||||
QString m_imgPath;
|
QString m_imgPath;
|
||||||
|
// 强制结束标志(stop后没反应的情况,系统处于睡眠状态)
|
||||||
|
bool m_isForce;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // UDISKSYSTEMBACKUPPROXY_H
|
#endif // UDISKSYSTEMBACKUPPROXY_H
|
||||||
|
|
|
@ -463,6 +463,7 @@ bool UDiskSystemRestoreProxy::checkUdiskExists()
|
||||||
// 拔掉U盘后,没有响应的场景(怀疑可能是某应用程序关闭引起,希望不是dbus服务关掉了)
|
// 拔掉U盘后,没有响应的场景(怀疑可能是某应用程序关闭引起,希望不是dbus服务关掉了)
|
||||||
if (m_isForce) {
|
if (m_isForce) {
|
||||||
emit this->workResult(false);
|
emit this->workResult(false);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Utils::isDirEmpty(m_backupPath) && m_p != nullptr) {
|
if (Utils::isDirEmpty(m_backupPath) && m_p != nullptr) {
|
||||||
|
|
Loading…
Reference in New Issue