Merge remote-tracking branch 'origin/2.3'
authorOlivier Goffart <ogoffart@woboq.com>
Thu, 16 Mar 2017 12:51:53 +0000 (13:51 +0100)
committerOlivier Goffart <ogoffart@woboq.com>
Thu, 16 Mar 2017 12:51:53 +0000 (13:51 +0100)
 Conflicts:
src/libsync/owncloudpropagator.cpp

1  2 
src/libsync/owncloudpropagator.cpp
src/libsync/owncloudpropagator.h
src/libsync/propagatedownload.cpp
src/libsync/propagateuploadv1.cpp

index 286cb34bccfdfc320e43eb45ccb0e34028e469e4,390ac7e858fa3faeedab2ca9afb6fc88da3b3023..300b7778af4075c88bc107e5829c3e088ac26c79
@@@ -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();
 +    }
  }
  
  /**
index ccb7e6d3c317495348ab4fa089c97817cec7eb7e,8fd4720c18b0e2e682dbedbca3bb225caa435467..d1812e23cc2a9c07945aae2b2248bd88d388ae44
@@@ -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) {
Simple merge
Simple merge