blob: 86d214908b7cd2c75f93a61b4cb68a916b3a37ed (
plain)
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
/*
* Copyright (C) by Klaas Freitag <freitag@owncloud.com>
*
* 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.
*/
#ifndef SYNCJOURNALFILERECORD_H
#define SYNCJOURNALFILERECORD_H
#include <QString>
#include <QDateTime>
#include "owncloudlib.h"
namespace OCC {
class SyncFileItem;
/**
* @brief The SyncJournalFileRecord class
* @ingroup libsync
*/
class OWNCLOUDSYNC_EXPORT SyncJournalFileRecord
{
public:
SyncJournalFileRecord();
bool isValid()
{
return !_path.isEmpty();
}
/** Returns the numeric part of the full id in _fileId.
*
* On the server this is sometimes known as the internal file id.
*
* It is used in the construction of private links.
*/
QByteArray numericFileId() const;
QString _path;
quint64 _inode;
QDateTime _modtime;
int _type;
QByteArray _etag;
QByteArray _fileId;
qint64 _fileSize;
QByteArray _remotePerm;
bool _serverHasIgnoredFiles;
QByteArray _checksumHeader;
};
bool OWNCLOUDSYNC_EXPORT
operator==(const SyncJournalFileRecord &lhs,
const SyncJournalFileRecord &rhs);
class SyncJournalErrorBlacklistRecord
{
public:
enum Category {
/// Normal errors have no special behavior
Normal = 0,
/// These get a special summary message
InsufficientRemoteStorage
};
SyncJournalErrorBlacklistRecord()
: _retryCount(0)
, _errorCategory(Category::Normal)
, _lastTryModtime(0)
, _lastTryTime(0)
, _ignoreDuration(0)
{
}
/// The number of times the operation was unsuccessful so far.
int _retryCount;
/// The last error string.
QString _errorString;
/// The error category. Sometimes used for special actions.
Category _errorCategory;
time_t _lastTryModtime;
QByteArray _lastTryEtag;
/// The last time the operation was attempted (in s since epoch).
time_t _lastTryTime;
/// The number of seconds the file shall be ignored.
time_t _ignoreDuration;
QString _file;
QString _renameTarget;
bool isValid() const;
};
}
#endif // SYNCJOURNALFILERECORD_H
|