[Pkg-owncloud-commits] [owncloud-client] 64/171: Fix OK statuses not being broadcasted during a sync #3944
Sandro Knauß
hefee-guest at moszumanska.debian.org
Wed Feb 17 09:36:49 UTC 2016
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to annotated tag upstream/2.1.1+dfsg
in repository owncloud-client.
commit 6e3809528e5d160f5f08e110a8ffd897acd3508a
Author: Jocelyn Turcotte <jturcotte at woboq.com>
Date: Tue Jan 5 15:03:23 2016 +0100
Fix OK statuses not being broadcasted during a sync #3944
Since the presence of any path in SyncEngine::_syncedItems
would translate in a SYNC status, platforms that don't refresh
all their status cache after an UPDATE_VIEW message like OS X
or Windows would keep displaying that status even after all
files are successfully synchronized.
- Read SyncFileItem::_status to determine the status to display mid-sync
- Match moved paths also to _renameTarget since this might be the
path to match
- Make sure that PropagateDirectory jobs also set SyncFileItem::_status
properly
---
src/libsync/owncloudpropagator.cpp | 3 ++-
src/libsync/syncengine.cpp | 16 ++++++++++++----
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/src/libsync/owncloudpropagator.cpp b/src/libsync/owncloudpropagator.cpp
index f016601..4d31c42 100644
--- a/src/libsync/owncloudpropagator.cpp
+++ b/src/libsync/owncloudpropagator.cpp
@@ -663,8 +663,9 @@ void PropagateDirectory::finalize()
}
}
_state = Finished;
+ _item->_status = _hasError == SyncFileItem::NoStatus ? SyncFileItem::Success : _hasError;
emit itemCompleted(*_item, *this);
- emit finished(_hasError == SyncFileItem::NoStatus ? SyncFileItem::Success : _hasError);
+ emit finished(_item->_status);
}
qint64 PropagateDirectory::committedDiskSpace() const
diff --git a/src/libsync/syncengine.cpp b/src/libsync/syncengine.cpp
index 0fa7dc8..e5312e7 100644
--- a/src/libsync/syncengine.cpp
+++ b/src/libsync/syncengine.cpp
@@ -1221,12 +1221,20 @@ bool SyncEngine::estimateState(QString fn, csync_ftw_type_e t, SyncFileStatus* s
}
Q_FOREACH(const SyncFileItemPtr &item, _syncedItems) {
- //qDebug() << Q_FUNC_INFO << fn << item._file << fn.startsWith(item._file) << item._file.startsWith(fn);
+ //qDebug() << Q_FUNC_INFO << fn << item->_status << item->_file << fn.startsWith(item->_file) << item->_file.startsWith(fn);
if (item->_file.startsWith(pat) ||
- item->_file == fn /* the same directory or file */) {
- qDebug() << Q_FUNC_INFO << "Setting" << fn << " to STATUS_EVAL";
- s->set(SyncFileStatus::STATUS_EVAL);
+ item->_file == fn || item->_renameTarget == fn /* the same directory or file */) {
+ if (item->_status == SyncFileItem::NormalError
+ || item->_status == SyncFileItem::FatalError)
+ s->set(SyncFileStatus::STATUS_ERROR);
+ else if (item->_status == SyncFileItem::FileIgnored)
+ s->set(SyncFileStatus::STATUS_IGNORE);
+ else if (item->_status == SyncFileItem::Success)
+ s->set(SyncFileStatus::STATUS_SYNC);
+ else
+ s->set(SyncFileStatus::STATUS_EVAL);
+ qDebug() << Q_FUNC_INFO << "Setting" << fn << "to" << s->toSocketAPIString();
return true;
}
}
--
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