* 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) */
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.
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)
struct _instr_code_struct {
const char *instr_str;
- enum csync_instructions_e instr_code;
+ SyncInstructions instr_code;
};
struct csync_memstat_s {
return re;
}
-QString SyncRunFileLog::instructionToStr(csync_instructions_e inst)
+QString SyncRunFileLog::instructionToStr(SyncInstructions inst)
{
QString re;
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;
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
return true;
}
-static bool isFileTransferInstruction(csync_instructions_e instruction)
+static bool isFileTransferInstruction(SyncInstructions instruction)
{
return instruction == CSYNC_INSTRUCTION_CONFLICT
|| instruction == CSYNC_INSTRUCTION_NEW
// 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;
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;
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;
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;
}
};
-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;
#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;