From: Hannah von Reth Date: Wed, 22 Apr 2020 13:23:18 +0000 (+0200) Subject: Rename csync_instructions_e -> SyncInsturctions X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~21^2~468^2~112 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4d615c31da8149ffb5e6eedde76f46a7f18c031e;p=nextcloud-desktop.git Rename csync_instructions_e -> SyncInsturctions --- diff --git a/src/csync/csync.h b/src/csync/csync.h index 95330c343..a57f38015 100644 --- a/src/csync/csync.h +++ b/src/csync/csync.h @@ -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) diff --git a/src/csync/csync_util.cpp b/src/csync/csync_util.cpp index 93bf1b36e..c134bc0f2 100644 --- a/src/csync/csync_util.cpp +++ b/src/csync/csync_util.cpp @@ -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 { diff --git a/src/gui/syncrunfilelog.cpp b/src/gui/syncrunfilelog.cpp index 77b0bf89b..2d17153e2 100644 --- a/src/gui/syncrunfilelog.cpp +++ b/src/gui/syncrunfilelog.cpp @@ -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; diff --git a/src/gui/syncrunfilelog.h b/src/gui/syncrunfilelog.h index 51b1518f9..9d325763c 100644 --- a/src/gui/syncrunfilelog.h +++ b/src/gui/syncrunfilelog.h @@ -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 _file; diff --git a/src/libsync/discoveryphase.cpp b/src/libsync/discoveryphase.cpp index 32135b388..39004ab73 100644 --- a/src/libsync/discoveryphase.cpp +++ b/src/libsync/discoveryphase.cpp @@ -159,7 +159,7 @@ QPair 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 diff --git a/src/libsync/syncengine.cpp b/src/libsync/syncengine.cpp index 3cc77c52e..54289d9f0 100644 --- a/src/libsync/syncengine.cpp +++ b/src/libsync/syncengine.cpp @@ -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 diff --git a/src/libsync/syncfileitem.h b/src/libsync/syncfileitem.h index 306b526dd..29fda0d2f 100644 --- a/src/libsync/syncfileitem.h +++ b/src/libsync/syncfileitem.h @@ -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; diff --git a/test/testpermissions.cpp b/test/testpermissions.cpp index 8fdcc62de..6836c331f 100644 --- a/test/testpermissions.cpp +++ b/test/testpermissions.cpp @@ -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; diff --git a/test/testsyncconflict.cpp b/test/testsyncconflict.cpp index bc9a0fd27..7017b976d 100644 --- a/test/testsyncconflict.cpp +++ b/test/testsyncconflict.cpp @@ -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; diff --git a/test/testsyncengine.cpp b/test/testsyncengine.cpp index a80d80076..d24160659 100644 --- a/test/testsyncengine.cpp +++ b/test/testsyncengine.cpp @@ -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; diff --git a/test/testsyncmove.cpp b/test/testsyncmove.cpp index 67809f7e1..8aca61900 100644 --- a/test/testsyncmove.cpp +++ b/test/testsyncmove.cpp @@ -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; diff --git a/test/testsyncvirtualfiles.cpp b/test/testsyncvirtualfiles.cpp index 71af44185..f46888518 100644 --- a/test/testsyncvirtualfiles.cpp +++ b/test/testsyncvirtualfiles.cpp @@ -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;