mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
propagator: Fix restoring directory
If the result of a restored directory is SoftError, this prevent to sync the rest of the directory Therefore, we introduced a new status Restored, which means that the job was a success, but is a restoration and therefore should be seen as a warning
This commit is contained in:
parent
e19214c3c4
commit
68c902e60b
@ -45,7 +45,7 @@ void PropagateItemJob::done(SyncFileItem::Status status, const QString &errorStr
|
||||
{
|
||||
if (_item._isRestoration) {
|
||||
if( status == SyncFileItem::Success || status == SyncFileItem::Conflict) {
|
||||
status = SyncFileItem::SoftError;
|
||||
status = SyncFileItem::Restoration;
|
||||
} else {
|
||||
_item._errorString += tr("; Restoration Failed: ") + errorString;
|
||||
}
|
||||
@ -85,6 +85,7 @@ void PropagateItemJob::done(SyncFileItem::Status status, const QString &errorStr
|
||||
_propagator->_journal->updateBlacklistEntry( record );
|
||||
break;
|
||||
case SyncFileItem::Success:
|
||||
case SyncFileItem::Restoration:
|
||||
if( _item._blacklistedInDb ) {
|
||||
// wipe blacklist entry.
|
||||
_propagator->_journal->wipeBlacklistEntry(_item._file);
|
||||
@ -161,7 +162,8 @@ void PropagateItemJob::slotRestoreJobCompleted(const SyncFileItem& item )
|
||||
_restoreJob->setRestoreJobMsg();
|
||||
}
|
||||
|
||||
if( item._status == SyncFileItem::Success || item._status == SyncFileItem::Conflict) {
|
||||
if( item._status == SyncFileItem::Success || item._status == SyncFileItem::Conflict
|
||||
|| item._status == SyncFileItem::Restoration) {
|
||||
done( SyncFileItem::SoftError, msg);
|
||||
} else {
|
||||
done( item._status, tr("A file or directory was removed from a read only share, but restoring failed: %1").arg(item._errorString) );
|
||||
@ -388,7 +390,8 @@ void PropagateDirectory::start()
|
||||
|
||||
void PropagateDirectory::slotSubJobFinished(SyncFileItem::Status status)
|
||||
{
|
||||
if (status == SyncFileItem::FatalError || (_current == -1 && status != SyncFileItem::Success)) {
|
||||
if (status == SyncFileItem::FatalError ||
|
||||
(_current == -1 && status != SyncFileItem::Success && status != SyncFileItem::Restoration)) {
|
||||
abort();
|
||||
emit finished(status);
|
||||
return;
|
||||
|
||||
@ -84,7 +84,7 @@ bool Progress::isWarningKind( SyncFileItem::Status kind)
|
||||
{
|
||||
return kind == SyncFileItem::SoftError || kind == SyncFileItem::NormalError
|
||||
|| kind == SyncFileItem::FatalError || kind == SyncFileItem::FileIgnored
|
||||
|| kind == SyncFileItem::Conflict;
|
||||
|| kind == SyncFileItem::Conflict || kind == SyncFileItem::Restoration;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -46,7 +46,8 @@ public:
|
||||
|
||||
Success, ///< The file was properly synced
|
||||
Conflict, ///< The file was properly synced, but a conflict was created
|
||||
FileIgnored ///< The file is in the ignored list
|
||||
FileIgnored, ///< The file is in the ignored list
|
||||
Restoration ///< The file was restored because what should have been done was not allowed
|
||||
};
|
||||
|
||||
SyncFileItem() : _type(UnknownType), _direction(None), _isDirectory(false),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user