[Pkg-owncloud-commits] [owncloud-client] 123/332: propagator: Fix restoring directory
Sandro Knauß
hefee-guest at moszumanska.debian.org
Thu Aug 14 21:06:48 UTC 2014
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit 68c902e60b8df67e1dba8f605ffe0afb0b4e30fb
Author: Olivier Goffart <ogoffart at woboq.com>
Date: Mon Jun 23 13:56:17 2014 +0200
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
---
src/mirall/owncloudpropagator.cpp | 9 ++++++---
src/mirall/progressdispatcher.cpp | 2 +-
src/mirall/syncfileitem.h | 3 ++-
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/mirall/owncloudpropagator.cpp b/src/mirall/owncloudpropagator.cpp
index 8644d6f..f769277 100644
--- a/src/mirall/owncloudpropagator.cpp
+++ b/src/mirall/owncloudpropagator.cpp
@@ -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;
diff --git a/src/mirall/progressdispatcher.cpp b/src/mirall/progressdispatcher.cpp
index d14c4c4..384b78d 100644
--- a/src/mirall/progressdispatcher.cpp
+++ b/src/mirall/progressdispatcher.cpp
@@ -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;
}
diff --git a/src/mirall/syncfileitem.h b/src/mirall/syncfileitem.h
index 30d3c27..4ce515f 100644
--- a/src/mirall/syncfileitem.h
+++ b/src/mirall/syncfileitem.h
@@ -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),
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list