优化备份位置选择的逻辑

This commit is contained in:
赵民勇 2022-09-15 11:17:01 +08:00
parent 58d6b646a8
commit 1003397079
2 changed files with 10 additions and 4 deletions

View File

@ -500,7 +500,10 @@ void DataBackup::initSecondWidget()
}
}
if (this->m_udiskPaths.contains(fileName)) {
if (GlobelBackupInfo::inst().hasBackupPartition() && fileName == Utils::getSysRootPath()) {
comboSelect->setCurrentIndex(0);
this->m_customizePath = "";
} else if (this->m_udiskPaths.contains(fileName)) {
comboSelect->setCurrentIndex(this->m_udiskPaths.indexOf(fileName));
this->m_customizePath = "";
} else {
@ -509,7 +512,7 @@ void DataBackup::initSecondWidget()
QLineEdit * edit = new QLineEdit;
comboSelect->setLineEdit(edit);
edit->setText(tr("customize path : ") + fileName + BACKUP_SNAPSHOTS_PATH);
edit->setText(tr("customize path : ") + QString(fileName + BACKUP_SNAPSHOTS_PATH).replace("//", "/"));
edit->setReadOnly(true);
if (listWidget->getBackupPaths().size() > 0)
nextStep->setEnabled(true);

View File

@ -356,7 +356,10 @@ void SystemBackup::initSecondWidget()
}
}
if (this->m_udiskPaths.contains(fileName)) {
if (GlobelBackupInfo::inst().hasBackupPartition() && fileName == Utils::getSysRootPath()) {
comboSelect->setCurrentIndex(0);
this->m_customizePath = "";
} else if (this->m_udiskPaths.contains(fileName)) {
comboSelect->setCurrentIndex(this->m_udiskPaths.indexOf(fileName));
this->m_customizePath = "";
} else {
@ -365,7 +368,7 @@ void SystemBackup::initSecondWidget()
QLineEdit * edit = new QLineEdit;
comboSelect->setLineEdit(edit);
edit->setText(tr("customize path : ") + fileName + BACKUP_SNAPSHOTS_PATH);
edit->setText(tr("customize path : ") + QString(fileName + BACKUP_SNAPSHOTS_PATH).replace("//", "/"));
edit->setReadOnly(true);
nextStep->setEnabled(true);
}