Rename csync_instructions_e -> SyncInsturctions
authorHannah von Reth <hannah.vonreth@owncloud.com>
Wed, 22 Apr 2020 13:23:18 +0000 (15:23 +0200)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 15 Dec 2020 09:59:10 +0000 (10:59 +0100)
12 files changed:
src/csync/csync.h
src/csync/csync_util.cpp
src/gui/syncrunfilelog.cpp
src/gui/syncrunfilelog.h
src/libsync/discoveryphase.cpp
src/libsync/syncengine.cpp
src/libsync/syncfileitem.h
test/testpermissions.cpp
test/testsyncconflict.cpp
test/testsyncengine.cpp
test/testsyncmove.cpp
test/testsyncvirtualfiles.cpp

index 95330c343d147faeb4e56ff89c41c75ede3b0295..a57f38015eacd4b43d11e9849102f349c2809f24 100644 (file)
@@ -103,7 +103,7 @@ Q_ENUM_NS(csync_status_codes_e)
   * Instruction enum. In the file traversal structure, it describes
   * the csync state of a file.
   */
-enum csync_instructions_e {
+enum SyncInstructions {
     CSYNC_INSTRUCTION_NONE            = 0,       /* Nothing to do (UPDATE|RECONCILE) */
     CSYNC_INSTRUCTION_EVAL            = 1 << 0,  /* There was changed compared to the DB (UPDATE) */
     CSYNC_INSTRUCTION_REMOVE          = 1 << 1,  /* The file need to be removed (RECONCILE) */
@@ -122,7 +122,7 @@ enum csync_instructions_e {
                                                     but without any propagation (UPDATE|RECONCILE) */
 };
 
-Q_ENUM_NS(csync_instructions_e)
+Q_ENUM_NS(SyncInstructions)
 
 // This enum is used with BITFIELD(3) and BITFIELD(4) in several places.
 // Also, this value is stored in the database, so beware of value changes.
@@ -196,7 +196,7 @@ struct OCSYNC_EXPORT csync_file_stat_s {
 
   CSYNC_STATUS error_status = CSYNC_STATUS_OK;
 
-  enum csync_instructions_e instruction = CSYNC_INSTRUCTION_NONE; /* u32 */
+  SyncInstructions instruction = CSYNC_INSTRUCTION_NONE; /* u32 */
 
   csync_file_stat_s()
     : type(ItemTypeSkip)
index 93bf1b36e14f35d58c90f9c6fbacc999b6afbe9c..c134bc0f2c220d9095d4884600c86190161d929c 100644 (file)
@@ -40,7 +40,7 @@ Q_LOGGING_CATEGORY(lcCSyncUtils, "nextcloud.sync.csync.utils", QtInfoMsg)
 
 struct _instr_code_struct {
   const char *instr_str;
-  enum csync_instructions_e instr_code;
+  SyncInstructions instr_code;
 };
 
 struct csync_memstat_s {
index 77b0bf89b957464cb2d96f61085d9b89195d5f75..2d17153e2879fb095e42b661fbb02dd3e69a997f 100644 (file)
@@ -39,7 +39,7 @@ QString SyncRunFileLog::directionToStr(SyncFileItem::Direction dir)
     return re;
 }
 
-QString SyncRunFileLog::instructionToStr(csync_instructions_e inst)
+QString SyncRunFileLog::instructionToStr(SyncInstructions inst)
 {
     QString re;
 
index 51b1518f947c3945c43655bb0519d9ceb3700e98..9d325763ced4fdd8ce331a9156c69cb5fab594c1 100644 (file)
@@ -43,7 +43,7 @@ public:
 protected:
 private:
     QString dateTimeStr(const QDateTime &dt);
-    QString instructionToStr(csync_instructions_e inst);
+    QString instructionToStr(SyncInstructions inst);
     QString directionToStr(SyncFileItem::Direction dir);
 
     QScopedPointer<QFile> _file;
index 32135b388d0c507ffd0b5b976544eda4f8fdcbfc..39004ab73f09a022829a4603c65b4e0ab745cd4c 100644 (file)
@@ -159,7 +159,7 @@ QPair<bool, QByteArray> DiscoveryPhase::findAndCancelDeletedJob(const QString &o
     QByteArray oldEtag;
     auto it = _deletedItem.find(originalPath);
     if (it != _deletedItem.end()) {
-        const csync_instructions_e instruction = (*it)->_instruction;
+        const SyncInstructions instruction = (*it)->_instruction;
         if (instruction == CSYNC_INSTRUCTION_IGNORE && (*it)->_type == ItemTypeVirtualFile) {
             // re-creation of virtual files count as a delete
             // a file might be in an error state and thus gets marked as CSYNC_INSTRUCTION_IGNORE
index 3cc77c52e3b9ed24dc32a2da89e28fbf7cf4f70e..54289d9f0e8e24c53972f30b3ed6fa0e3b2e4739 100644 (file)
@@ -193,7 +193,7 @@ bool SyncEngine::checkErrorBlacklisting(SyncFileItem &item)
     return true;
 }
 
-static bool isFileTransferInstruction(csync_instructions_e instruction)
+static bool isFileTransferInstruction(SyncInstructions instruction)
 {
     return instruction == CSYNC_INSTRUCTION_CONFLICT
         || instruction == CSYNC_INSTRUCTION_NEW
index 306b526dd0ca0bfca0ffb55373e206f17e6bb94e..29fda0d2fb155ec934c27305164ab034abbb9825 100644 (file)
@@ -250,7 +250,7 @@ public:
     // usually this value is 1, but for removes on dirs, it might be much higher.
 
     // Variables used by the propagator
-    csync_instructions_e _instruction = CSYNC_INSTRUCTION_NONE;
+    SyncInstructions _instruction = CSYNC_INSTRUCTION_NONE;
     time_t _modtime = 0;
     QByteArray _etag;
     qint64 _size = 0;
index 8fdcc62de6dbcda94e5b5e016fe3610a34c72a88..6836c331f7eea7301ccac5e43059d29af6b26d3d 100644 (file)
@@ -50,13 +50,13 @@ SyncFileItemPtr findDiscoveryItem(const SyncFileItemVector &spy, const QString &
     return SyncFileItemPtr(new SyncFileItem);
 }
 
-bool itemInstruction(const ItemCompletedSpy &spy, const QString &path, const csync_instructions_e instr)
+bool itemInstruction(const ItemCompletedSpy &spy, const QString &path, const SyncInstructions instr)
 {
     auto item = spy.findItem(path);
     return item->_instruction == instr;
 }
 
-bool discoveryInstruction(const SyncFileItemVector &spy, const QString &path, const csync_instructions_e instr)
+bool discoveryInstruction(const SyncFileItemVector &spy, const QString &path, const SyncInstructions instr)
 {
     auto item = findDiscoveryItem(spy, path);
     return item->_instruction == instr;
index bc9a0fd276790eb1ec646a09f3619c2e387b21a2..7017b976d7b98f61e9bb8c315f2cb8cd598783f1 100644 (file)
@@ -11,7 +11,7 @@
 
 using namespace OCC;
 
-bool itemSuccessful(const ItemCompletedSpy &spy, const QString &path, const csync_instructions_e instr)
+bool itemSuccessful(const ItemCompletedSpy &spy, const QString &path, const SyncInstructions instr)
 {
     auto item = spy.findItem(path);
     return item->_status == SyncFileItem::Success && item->_instruction == instr;
index a80d8007604fdbf701e8656a82e3ad5ee0089340..d241606595ee775efb6a6f204776b88e26911eff 100644 (file)
@@ -19,7 +19,7 @@ bool itemDidComplete(const ItemCompletedSpy &spy, const QString &path)
     return false;
 }
 
-bool itemInstruction(const ItemCompletedSpy &spy, const QString &path, const csync_instructions_e instr)
+bool itemInstruction(const ItemCompletedSpy &spy, const QString &path, const SyncInstructions instr)
 {
     auto item = spy.findItem(path);
     return item->_instruction == instr;
index 67809f7e1e39c689ff38c4ed6a8e753b9d7baa77..8aca619009725bb5a6e610fffa1ff0e90dca6d6f 100644 (file)
@@ -35,7 +35,7 @@ struct OperationCounter {
     }
 };
 
-bool itemSuccessful(const ItemCompletedSpy &spy, const QString &path, const csync_instructions_e instr)
+bool itemSuccessful(const ItemCompletedSpy &spy, const QString &path, const SyncInstructions instr)
 {
     auto item = spy.findItem(path);
     return item->_status == SyncFileItem::Success && item->_instruction == instr;
index 71af4418547f7470526caae2e72d3fce8beb1232..f4688851853359650cabec6518c2a448abbf36fb 100644 (file)
@@ -15,7 +15,7 @@ using namespace OCC;
 
 #define DVSUFFIX APPLICATION_DOTVIRTUALFILE_SUFFIX
 
-bool itemInstruction(const ItemCompletedSpy &spy, const QString &path, const csync_instructions_e instr)
+bool itemInstruction(const ItemCompletedSpy &spy, const QString &path, const SyncInstructions instr)
 {
     auto item = spy.findItem(path);
     return item->_instruction == instr;