From: Olivier Goffart Date: Thu, 16 Mar 2017 12:51:53 +0000 (+0100) Subject: Merge remote-tracking branch 'origin/2.3' X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~790 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=574435687ddf841e46acefc94464d01d25f09de3;p=nextcloud-desktop.git Merge remote-tracking branch 'origin/2.3' Conflicts: src/libsync/owncloudpropagator.cpp --- 574435687ddf841e46acefc94464d01d25f09de3 diff --cc src/libsync/owncloudpropagator.cpp index 286cb34bc,390ac7e85..300b7778a --- a/src/libsync/owncloudpropagator.cpp +++ b/src/libsync/owncloudpropagator.cpp @@@ -167,15 -261,8 +261,13 @@@ void PropagateItemJob::done(SyncFileIte break; } - _item->_status = status; - - emit itemCompleted(_item); + emit propagator()->itemCompleted(_item); - emit finished(status); + emit finished(_item->_status); + - if (status == SyncFileItem::FatalError) { ++ if (_item->_status == SyncFileItem::FatalError) { + // Abort all remaining jobs. + propagator()->abort(); + } } /** diff --cc src/libsync/owncloudpropagator.h index ccb7e6d3c,8fd4720c1..d1812e23c --- a/src/libsync/owncloudpropagator.h +++ b/src/libsync/owncloudpropagator.h @@@ -141,8 -160,9 +141,9 @@@ private public: PropagateItemJob(OwncloudPropagator* propagator, const SyncFileItemPtr &item) : PropagatorJob(propagator), _item(item) {} + ~PropagateItemJob(); - bool scheduleNextJob() Q_DECL_OVERRIDE { + bool scheduleSelfOrChild() Q_DECL_OVERRIDE { if (_state != NotYetStarted) { return false; } @@@ -321,13 -308,25 +322,29 @@@ public int hardMaximumActiveJob(); bool isInSharedDirectory(const QString& file); + + /** Check whether a download would clash with an existing file + * in filesystems that are only case-preserving. + */ bool localFileNameClash(const QString& relfile); + + /** Check whether a file is properly accessible for upload. + * + * It is possible to create files with filenames that differ + * only by case in NTFS, but most operations such as stat and + * open only target one of these by default. + * + * When that happens, we want to avoid uploading incorrect data + * and give up on the file. + */ + bool hasCaseClashAccessibilityProblem(const QString& relfile); + QString getFilePath(const QString& tmp_file_name) const; + PropagateItemJob *createJob(const SyncFileItemPtr& item); + void scheduleNextJob(); + void reportProgress(const SyncFileItem&, quint64 bytes); + void abort() { _abortRequested.fetchAndStoreOrdered(true); if (_rootJob) {