Propagator: checksum constants go to propatorjobs header.
authorKlaas Freitag <freitag@owncloud.com>
Fri, 15 May 2015 08:50:13 +0000 (10:50 +0200)
committerKlaas Freitag <freitag@owncloud.com>
Tue, 19 May 2015 15:09:40 +0000 (17:09 +0200)
So they can be used from both up- and download propagator jobs.

src/libsync/propagateupload.cpp
src/libsync/propagatorjobs.h

index eb5346cb3db835a13b1cd31f3e810b3062ea500f..bdd6a48607a46499dfe2e71bcde823745a4d61c9 100644 (file)
@@ -43,14 +43,6 @@ const char owncloudShouldSoftCancelPropertyName[] = "owncloud-should-soft-cancel
 
 namespace OCC {
 
-/**
- * Tags for checksum headers.
- */
-static const char checkSumMD5C[] = "MD5";
-static const char checkSumSHA1C[] = "SHA1";
-static const char checkSumAdlerC[] = "Adler32";
-static const char checkSumAdlerUpperC[] = "ADLER32";
-
 /**
  * We do not want to upload files that are currently being modified.
  * To avoid that, we don't upload files that have a modification time
@@ -503,7 +495,7 @@ void PropagateUploadFileQNAM::startNextChunk()
                 currentChunkSize = chunkSize();
             }
             if( !_item._checksum.isEmpty() ) {
-                headers["OC-Checksum"] = _item._checksum;
+                headers[checkSumHeaderC] = _item._checksum;
             }
         }
     }
index 99343fe9b3eb70daf92871bceb0f3824cd997dc3..463cb07b62ab8c11a74f15d35a6dc5d7da911cb2 100644 (file)
 
 namespace OCC {
 
+/**
+ * Tags for checksum headers.
+ * They are here for being shared between Upload- and Download Job
+ */
+
+// the header itself
+static const char checkSumHeaderC[] = "OC-Checksum";
+// ...and it's values
+static const char checkSumMD5C[] = "MD5";
+static const char checkSumSHA1C[] = "SHA1";
+static const char checkSumAdlerC[] = "Adler32";
+static const char checkSumAdlerUpperC[] = "ADLER32";
+
+/**
+ * Declaration of the other propation jobs
+ */
 class PropagateLocalRemove : public PropagateItemJob {
     Q_OBJECT
 public: