-
Notifications
You must be signed in to change notification settings - Fork 668
/
propagatorjobs.h
85 lines (74 loc) · 2.39 KB
/
propagatorjobs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
* Copyright (C) by Olivier Goffart <[email protected]>
* Copyright (C) by Klaas Freitag <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/
#pragma once
#include "owncloudpropagator.h"
#include <QFile>
#include <qdebug.h>
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";
/**
* @brief Declaration of the other propagation jobs
* @ingroup libsync
*/
class PropagateLocalRemove : public PropagateItemJob {
Q_OBJECT
public:
PropagateLocalRemove (OwncloudPropagator* propagator,const SyncFileItemPtr& item) : PropagateItemJob(propagator, item) {}
void start() Q_DECL_OVERRIDE;
private:
bool removeRecursively(const QString &path);
QString _error;
};
/**
* @brief The PropagateLocalMkdir class
* @ingroup libsync
*/
class PropagateLocalMkdir : public PropagateItemJob {
Q_OBJECT
public:
PropagateLocalMkdir (OwncloudPropagator* propagator,const SyncFileItemPtr& item)
: PropagateItemJob(propagator, item), _deleteExistingFile(false) {}
void start() Q_DECL_OVERRIDE;
/**
* Whether an existing file with the same name may be deleted before
* creating the directory.
*
* Default: false.
*/
void setDeleteExistingFile(bool enabled);
private:
bool _deleteExistingFile;
};
/**
* @brief The PropagateLocalRename class
* @ingroup libsync
*/
class PropagateLocalRename : public PropagateItemJob {
Q_OBJECT
public:
PropagateLocalRename (OwncloudPropagator* propagator,const SyncFileItemPtr& item) : PropagateItemJob(propagator, item) {}
void start() Q_DECL_OVERRIDE;
JobParallelism parallelism() Q_DECL_OVERRIDE { return WaitForFinishedInParentDirectory; }
};
}