This commit is contained in:
zhaominyong 2022-02-11 14:27:27 +08:00
parent 7eb91b004d
commit 2828ff5789
3 changed files with 89 additions and 91 deletions

View File

@ -739,28 +739,30 @@ bool SystemBackup::isExistsBackupName(const QString & backupName)
if (backupName == tr("factory backup"))
return true;
return false;
// 然后校验xml和log中的备份记录这一步只是为了保险而兼容老版本的备份以前的唯一性文件中只有U盘的备份
QList<ParseBackupList::BackupPoint> backupPointList = getBackupPointList();
QList<BackupWrapper> list = Utils::getBackupLogList();
QSet<QString> setName;
for (BackupWrapper& wraper : list) {
if (wraper.m_backupName == wraper.m_uuid) {
// 如果在xml中不存在则说明是此备份点是之前存在的备份点现在已经删除
for (const ParseBackupList::BackupPoint & backupPonit : backupPointList) {
if (backupPonit.m_uuid == wraper.m_uuid) {
wraper.m_backupName = backupPonit.m_backupName;
}
}
}
// QList<ParseBackupList::BackupPoint> backupPointList = getBackupPointList();
// QList<BackupWrapper> list = Utils::getBackupLogList();
// QSet<QString> setName;
// for (BackupWrapper& wraper : list) {
// if (wraper.m_backupName == wraper.m_uuid) {
// // 如果在xml中不存在则说明是此备份点是之前存在的备份点现在已经删除
// for (const ParseBackupList::BackupPoint & backupPonit : backupPointList) {
// if (backupPonit.m_uuid == wraper.m_uuid) {
// wraper.m_backupName = backupPonit.m_backupName;
// }
// }
// }
// type==8为删除备份点操作
if (BackupType::DELETE_BACKUP == wraper.m_type)
setName.remove(wraper.m_backupName);
else
setName.insert(wraper.m_backupName);
}
// // type==8为删除备份点操作
// if (BackupType::DELETE_BACKUP == wraper.m_type)
// setName.remove(wraper.m_backupName);
// else
// setName.insert(wraper.m_backupName);
// }
return setName.contains(backupName);
// return setName.contains(backupName);
}
/**

View File

@ -37,7 +37,7 @@
<context>
<name>BackupListWidget</name>
<message>
<location filename="component/backuplistwidget.cpp" line="20"/>
<location filename="component/backuplistwidget.cpp" line="21"/>
<source>File drag and drop area</source>
<translation></translation>
</message>
@ -654,43 +654,43 @@
<translation></translation>
</message>
<message>
<location filename="deletebackupdialog.cpp" line="51"/>
<location filename="deletebackupdialog.cpp" line="52"/>
<location filename="deletebackupdialog.cpp" line="53"/>
<source>Please wait while data is being removed</source>
<translation></translation>
</message>
<message>
<location filename="deletebackupdialog.cpp" line="72"/>
<location filename="deletebackupdialog.cpp" line="73"/>
<source>Removing backup point...</source>
<translation>...</translation>
</message>
<message>
<location filename="deletebackupdialog.cpp" line="89"/>
<location filename="deletebackupdialog.cpp" line="90"/>
<source>Ok</source>
<translation></translation>
</message>
<message>
<location filename="deletebackupdialog.cpp" line="134"/>
<source>Other backup or restore task is being performed.</source>
<translation></translation>
<location filename="deletebackupdialog.cpp" line="135"/>
<source>Other backup or restore task is being performed</source>
<translation></translation>
</message>
<message>
<location filename="deletebackupdialog.cpp" line="175"/>
<source>Program lock failed, please retry.</source>
<translation></translation>
<location filename="deletebackupdialog.cpp" line="176"/>
<source>Program lock failed, please retry</source>
<translation></translation>
</message>
<message>
<location filename="deletebackupdialog.cpp" line="179"/>
<source>Unsupported task type.</source>
<translation></translation>
<location filename="deletebackupdialog.cpp" line="180"/>
<source>Unsupported task type</source>
<translation></translation>
</message>
<message>
<location filename="deletebackupdialog.cpp" line="209"/>
<location filename="deletebackupdialog.cpp" line="210"/>
<source>Deleted backup successfully.</source>
<translation></translation>
</message>
<message>
<location filename="deletebackupdialog.cpp" line="211"/>
<location filename="deletebackupdialog.cpp" line="212"/>
<source>Failed to delete backup.</source>
<translation></translation>
</message>
@ -1219,9 +1219,9 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="component/backuplistwidget.cpp" line="127"/>
<location filename="component/backuplistwidget.cpp" line="136"/>
<location filename="component/backuplistwidget.cpp" line="159"/>
<location filename="component/backuplistwidget.cpp" line="128"/>
<location filename="component/backuplistwidget.cpp" line="137"/>
<location filename="component/backuplistwidget.cpp" line="160"/>
<location filename="main.cpp" line="41"/>
<location filename="maindialog.cpp" line="269"/>
<location filename="maindialog.cpp" line="276"/>
@ -1237,20 +1237,22 @@
<location filename="module/managebackuppointlist.cpp" line="49"/>
<location filename="module/selectrestorepoint.cpp" line="43"/>
<location filename="module/selectrestorepoint.cpp" line="49"/>
<location filename="module/systembackup.cpp" line="907"/>
<location filename="module/systembackup.cpp" line="909"/>
<location filename="module/systemrestore.cpp" line="201"/>
<source>Warning</source>
<translation></translation>
</message>
<message>
<location filename="component/backuplistwidget.cpp" line="128"/>
<location filename="component/backuplistwidget.cpp" line="129"/>
<source>Path already exists : </source>
<translation></translation>
</message>
<message>
<location filename="component/backuplistwidget.cpp" line="129"/>
<location filename="component/backuplistwidget.cpp" line="138"/>
<location filename="component/backuplistwidget.cpp" line="161"/>
<location filename="component/backuplistwidget.cpp" line="130"/>
<location filename="component/backuplistwidget.cpp" line="139"/>
<location filename="component/backuplistwidget.cpp" line="162"/>
<location filename="main.cpp" line="43"/>
<location filename="main.cpp" line="57"/>
<location filename="maindialog.cpp" line="271"/>
<location filename="maindialog.cpp" line="278"/>
<location filename="maindialog.cpp" line="286"/>
@ -1263,17 +1265,17 @@
<location filename="module/managebackuppointlist.cpp" line="44"/>
<location filename="module/managebackuppointlist.cpp" line="49"/>
<location filename="module/selectrestorepoint.cpp" line="43"/>
<location filename="module/systembackup.cpp" line="907"/>
<location filename="module/systembackup.cpp" line="909"/>
<source>Ok</source>
<translation></translation>
</message>
<message>
<location filename="component/backuplistwidget.cpp" line="137"/>
<location filename="component/backuplistwidget.cpp" line="138"/>
<source>The file or directory does not exist : </source>
<translation></translation>
</message>
<message>
<location filename="component/backuplistwidget.cpp" line="160"/>
<location filename="component/backuplistwidget.cpp" line="161"/>
<source>Only data that exists in the follow directorys can be selected: </source>
<translation></translation>
</message>
@ -1282,12 +1284,6 @@
<source>This tool can only be used by administrator.</source>
<translation>使</translation>
</message>
<message>
<location filename="main.cpp" line="43"/>
<location filename="main.cpp" line="57"/>
<source>Ok</source>
<translation></translation>
</message>
<message>
<location filename="main.cpp" line="55"/>
<source>Error</source>
@ -1333,7 +1329,7 @@
<message>
<location filename="module/databackup.cpp" line="1300"/>
<location filename="module/ghostimage.cpp" line="778"/>
<location filename="module/systembackup.cpp" line="907"/>
<location filename="module/systembackup.cpp" line="909"/>
<source>Are you sure to cancel the operation</source>
<translation></translation>
</message>
@ -1343,7 +1339,7 @@
<location filename="module/ghostimage.cpp" line="778"/>
<location filename="module/managebackuppointlist.cpp" line="49"/>
<location filename="module/selectrestorepoint.cpp" line="49"/>
<location filename="module/systembackup.cpp" line="907"/>
<location filename="module/systembackup.cpp" line="909"/>
<location filename="module/systemrestore.cpp" line="203"/>
<source>Cancel</source>
<translation></translation>
@ -1497,32 +1493,32 @@
<message>
<location filename="module/systembackup.cpp" line="279"/>
<location filename="module/systembackup.cpp" line="608"/>
<location filename="module/systembackup.cpp" line="788"/>
<location filename="module/systembackup.cpp" line="1105"/>
<location filename="module/systembackup.cpp" line="790"/>
<location filename="module/systembackup.cpp" line="1107"/>
<source>checking</source>
<translation></translation>
</message>
<message>
<location filename="module/systembackup.cpp" line="282"/>
<location filename="module/systembackup.cpp" line="611"/>
<location filename="module/systembackup.cpp" line="791"/>
<location filename="module/systembackup.cpp" line="1108"/>
<location filename="module/systembackup.cpp" line="793"/>
<location filename="module/systembackup.cpp" line="1110"/>
<source>preparing</source>
<translation></translation>
</message>
<message>
<location filename="module/systembackup.cpp" line="284"/>
<location filename="module/systembackup.cpp" line="614"/>
<location filename="module/systembackup.cpp" line="794"/>
<location filename="module/systembackup.cpp" line="1111"/>
<location filename="module/systembackup.cpp" line="796"/>
<location filename="module/systembackup.cpp" line="1113"/>
<source>backuping</source>
<translation></translation>
</message>
<message>
<location filename="module/systembackup.cpp" line="286"/>
<location filename="module/systembackup.cpp" line="616"/>
<location filename="module/systembackup.cpp" line="797"/>
<location filename="module/systembackup.cpp" line="1114"/>
<location filename="module/systembackup.cpp" line="799"/>
<location filename="module/systembackup.cpp" line="1116"/>
<source>finished</source>
<translation></translation>
</message>
@ -1573,85 +1569,85 @@
</message>
<message>
<location filename="module/systembackup.cpp" line="533"/>
<location filename="module/systembackup.cpp" line="965"/>
<location filename="module/systembackup.cpp" line="967"/>
<source>Program lock failed, please retry</source>
<translation></translation>
</message>
<message>
<location filename="module/systembackup.cpp" line="535"/>
<location filename="module/systembackup.cpp" line="967"/>
<location filename="module/systembackup.cpp" line="969"/>
<source>There may be other backups or restores being performed</source>
<translation>/</translation>
</message>
<message>
<location filename="module/systembackup.cpp" line="539"/>
<location filename="module/systembackup.cpp" line="971"/>
<location filename="module/systembackup.cpp" line="973"/>
<source>Unsupported task type</source>
<translation></translation>
</message>
<message>
<location filename="module/systembackup.cpp" line="541"/>
<location filename="module/systembackup.cpp" line="973"/>
<location filename="module/systembackup.cpp" line="975"/>
<source>No processing logic was found in the service</source>
<translation></translation>
</message>
<message>
<location filename="module/systembackup.cpp" line="545"/>
<location filename="module/systembackup.cpp" line="977"/>
<location filename="module/systembackup.cpp" line="979"/>
<source>Failed to mount the backup partition</source>
<translation></translation>
</message>
<message>
<location filename="module/systembackup.cpp" line="547"/>
<location filename="module/systembackup.cpp" line="979"/>
<location filename="module/systembackup.cpp" line="981"/>
<source>Check whether there is a backup partition</source>
<translation></translation>
</message>
<message>
<location filename="module/systembackup.cpp" line="551"/>
<location filename="module/systembackup.cpp" line="983"/>
<location filename="module/systembackup.cpp" line="985"/>
<source>The filesystem of device is vfat format</source>
<translation>vfat格式</translation>
</message>
<message>
<location filename="module/systembackup.cpp" line="553"/>
<location filename="module/systembackup.cpp" line="985"/>
<location filename="module/systembackup.cpp" line="987"/>
<source>Please change filesystem format to ext3ext4 or ntfs</source>
<translation>ext3ext4ntfs等文件系统格式</translation>
</message>
<message>
<location filename="module/systembackup.cpp" line="557"/>
<location filename="module/systembackup.cpp" line="989"/>
<location filename="module/systembackup.cpp" line="991"/>
<source>The device is read only</source>
<translation></translation>
</message>
<message>
<location filename="module/systembackup.cpp" line="559"/>
<location filename="module/systembackup.cpp" line="991"/>
<location filename="module/systembackup.cpp" line="993"/>
<source>Please chmod to rw</source>
<translation></translation>
</message>
<message>
<location filename="module/systembackup.cpp" line="563"/>
<location filename="module/systembackup.cpp" line="995"/>
<location filename="module/systembackup.cpp" line="997"/>
<source>The storage for backup is not enough</source>
<translation></translation>
</message>
<message>
<location filename="module/systembackup.cpp" line="565"/>
<location filename="module/systembackup.cpp" line="997"/>
<location filename="module/systembackup.cpp" line="999"/>
<source>Retry after release space</source>
<translation></translation>
</message>
<message>
<location filename="module/systembackup.cpp" line="569"/>
<location filename="module/systembackup.cpp" line="1001"/>
<location filename="module/systembackup.cpp" line="1003"/>
<source>Other backup or restore task is being performed</source>
<translation></translation>
</message>
<message>
<location filename="module/systembackup.cpp" line="571"/>
<location filename="module/systembackup.cpp" line="1003"/>
<location filename="module/systembackup.cpp" line="1005"/>
<source>Please try again later</source>
<translation></translation>
</message>
@ -1672,74 +1668,74 @@
<translation></translation>
</message>
<message>
<location filename="module/systembackup.cpp" line="855"/>
<location filename="module/systembackup.cpp" line="857"/>
<source>Cancel</source>
<translation></translation>
</message>
<message>
<location filename="module/systembackup.cpp" line="888"/>
<location filename="module/systembackup.cpp" line="890"/>
<source>Do not use computer in case of data loss</source>
<translation>使</translation>
</message>
<message>
<location filename="module/systembackup.cpp" line="1009"/>
<location filename="module/systembackup.cpp" line="1011"/>
<source>Failed to create the backup point directory</source>
<translation></translation>
</message>
<message>
<location filename="module/systembackup.cpp" line="1011"/>
<location filename="module/systembackup.cpp" line="1013"/>
<source>Please check backup partition permissions</source>
<translation></translation>
</message>
<message>
<location filename="module/systembackup.cpp" line="1015"/>
<location filename="module/systembackup.cpp" line="1017"/>
<source>The system is being compressed to the local disk, please wait patiently...</source>
<translation>...</translation>
</message>
<message>
<location filename="module/systembackup.cpp" line="1023"/>
<location filename="module/systembackup.cpp" line="1025"/>
<source>Transferring image file to mobile device, about to be completed...</source>
<translation>image文件到移动设备...</translation>
</message>
<message>
<location filename="module/systembackup.cpp" line="1028"/>
<location filename="module/systembackup.cpp" line="1030"/>
<source>The backup had been canceled</source>
<translation></translation>
</message>
<message>
<location filename="module/systembackup.cpp" line="1030"/>
<location filename="module/systembackup.cpp" line="1032"/>
<source>Re-initiate the backup if necessary</source>
<translation></translation>
</message>
<message>
<location filename="module/systembackup.cpp" line="1043"/>
<location filename="module/systembackup.cpp" line="1069"/>
<location filename="module/systembackup.cpp" line="1045"/>
<location filename="module/systembackup.cpp" line="1071"/>
<source>An error occurred during backup</source>
<translation></translation>
</message>
<message>
<location filename="module/systembackup.cpp" line="1045"/>
<location filename="module/systembackup.cpp" line="1071"/>
<location filename="module/systembackup.cpp" line="1047"/>
<location filename="module/systembackup.cpp" line="1073"/>
<source>Error messages refer to log file : /var/log/backup.log</source>
<translation>/var/log/backup.log</translation>
</message>
<message>
<location filename="module/systembackup.cpp" line="1186"/>
<location filename="module/systembackup.cpp" line="1188"/>
<source>Home Page</source>
<translation></translation>
</message>
<message>
<location filename="module/systembackup.cpp" line="1194"/>
<location filename="module/systembackup.cpp" line="1196"/>
<source>Retry</source>
<translation></translation>
</message>
<message>
<location filename="module/systembackup.cpp" line="1216"/>
<location filename="module/systembackup.cpp" line="1218"/>
<source>The backup is successful</source>
<translation></translation>
</message>
<message>
<location filename="module/systembackup.cpp" line="1230"/>
<location filename="module/systembackup.cpp" line="1232"/>
<source>The backup is failed</source>
<translation></translation>
</message>