sdk修改后的QFileDialog好多功能都不能用了,需要补漏

This commit is contained in:
赵民勇 2022-09-14 17:50:24 +08:00
parent 94fded1009
commit 58d6b646a8
6 changed files with 598 additions and 530 deletions

View File

@ -481,6 +481,25 @@ void DataBackup::initSecondWidget()
QStringList selectFiles = fileDialog.selectedFiles(); QStringList selectFiles = fileDialog.selectedFiles();
if (!selectFiles.isEmpty()) { if (!selectFiles.isEmpty()) {
QString fileName = selectFiles.at(0); QString fileName = selectFiles.at(0);
// sdk重新实现了QFileDialog后很多功能已经丢失需要再次进行过滤真难用
if (fileName == BACKUP_PATH || fileName.contains(BACKUP_SNAPSHOTS_PATH)) {
// 不能嵌套备份,请选择其它目录
MessageBoxUtils::QMESSAGE_BOX_WARNING(GlobelBackupInfo::inst().getMainWidget(), QObject::tr("Information"),
QObject::tr("Cannot nest backups, please select another directory."),
QObject::tr("Ok"));
return ;
} else if (fileName.endsWith(BACKUP_PATH)) {
QString subfile = fileName + "/snapshots";
if (Utils::isDirExist(subfile + "/snapshots")) {
// 不能嵌套备份,请选择其它目录
MessageBoxUtils::QMESSAGE_BOX_WARNING(GlobelBackupInfo::inst().getMainWidget(), QObject::tr("Information"),
QObject::tr("Cannot nest backups, please select another directory."),
QObject::tr("Ok"));
return ;
}
}
if (this->m_udiskPaths.contains(fileName)) { if (this->m_udiskPaths.contains(fileName)) {
comboSelect->setCurrentIndex(this->m_udiskPaths.indexOf(fileName)); comboSelect->setCurrentIndex(this->m_udiskPaths.indexOf(fileName));
this->m_customizePath = ""; this->m_customizePath = "";

View File

@ -337,6 +337,25 @@ void SystemBackup::initSecondWidget()
QStringList selectFiles = fileDialog.selectedFiles(); QStringList selectFiles = fileDialog.selectedFiles();
if (!selectFiles.isEmpty()) { if (!selectFiles.isEmpty()) {
QString fileName = selectFiles.at(0); QString fileName = selectFiles.at(0);
// sdk重新实现了QFileDialog后很多功能已经丢失需要再次进行过滤真难用
if (fileName == BACKUP_PATH || fileName.contains(BACKUP_SNAPSHOTS_PATH)) {
// 不能嵌套备份,请选择其它目录
MessageBoxUtils::QMESSAGE_BOX_WARNING(GlobelBackupInfo::inst().getMainWidget(), QObject::tr("Information"),
QObject::tr("Cannot nest backups, please select another directory."),
QObject::tr("Ok"));
return ;
} else if (fileName.endsWith(BACKUP_PATH)) {
QString subfile = fileName + "/snapshots";
if (Utils::isDirExist(subfile + "/snapshots")) {
// 不能嵌套备份,请选择其它目录
MessageBoxUtils::QMESSAGE_BOX_WARNING(GlobelBackupInfo::inst().getMainWidget(), QObject::tr("Information"),
QObject::tr("Cannot nest backups, please select another directory."),
QObject::tr("Ok"));
return ;
}
}
if (this->m_udiskPaths.contains(fileName)) { if (this->m_udiskPaths.contains(fileName)) {
comboSelect->setCurrentIndex(this->m_udiskPaths.indexOf(fileName)); comboSelect->setCurrentIndex(this->m_udiskPaths.indexOf(fileName));
this->m_customizePath = ""; this->m_customizePath = "";

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff