mirror of
https://github.com/chylex/Nextcloud-Desktop.git
synced 2025-04-25 01:15:48 +02:00
libsync: run clang-tidy modernize-use-nullptr
This commit is contained in:
parent
0d1c15a768
commit
1af9bf8abc
src/libsync
abstractnetworkjob.cppabstractnetworkjob.haccessmanager.haccount.cppaccount.hbandwidthmanager.cppclientsideencryption.cppclientsideencryptionjobs.hconfigfile.hcookiejar.h
creds
discoveryphase.cppdiscoveryphase.hlogger.cpplogger.hnetworkjobs.howncloudpropagator.cppowncloudpropagator.howncloudpropagator_p.hprogressdispatcher.cppprogressdispatcher.hpropagatedownload.cpppropagatedownload.hpropagateremotedelete.hpropagateremotemove.hpropagateupload.cpppropagateupload.htheme.cpptheme.h@ -50,7 +50,7 @@ AbstractNetworkJob::AbstractNetworkJob(AccountPtr account, const QString &path,
|
||||
, _followRedirects(true)
|
||||
, _account(account)
|
||||
, _ignoreCredentialFailure(false)
|
||||
, _reply(0)
|
||||
, _reply(nullptr)
|
||||
, _path(path)
|
||||
, _redirectCount(0)
|
||||
{
|
||||
@ -279,7 +279,7 @@ QString AbstractNetworkJob::errorStringParsingBody(QByteArray *body)
|
||||
|
||||
AbstractNetworkJob::~AbstractNetworkJob()
|
||||
{
|
||||
setReply(0);
|
||||
setReply(nullptr);
|
||||
}
|
||||
|
||||
void AbstractNetworkJob::start()
|
||||
|
@ -39,7 +39,7 @@ class OWNCLOUDSYNC_EXPORT AbstractNetworkJob : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit AbstractNetworkJob(AccountPtr account, const QString &path, QObject *parent = 0);
|
||||
explicit AbstractNetworkJob(AccountPtr account, const QString &path, QObject *parent = nullptr);
|
||||
virtual ~AbstractNetworkJob();
|
||||
|
||||
virtual void start();
|
||||
@ -86,7 +86,7 @@ public:
|
||||
*
|
||||
* Warning: Needs to call reply()->readAll().
|
||||
*/
|
||||
QString errorStringParsingBody(QByteArray *body = 0);
|
||||
QString errorStringParsingBody(QByteArray *body = nullptr);
|
||||
|
||||
/** static variable the HTTP timeout (in seconds). If set to 0, the default will be used
|
||||
*/
|
||||
@ -120,14 +120,14 @@ protected:
|
||||
*/
|
||||
QNetworkReply *sendRequest(const QByteArray &verb, const QUrl &url,
|
||||
QNetworkRequest req = QNetworkRequest(),
|
||||
QIODevice *requestBody = 0);
|
||||
QIODevice *requestBody = nullptr);
|
||||
|
||||
// sendRequest does not take a relative path instead of an url,
|
||||
// but the old API allowed that. We have this undefined overload
|
||||
// to help catch usage errors
|
||||
QNetworkReply *sendRequest(const QByteArray &verb, const QString &relativePath,
|
||||
QNetworkRequest req = QNetworkRequest(),
|
||||
QIODevice *requestBody = 0);
|
||||
QIODevice *requestBody = nullptr);
|
||||
|
||||
/** Makes this job drive a pre-made QNetworkReply
|
||||
*
|
||||
|
@ -32,12 +32,12 @@ class OWNCLOUDSYNC_EXPORT AccessManager : public QNetworkAccessManager
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
AccessManager(QObject *parent = 0);
|
||||
AccessManager(QObject *parent = nullptr);
|
||||
|
||||
void setRawCookie(const QByteArray &rawCookie, const QUrl &url);
|
||||
|
||||
protected:
|
||||
QNetworkReply *createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice *outgoingData = 0) override;
|
||||
QNetworkReply *createRequest(QNetworkAccessManager::Operation op, const QNetworkRequest &request, QIODevice *outgoingData = nullptr) override;
|
||||
};
|
||||
|
||||
} // namespace OCC
|
||||
|
@ -152,10 +152,10 @@ AbstractCredentials *Account::credentials() const
|
||||
void Account::setCredentials(AbstractCredentials *cred)
|
||||
{
|
||||
// set active credential manager
|
||||
QNetworkCookieJar *jar = 0;
|
||||
QNetworkCookieJar *jar = nullptr;
|
||||
if (_am) {
|
||||
jar = _am->cookieJar();
|
||||
jar->setParent(0);
|
||||
jar->setParent(nullptr);
|
||||
|
||||
_am = QSharedPointer<QNetworkAccessManager>();
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ public:
|
||||
QNetworkReply *sendRawRequest(const QByteArray &verb,
|
||||
const QUrl &url,
|
||||
QNetworkRequest req = QNetworkRequest(),
|
||||
QIODevice *data = 0);
|
||||
QIODevice *data = nullptr);
|
||||
|
||||
/** Create and start network job for a simple one-off request.
|
||||
*
|
||||
@ -149,7 +149,7 @@ public:
|
||||
SimpleNetworkJob *sendRequest(const QByteArray &verb,
|
||||
const QUrl &url,
|
||||
QNetworkRequest req = QNetworkRequest(),
|
||||
QIODevice *data = 0);
|
||||
QIODevice *data = nullptr);
|
||||
|
||||
/** The ssl configuration during the first connection */
|
||||
QSslConfiguration getOrCreateSslConfig();
|
||||
@ -267,7 +267,7 @@ protected Q_SLOTS:
|
||||
void slotCredentialsAsked();
|
||||
|
||||
private:
|
||||
Account(QObject *parent = 0);
|
||||
Account(QObject *parent = nullptr);
|
||||
void setSharedThis(AccountPtr sharedThis);
|
||||
|
||||
QWeakPointer<Account> _sharedThis;
|
||||
|
@ -47,10 +47,10 @@ static qint64 relativeLimitMeasuringTimerIntervalMsec = 1000 * 2;
|
||||
BandwidthManager::BandwidthManager(OwncloudPropagator *p)
|
||||
: QObject()
|
||||
, _propagator(p)
|
||||
, _relativeLimitCurrentMeasuredDevice(0)
|
||||
, _relativeLimitCurrentMeasuredDevice(nullptr)
|
||||
, _relativeUploadLimitProgressAtMeasuringRestart(0)
|
||||
, _currentUploadLimit(0)
|
||||
, _relativeLimitCurrentMeasuredJob(0)
|
||||
, _relativeLimitCurrentMeasuredJob(nullptr)
|
||||
, _currentDownloadLimit(0)
|
||||
{
|
||||
_currentUploadLimit = _propagator->_uploadLimit.fetchAndAddAcquire(0);
|
||||
@ -115,7 +115,7 @@ void BandwidthManager::unregisterUploadDevice(QObject *o)
|
||||
_absoluteUploadDeviceList.removeAll(p);
|
||||
_relativeUploadDeviceList.removeAll(p);
|
||||
if (p == _relativeLimitCurrentMeasuredDevice) {
|
||||
_relativeLimitCurrentMeasuredDevice = 0;
|
||||
_relativeLimitCurrentMeasuredDevice = nullptr;
|
||||
_relativeUploadLimitProgressAtMeasuringRestart = 0;
|
||||
}
|
||||
}
|
||||
@ -142,7 +142,7 @@ void BandwidthManager::unregisterDownloadJob(QObject *o)
|
||||
GETFileJob *j = reinterpret_cast<GETFileJob *>(o); // note, we might already be in the ~QObject
|
||||
_downloadJobList.removeAll(j);
|
||||
if (_relativeLimitCurrentMeasuredJob == j) {
|
||||
_relativeLimitCurrentMeasuredJob = 0;
|
||||
_relativeLimitCurrentMeasuredJob = nullptr;
|
||||
_relativeDownloadLimitProgressAtMeasuringRestart = 0;
|
||||
}
|
||||
}
|
||||
@ -155,7 +155,7 @@ void BandwidthManager::relativeUploadMeasuringTimerExpired()
|
||||
_relativeUploadDelayTimer.start();
|
||||
return;
|
||||
}
|
||||
if (_relativeLimitCurrentMeasuredDevice == 0) {
|
||||
if (_relativeLimitCurrentMeasuredDevice == nullptr) {
|
||||
qCDebug(lcBandwidthManager) << "No device set, just waiting 1 sec";
|
||||
_relativeUploadDelayTimer.setInterval(1000);
|
||||
_relativeUploadDelayTimer.start();
|
||||
@ -201,7 +201,7 @@ void BandwidthManager::relativeUploadMeasuringTimerExpired()
|
||||
ud->giveBandwidthQuota(quotaPerDevice);
|
||||
qCDebug(lcBandwidthManager) << "Gave" << quotaPerDevice / 1024.0 << "kB to" << ud;
|
||||
}
|
||||
_relativeLimitCurrentMeasuredDevice = 0;
|
||||
_relativeLimitCurrentMeasuredDevice = nullptr;
|
||||
}
|
||||
|
||||
void BandwidthManager::relativeUploadDelayTimerExpired()
|
||||
@ -249,7 +249,7 @@ void BandwidthManager::relativeDownloadMeasuringTimerExpired()
|
||||
_relativeDownloadDelayTimer.start();
|
||||
return;
|
||||
}
|
||||
if (_relativeLimitCurrentMeasuredJob == 0) {
|
||||
if (_relativeLimitCurrentMeasuredJob == nullptr) {
|
||||
qCDebug(lcBandwidthManager) << "No job set, just waiting 1 sec";
|
||||
_relativeDownloadDelayTimer.setInterval(1000);
|
||||
_relativeDownloadDelayTimer.start();
|
||||
@ -295,7 +295,7 @@ void BandwidthManager::relativeDownloadMeasuringTimerExpired()
|
||||
gfj->giveBandwidthQuota(quotaPerJob);
|
||||
qCDebug(lcBandwidthManager) << "Gave" << quotaPerJob / 1024.0 << "kB to" << gfj;
|
||||
}
|
||||
_relativeLimitCurrentMeasuredDevice = 0;
|
||||
_relativeLimitCurrentMeasuredDevice = nullptr;
|
||||
}
|
||||
|
||||
void BandwidthManager::relativeDownloadDelayTimerExpired()
|
||||
|
@ -150,7 +150,7 @@ QByteArray encryptPrivateKey(
|
||||
}
|
||||
|
||||
/* Initialise the decryption operation. */
|
||||
if(!EVP_EncryptInit_ex(ctx, EVP_aes_256_gcm(), NULL, NULL, NULL)) {
|
||||
if(!EVP_EncryptInit_ex(ctx, EVP_aes_256_gcm(), nullptr, nullptr, nullptr)) {
|
||||
qCInfo(lcCse()) << "Error initializing context with aes_256";
|
||||
handleErrors();
|
||||
}
|
||||
@ -159,13 +159,13 @@ QByteArray encryptPrivateKey(
|
||||
EVP_CIPHER_CTX_set_padding(ctx, 0);
|
||||
|
||||
/* Set IV length. */
|
||||
if(!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_IVLEN, iv.size(), NULL)) {
|
||||
if(!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_IVLEN, iv.size(), nullptr)) {
|
||||
qCInfo(lcCse()) << "Error setting iv length";
|
||||
handleErrors();
|
||||
}
|
||||
|
||||
/* Initialise key and IV */
|
||||
if(!EVP_EncryptInit_ex(ctx, NULL, NULL, (unsigned char *)key.constData(), (unsigned char *)iv.constData())) {
|
||||
if(!EVP_EncryptInit_ex(ctx, nullptr, nullptr, (unsigned char *)key.constData(), (unsigned char *)iv.constData())) {
|
||||
qCInfo(lcCse()) << "Error initialising key and iv";
|
||||
handleErrors();
|
||||
}
|
||||
@ -242,21 +242,21 @@ QByteArray decryptPrivateKey(const QByteArray& key, const QByteArray& data) {
|
||||
}
|
||||
|
||||
/* Initialise the decryption operation. */
|
||||
if(!EVP_DecryptInit_ex(ctx, EVP_aes_256_gcm(), NULL, NULL, NULL)) {
|
||||
if(!EVP_DecryptInit_ex(ctx, EVP_aes_256_gcm(), nullptr, nullptr, nullptr)) {
|
||||
qCInfo(lcCse()) << "Error initialising context with aes 256";
|
||||
EVP_CIPHER_CTX_free(ctx);
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
/* Set IV length. Not necessary if this is 12 bytes (96 bits) */
|
||||
if(!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_IVLEN, iv.size(), NULL)) {
|
||||
if(!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_IVLEN, iv.size(), nullptr)) {
|
||||
qCInfo(lcCse()) << "Error setting IV size";
|
||||
EVP_CIPHER_CTX_free(ctx);
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
/* Initialise key and IV */
|
||||
if(!EVP_DecryptInit_ex(ctx, NULL, NULL, (unsigned char *)key.constData(), (unsigned char *)iv.constData())) {
|
||||
if(!EVP_DecryptInit_ex(ctx, nullptr, nullptr, (unsigned char *)key.constData(), (unsigned char *)iv.constData())) {
|
||||
qCInfo(lcCse()) << "Error initialising key and iv";
|
||||
EVP_CIPHER_CTX_free(ctx);
|
||||
return QByteArray();
|
||||
@ -331,21 +331,21 @@ QByteArray decryptStringSymmetric(const QByteArray& key, const QByteArray& data)
|
||||
}
|
||||
|
||||
/* Initialise the decryption operation. */
|
||||
if(!EVP_DecryptInit_ex(ctx, EVP_aes_128_gcm(), NULL, NULL, NULL)) {
|
||||
if(!EVP_DecryptInit_ex(ctx, EVP_aes_128_gcm(), nullptr, nullptr, nullptr)) {
|
||||
qCInfo(lcCse()) << "Error initialising context with aes 128";
|
||||
EVP_CIPHER_CTX_free(ctx);
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
/* Set IV length. Not necessary if this is 12 bytes (96 bits) */
|
||||
if(!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_IVLEN, iv.size(), NULL)) {
|
||||
if(!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_IVLEN, iv.size(), nullptr)) {
|
||||
qCInfo(lcCse()) << "Error setting IV size";
|
||||
EVP_CIPHER_CTX_free(ctx);
|
||||
return QByteArray();
|
||||
}
|
||||
|
||||
/* Initialise key and IV */
|
||||
if(!EVP_DecryptInit_ex(ctx, NULL, NULL, (unsigned char *)key.constData(), (unsigned char *)iv.constData())) {
|
||||
if(!EVP_DecryptInit_ex(ctx, nullptr, nullptr, (unsigned char *)key.constData(), (unsigned char *)iv.constData())) {
|
||||
qCInfo(lcCse()) << "Error initialising key and iv";
|
||||
EVP_CIPHER_CTX_free(ctx);
|
||||
return QByteArray();
|
||||
@ -394,10 +394,10 @@ QByteArray decryptStringSymmetric(const QByteArray& key, const QByteArray& data)
|
||||
QByteArray privateKeyToPem(const QByteArray key) {
|
||||
BIO *privateKeyBio = BIO_new(BIO_s_mem());
|
||||
BIO_write(privateKeyBio, key.constData(), key.size());
|
||||
EVP_PKEY *pkey = PEM_read_bio_PrivateKey(privateKeyBio, NULL, NULL, NULL);
|
||||
EVP_PKEY *pkey = PEM_read_bio_PrivateKey(privateKeyBio, nullptr, nullptr, nullptr);
|
||||
|
||||
BIO *pemBio = BIO_new(BIO_s_mem());
|
||||
PEM_write_bio_PKCS8PrivateKey(pemBio, pkey, NULL, NULL, 0, NULL, NULL);
|
||||
PEM_write_bio_PKCS8PrivateKey(pemBio, pkey, nullptr, nullptr, 0, nullptr, nullptr);
|
||||
QByteArray pem = BIO2ByteArray(pemBio);
|
||||
|
||||
BIO_free_all(privateKeyBio);
|
||||
@ -419,7 +419,7 @@ QByteArray encryptStringSymmetric(const QByteArray& key, const QByteArray& data)
|
||||
}
|
||||
|
||||
/* Initialise the decryption operation. */
|
||||
if(!EVP_EncryptInit_ex(ctx, EVP_aes_128_gcm(), NULL, NULL, NULL)) {
|
||||
if(!EVP_EncryptInit_ex(ctx, EVP_aes_128_gcm(), nullptr, nullptr, nullptr)) {
|
||||
qCInfo(lcCse()) << "Error initializing context with aes_128";
|
||||
handleErrors();
|
||||
return {};
|
||||
@ -429,14 +429,14 @@ QByteArray encryptStringSymmetric(const QByteArray& key, const QByteArray& data)
|
||||
EVP_CIPHER_CTX_set_padding(ctx, 0);
|
||||
|
||||
/* Set IV length. */
|
||||
if(!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_IVLEN, iv.size(), NULL)) {
|
||||
if(!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_IVLEN, iv.size(), nullptr)) {
|
||||
qCInfo(lcCse()) << "Error setting iv length";
|
||||
handleErrors();
|
||||
return {};
|
||||
}
|
||||
|
||||
/* Initialise key and IV */
|
||||
if(!EVP_EncryptInit_ex(ctx, NULL, NULL, (unsigned char *)key.constData(), (unsigned char *)iv.constData())) {
|
||||
if(!EVP_EncryptInit_ex(ctx, nullptr, nullptr, (unsigned char *)key.constData(), (unsigned char *)iv.constData())) {
|
||||
qCInfo(lcCse()) << "Error initialising key and iv";
|
||||
handleErrors();
|
||||
return {};
|
||||
@ -523,7 +523,7 @@ QByteArray decryptStringAsymmetric(EVP_PKEY *privateKey, const QByteArray& data)
|
||||
}
|
||||
|
||||
size_t outlen = 0;
|
||||
err = EVP_PKEY_decrypt(ctx, NULL, &outlen, (unsigned char *)data.constData(), data.size());
|
||||
err = EVP_PKEY_decrypt(ctx, nullptr, &outlen, (unsigned char *)data.constData(), data.size());
|
||||
if (err <= 0) {
|
||||
qCInfo(lcCseDecryption()) << "Could not determine the buffer length";
|
||||
handleErrors();
|
||||
@ -584,7 +584,7 @@ QByteArray encryptStringAsymmetric(EVP_PKEY *publicKey, const QByteArray& data)
|
||||
}
|
||||
|
||||
size_t outLen = 0;
|
||||
if (EVP_PKEY_encrypt(ctx, NULL, &outLen, (unsigned char *)data.constData(), data.size()) != 1) {
|
||||
if (EVP_PKEY_encrypt(ctx, nullptr, &outLen, (unsigned char *)data.constData(), data.size()) != 1) {
|
||||
qCInfo(lcCse()) << "Error retrieving the size of the encrypted data";
|
||||
exit(1);
|
||||
} else {
|
||||
@ -834,7 +834,7 @@ void ClientSideEncryption::generateKeyPair()
|
||||
EVP_PKEY *localKeyPair = nullptr;
|
||||
|
||||
// Init RSA
|
||||
EVP_PKEY_CTX *ctx = EVP_PKEY_CTX_new_id(EVP_PKEY_RSA, NULL);
|
||||
EVP_PKEY_CTX *ctx = EVP_PKEY_CTX_new_id(EVP_PKEY_RSA, nullptr);
|
||||
|
||||
if(EVP_PKEY_keygen_init(ctx) <= 0) {
|
||||
qCInfo(lcCse()) << "Couldn't initialize the key generator";
|
||||
@ -855,7 +855,7 @@ void ClientSideEncryption::generateKeyPair()
|
||||
qCInfo(lcCse()) << "Storing keys locally";
|
||||
|
||||
BIO *privKey = BIO_new(BIO_s_mem());
|
||||
if (PEM_write_bio_PrivateKey(privKey, localKeyPair, NULL, NULL, 0, NULL, NULL) <= 0) {
|
||||
if (PEM_write_bio_PrivateKey(privKey, localKeyPair, nullptr, nullptr, 0, nullptr, nullptr) <= 0) {
|
||||
qCInfo(lcCse()) << "Could not read private key from bio.";
|
||||
return;
|
||||
}
|
||||
@ -1218,7 +1218,7 @@ QByteArray FolderMetadata::encryptMetadataKey(const QByteArray& data) const {
|
||||
BIO *publicKeyBio = BIO_new(BIO_s_mem());
|
||||
QByteArray publicKeyPem = _account->e2e()->_publicKey.toPem();
|
||||
BIO_write(publicKeyBio, publicKeyPem.constData(), publicKeyPem.size());
|
||||
EVP_PKEY *publicKey = PEM_read_bio_PUBKEY(publicKeyBio, NULL, NULL, NULL);
|
||||
EVP_PKEY *publicKey = PEM_read_bio_PUBKEY(publicKeyBio, nullptr, nullptr, nullptr);
|
||||
|
||||
// The metadata key is binary so base64 encode it first
|
||||
auto ret = EncryptionHelper::encryptStringAsymmetric(publicKey, data.toBase64());
|
||||
@ -1231,7 +1231,7 @@ QByteArray FolderMetadata::decryptMetadataKey(const QByteArray& encryptedMetadat
|
||||
BIO *privateKeyBio = BIO_new(BIO_s_mem());
|
||||
QByteArray privateKeyPem = _account->e2e()->_privateKey;
|
||||
BIO_write(privateKeyBio, privateKeyPem.constData(), privateKeyPem.size());
|
||||
EVP_PKEY *key = PEM_read_bio_PrivateKey(privateKeyBio, NULL, NULL, NULL);
|
||||
EVP_PKEY *key = PEM_read_bio_PrivateKey(privateKeyBio, nullptr, nullptr, nullptr);
|
||||
|
||||
// Also base64 decode the result
|
||||
QByteArray decryptResult = EncryptionHelper::decryptStringAsymmetric(
|
||||
@ -1382,7 +1382,7 @@ bool EncryptionHelper::fileEncryption(const QByteArray &key, const QByteArray &i
|
||||
}
|
||||
|
||||
/* Initialise the decryption operation. */
|
||||
if(!EVP_EncryptInit_ex(ctx, EVP_aes_128_gcm(), NULL, NULL, NULL)) {
|
||||
if(!EVP_EncryptInit_ex(ctx, EVP_aes_128_gcm(), nullptr, nullptr, nullptr)) {
|
||||
qCInfo(lcCse()) << "Could not init cipher";
|
||||
return false;
|
||||
}
|
||||
@ -1390,13 +1390,13 @@ bool EncryptionHelper::fileEncryption(const QByteArray &key, const QByteArray &i
|
||||
EVP_CIPHER_CTX_set_padding(ctx, 0);
|
||||
|
||||
/* Set IV length. */
|
||||
if(!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_IVLEN, iv.size(), NULL)) {
|
||||
if(!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_IVLEN, iv.size(), nullptr)) {
|
||||
qCInfo(lcCse()) << "Could not set iv length";
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Initialise key and IV */
|
||||
if(!EVP_EncryptInit_ex(ctx, NULL, NULL, (const unsigned char *)key.constData(), (const unsigned char *)iv.constData())) {
|
||||
if(!EVP_EncryptInit_ex(ctx, nullptr, nullptr, (const unsigned char *)key.constData(), (const unsigned char *)iv.constData())) {
|
||||
qCInfo(lcCse()) << "Could not set key and iv";
|
||||
return false;
|
||||
}
|
||||
@ -1467,7 +1467,7 @@ bool EncryptionHelper::fileDecryption(const QByteArray &key, const QByteArray& i
|
||||
}
|
||||
|
||||
/* Initialise the decryption operation. */
|
||||
if(!EVP_DecryptInit_ex(ctx, EVP_aes_128_gcm(), NULL, NULL, NULL)) {
|
||||
if(!EVP_DecryptInit_ex(ctx, EVP_aes_128_gcm(), nullptr, nullptr, nullptr)) {
|
||||
qCInfo(lcCse()) << "Could not init cipher";
|
||||
return false;
|
||||
}
|
||||
@ -1475,13 +1475,13 @@ bool EncryptionHelper::fileDecryption(const QByteArray &key, const QByteArray& i
|
||||
EVP_CIPHER_CTX_set_padding(ctx, 0);
|
||||
|
||||
/* Set IV length. */
|
||||
if(!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_IVLEN, iv.size(), NULL)) {
|
||||
if(!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_GCM_SET_IVLEN, iv.size(), nullptr)) {
|
||||
qCInfo(lcCse()) << "Could not set iv length";
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Initialise key and IV */
|
||||
if(!EVP_DecryptInit_ex(ctx, NULL, NULL, (const unsigned char *) key.constData(), (const unsigned char *) iv.constData())) {
|
||||
if(!EVP_DecryptInit_ex(ctx, nullptr, nullptr, (const unsigned char *) key.constData(), (const unsigned char *) iv.constData())) {
|
||||
qCInfo(lcCse()) << "Could not set key and iv";
|
||||
return false;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ class OWNCLOUDSYNC_EXPORT SignPublicKeyApiJob : public AbstractNetworkJob
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SignPublicKeyApiJob(const AccountPtr &account, const QString &path, QObject *parent = 0);
|
||||
explicit SignPublicKeyApiJob(const AccountPtr &account, const QString &path, QObject *parent = nullptr);
|
||||
|
||||
/**
|
||||
* @brief setCsr - the CSR with the public key.
|
||||
@ -71,7 +71,7 @@ class OWNCLOUDSYNC_EXPORT StorePrivateKeyApiJob : public AbstractNetworkJob
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit StorePrivateKeyApiJob(const AccountPtr &account, const QString &path, QObject *parent = 0);
|
||||
explicit StorePrivateKeyApiJob(const AccountPtr &account, const QString &path, QObject *parent = nullptr);
|
||||
|
||||
/**
|
||||
* @brief setCsr - the CSR with the public key.
|
||||
@ -114,7 +114,7 @@ class OWNCLOUDSYNC_EXPORT SetEncryptionFlagApiJob : public AbstractNetworkJob
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SetEncryptionFlagApiJob(const AccountPtr &account, const QByteArray& fileId, QObject *parent = 0);
|
||||
explicit SetEncryptionFlagApiJob(const AccountPtr &account, const QByteArray& fileId, QObject *parent = nullptr);
|
||||
|
||||
public slots:
|
||||
void start() override;
|
||||
@ -134,7 +134,7 @@ class OWNCLOUDSYNC_EXPORT LockEncryptFolderApiJob : public AbstractNetworkJob
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit LockEncryptFolderApiJob(const AccountPtr &account, const QByteArray& fileId, QObject *parent = 0);
|
||||
explicit LockEncryptFolderApiJob(const AccountPtr &account, const QByteArray& fileId, QObject *parent = nullptr);
|
||||
|
||||
public slots:
|
||||
void start() override;
|
||||
@ -159,7 +159,7 @@ public:
|
||||
const AccountPtr &account,
|
||||
const QByteArray& fileId,
|
||||
const QByteArray& token,
|
||||
QObject *parent = 0);
|
||||
QObject *parent = nullptr);
|
||||
|
||||
public slots:
|
||||
void start() override;
|
||||
@ -186,7 +186,7 @@ public:
|
||||
const AccountPtr &account,
|
||||
const QByteArray& fileId,
|
||||
const QByteArray& b64Metadata,
|
||||
QObject *parent = 0);
|
||||
QObject *parent = nullptr);
|
||||
|
||||
public slots:
|
||||
void start() override;
|
||||
@ -212,7 +212,7 @@ public:
|
||||
const QByteArray& fileId,
|
||||
const QByteArray& b64Metadata,
|
||||
const QByteArray& lockedToken,
|
||||
QObject *parent = 0);
|
||||
QObject *parent = nullptr);
|
||||
|
||||
public slots:
|
||||
void start() override;
|
||||
@ -238,7 +238,7 @@ public:
|
||||
explicit GetMetadataApiJob (
|
||||
const AccountPtr &account,
|
||||
const QByteArray& fileId,
|
||||
QObject *parent = 0);
|
||||
QObject *parent = nullptr);
|
||||
|
||||
public slots:
|
||||
void start() override;
|
||||
@ -261,7 +261,7 @@ public:
|
||||
explicit DeleteMetadataApiJob (
|
||||
const AccountPtr &account,
|
||||
const QByteArray& fileId,
|
||||
QObject *parent = 0);
|
||||
QObject *parent = nullptr);
|
||||
|
||||
public slots:
|
||||
void start() override;
|
||||
@ -284,7 +284,7 @@ class OWNCLOUDSYNC_EXPORT GetFolderEncryptStatusJob : public AbstractNetworkJob
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit GetFolderEncryptStatusJob (const AccountPtr &account, const QString& folder, QObject *parent = 0);
|
||||
explicit GetFolderEncryptStatusJob (const AccountPtr &account, const QString& folder, QObject *parent = nullptr);
|
||||
|
||||
public slots:
|
||||
void start() override;
|
||||
|
@ -159,7 +159,7 @@ public:
|
||||
|
||||
/** Returns a new settings pre-set in a specific group. The Settings will be created
|
||||
with the given parent. If no parent is specified, the caller must destroy the settings */
|
||||
static std::unique_ptr<QSettings> settingsWithGroup(const QString &group, QObject *parent = 0);
|
||||
static std::unique_ptr<QSettings> settingsWithGroup(const QString &group, QObject *parent = nullptr);
|
||||
|
||||
/// Add the system and user exclude file path to the ExcludedFiles instance.
|
||||
static void setupDefaultExcludeFilePaths(ExcludedFiles &excludedFiles);
|
||||
|
@ -29,7 +29,7 @@ class OWNCLOUDSYNC_EXPORT CookieJar : public QNetworkCookieJar
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CookieJar(QObject *parent = 0);
|
||||
explicit CookieJar(QObject *parent = nullptr);
|
||||
~CookieJar();
|
||||
bool setCookiesFromUrl(const QList<QNetworkCookie> &cookieList, const QUrl &url) override;
|
||||
QList<QNetworkCookie> cookiesForUrl(const QUrl &url) const override;
|
||||
|
@ -24,7 +24,7 @@ namespace OCC {
|
||||
Q_LOGGING_CATEGORY(lcCredentials, "nextcloud.sync.credentials", QtInfoMsg)
|
||||
|
||||
AbstractCredentials::AbstractCredentials()
|
||||
: _account(0)
|
||||
: _account(nullptr)
|
||||
, _wasFetched(false)
|
||||
{
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ namespace {
|
||||
class HttpCredentialsAccessManager : public AccessManager
|
||||
{
|
||||
public:
|
||||
HttpCredentialsAccessManager(const HttpCredentials *cred, QObject *parent = 0)
|
||||
HttpCredentialsAccessManager(const HttpCredentials *cred, QObject *parent = nullptr)
|
||||
: AccessManager(parent)
|
||||
, _cred(cred)
|
||||
{
|
||||
|
@ -528,7 +528,7 @@ void DiscoveryMainThread::singleDirectoryJobResultSlot()
|
||||
|
||||
qCDebug(lcDiscovery) << "Have" << _currentDiscoveryDirectoryResult->list.size() << "results for " << _currentDiscoveryDirectoryResult->path;
|
||||
|
||||
_currentDiscoveryDirectoryResult = 0; // the sync thread owns it now
|
||||
_currentDiscoveryDirectoryResult = nullptr; // the sync thread owns it now
|
||||
|
||||
if (!_firstFolderProcessed) {
|
||||
_firstFolderProcessed = true;
|
||||
@ -549,7 +549,7 @@ void DiscoveryMainThread::singleDirectoryJobFinishedWithErrorSlot(int csyncErrno
|
||||
|
||||
_currentDiscoveryDirectoryResult->code = csyncErrnoCode;
|
||||
_currentDiscoveryDirectoryResult->msg = msg;
|
||||
_currentDiscoveryDirectoryResult = 0; // the sync thread owns it now
|
||||
_currentDiscoveryDirectoryResult = nullptr; // the sync thread owns it now
|
||||
|
||||
_discoveryJob->_vioMutex.lock();
|
||||
_discoveryJob->_vioWaitCondition.wakeAll();
|
||||
@ -598,7 +598,7 @@ void DiscoveryMainThread::slotGetSizeFinishedWithError()
|
||||
|
||||
qCWarning(lcDiscovery) << "Error getting the size of the directory";
|
||||
// just let let the discovery job continue then
|
||||
_currentGetSizeResult = 0;
|
||||
_currentGetSizeResult = nullptr;
|
||||
QMutexLocker locker(&_discoveryJob->_vioMutex);
|
||||
_discoveryJob->_vioWaitCondition.wakeAll();
|
||||
}
|
||||
@ -611,7 +611,7 @@ void DiscoveryMainThread::slotGetSizeResult(const QVariantMap &map)
|
||||
|
||||
*_currentGetSizeResult = map.value(QLatin1String("size")).toLongLong();
|
||||
qCDebug(lcDiscovery) << "Size of folder:" << *_currentGetSizeResult;
|
||||
_currentGetSizeResult = 0;
|
||||
_currentGetSizeResult = nullptr;
|
||||
QMutexLocker locker(&_discoveryJob->_vioMutex);
|
||||
_discoveryJob->_vioWaitCondition.wakeAll();
|
||||
}
|
||||
@ -630,13 +630,13 @@ void DiscoveryMainThread::abort()
|
||||
if (_discoveryJob->_vioMutex.tryLock()) {
|
||||
_currentDiscoveryDirectoryResult->msg = tr("Aborted by the user"); // Actually also created somewhere else by sync engine
|
||||
_currentDiscoveryDirectoryResult->code = EIO;
|
||||
_currentDiscoveryDirectoryResult = 0;
|
||||
_currentDiscoveryDirectoryResult = nullptr;
|
||||
_discoveryJob->_vioWaitCondition.wakeAll();
|
||||
_discoveryJob->_vioMutex.unlock();
|
||||
}
|
||||
}
|
||||
if (_currentGetSizeResult) {
|
||||
_currentGetSizeResult = 0;
|
||||
_currentGetSizeResult = nullptr;
|
||||
QMutexLocker locker(&_discoveryJob->_vioMutex);
|
||||
_discoveryJob->_vioWaitCondition.wakeAll();
|
||||
}
|
||||
@ -666,12 +666,12 @@ csync_vio_handle_t *DiscoveryJob::remote_vio_opendir_hook(const char *url,
|
||||
errno = directoryResult->code;
|
||||
// save the error string to the context
|
||||
discoveryJob->_csync_ctx->error_string = qstrdup(directoryResult->msg.toUtf8().constData());
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return directoryResult.take();
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
@ -687,7 +687,7 @@ std::unique_ptr<csync_file_stat_t> DiscoveryJob::remote_vio_readdir_hook(csync_v
|
||||
return file_stat;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void DiscoveryJob::remote_vio_closedir_hook(csync_vio_handle_t *dhandle, void *userdata)
|
||||
@ -719,10 +719,10 @@ void DiscoveryJob::start()
|
||||
_lastUpdateProgressCallbackCall.invalidate();
|
||||
int ret = csync_update(_csync_ctx);
|
||||
|
||||
_csync_ctx->callbacks.checkSelectiveSyncNewFolderHook = 0;
|
||||
_csync_ctx->callbacks.checkSelectiveSyncBlackListHook = 0;
|
||||
_csync_ctx->callbacks.update_callback = 0;
|
||||
_csync_ctx->callbacks.update_callback_userdata = 0;
|
||||
_csync_ctx->callbacks.checkSelectiveSyncNewFolderHook = nullptr;
|
||||
_csync_ctx->callbacks.checkSelectiveSyncBlackListHook = nullptr;
|
||||
_csync_ctx->callbacks.update_callback = nullptr;
|
||||
_csync_ctx->callbacks.update_callback_userdata = nullptr;
|
||||
|
||||
emit finished(ret);
|
||||
deleteLater();
|
||||
|
@ -59,7 +59,7 @@ class DiscoverySingleDirectoryJob : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DiscoverySingleDirectoryJob(const AccountPtr &account, const QString &path, QObject *parent = 0);
|
||||
explicit DiscoverySingleDirectoryJob(const AccountPtr &account, const QString &path, QObject *parent = nullptr);
|
||||
// Specify thgat this is the root and we need to check the data-fingerprint
|
||||
void setIsRootPath() { _isRootPath = true; }
|
||||
void start();
|
||||
@ -117,8 +117,8 @@ public:
|
||||
DiscoveryMainThread(AccountPtr account)
|
||||
: QObject()
|
||||
, _account(account)
|
||||
, _currentDiscoveryDirectoryResult(0)
|
||||
, _currentGetSizeResult(0)
|
||||
, _currentDiscoveryDirectoryResult(nullptr)
|
||||
, _currentGetSizeResult(nullptr)
|
||||
, _firstFolderProcessed(false)
|
||||
{
|
||||
}
|
||||
@ -187,7 +187,7 @@ class DiscoveryJob : public QObject
|
||||
|
||||
|
||||
public:
|
||||
explicit DiscoveryJob(CSYNC *ctx, QObject *parent = 0)
|
||||
explicit DiscoveryJob(CSYNC *ctx, QObject *parent = nullptr)
|
||||
: QObject(parent)
|
||||
, _csync_ctx(ctx)
|
||||
{
|
||||
|
@ -141,7 +141,7 @@ void Logger::setLogFile(const QString &name)
|
||||
{
|
||||
QMutexLocker locker(&_mutex);
|
||||
if (_logstream) {
|
||||
_logstream.reset(0);
|
||||
_logstream.reset(nullptr);
|
||||
_logFile.close();
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ public slots:
|
||||
void enterNextLogFile();
|
||||
|
||||
private:
|
||||
Logger(QObject *parent = 0);
|
||||
Logger(QObject *parent = nullptr);
|
||||
~Logger();
|
||||
QList<Log> _logs;
|
||||
bool _showTime;
|
||||
|
@ -35,7 +35,7 @@ class OWNCLOUDSYNC_EXPORT EntityExistsJob : public AbstractNetworkJob
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit EntityExistsJob(AccountPtr account, const QString &path, QObject *parent = 0);
|
||||
explicit EntityExistsJob(AccountPtr account, const QString &path, QObject *parent = nullptr);
|
||||
void start() override;
|
||||
|
||||
signals:
|
||||
@ -56,7 +56,7 @@ class OWNCLOUDSYNC_EXPORT DeleteApiJob : public AbstractNetworkJob
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DeleteApiJob(AccountPtr account, const QString &path, QObject *parent = 0);
|
||||
explicit DeleteApiJob(AccountPtr account, const QString &path, QObject *parent = nullptr);
|
||||
void start() override;
|
||||
|
||||
signals:
|
||||
@ -96,8 +96,8 @@ class OWNCLOUDSYNC_EXPORT LsColJob : public AbstractNetworkJob
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit LsColJob(AccountPtr account, const QString &path, QObject *parent = 0);
|
||||
explicit LsColJob(AccountPtr account, const QUrl &url, QObject *parent = 0);
|
||||
explicit LsColJob(AccountPtr account, const QString &path, QObject *parent = nullptr);
|
||||
explicit LsColJob(AccountPtr account, const QUrl &url, QObject *parent = nullptr);
|
||||
void start() override;
|
||||
QHash<QString, ExtraFolderInfo> _folderInfos;
|
||||
|
||||
@ -140,7 +140,7 @@ class OWNCLOUDSYNC_EXPORT PropfindJob : public AbstractNetworkJob
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit PropfindJob(AccountPtr account, const QString &path, QObject *parent = 0);
|
||||
explicit PropfindJob(AccountPtr account, const QString &path, QObject *parent = nullptr);
|
||||
void start() override;
|
||||
|
||||
/**
|
||||
@ -156,7 +156,7 @@ public:
|
||||
|
||||
signals:
|
||||
void result(const QVariantMap &values);
|
||||
void finishedWithError(QNetworkReply *reply = 0);
|
||||
void finishedWithError(QNetworkReply *reply = nullptr);
|
||||
|
||||
private slots:
|
||||
bool finished() override;
|
||||
@ -181,7 +181,7 @@ public:
|
||||
* @param userId The user for which to obtain the avatar
|
||||
* @param size The size of the avatar (square so size*size)
|
||||
*/
|
||||
explicit AvatarJob(AccountPtr account, const QString &userId, int size, QObject *parent = 0);
|
||||
explicit AvatarJob(AccountPtr account, const QString &userId, int size, QObject *parent = nullptr);
|
||||
|
||||
void start() override;
|
||||
|
||||
@ -216,7 +216,7 @@ class OWNCLOUDSYNC_EXPORT ProppatchJob : public AbstractNetworkJob
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ProppatchJob(AccountPtr account, const QString &path, QObject *parent = 0);
|
||||
explicit ProppatchJob(AccountPtr account, const QString &path, QObject *parent = nullptr);
|
||||
void start() override;
|
||||
|
||||
/**
|
||||
@ -252,9 +252,9 @@ class OWNCLOUDSYNC_EXPORT MkColJob : public AbstractNetworkJob
|
||||
QMap<QByteArray, QByteArray> _extraHeaders;
|
||||
|
||||
public:
|
||||
explicit MkColJob(AccountPtr account, const QString &path, QObject *parent = 0);
|
||||
explicit MkColJob(AccountPtr account, const QString &path, QObject *parent = nullptr);
|
||||
explicit MkColJob(AccountPtr account, const QUrl &url,
|
||||
const QMap<QByteArray, QByteArray> &extraHeaders, QObject *parent = 0);
|
||||
const QMap<QByteArray, QByteArray> &extraHeaders, QObject *parent = nullptr);
|
||||
void start() override;
|
||||
|
||||
signals:
|
||||
@ -272,7 +272,7 @@ class OWNCLOUDSYNC_EXPORT CheckServerJob : public AbstractNetworkJob
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CheckServerJob(AccountPtr account, QObject *parent = 0);
|
||||
explicit CheckServerJob(AccountPtr account, QObject *parent = nullptr);
|
||||
void start() override;
|
||||
|
||||
static QString version(const QJsonObject &info);
|
||||
@ -329,7 +329,7 @@ class OWNCLOUDSYNC_EXPORT RequestEtagJob : public AbstractNetworkJob
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit RequestEtagJob(AccountPtr account, const QString &path, QObject *parent = 0);
|
||||
explicit RequestEtagJob(AccountPtr account, const QString &path, QObject *parent = nullptr);
|
||||
void start() override;
|
||||
|
||||
signals:
|
||||
@ -358,7 +358,7 @@ class OWNCLOUDSYNC_EXPORT JsonApiJob : public AbstractNetworkJob
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit JsonApiJob(const AccountPtr &account, const QString &path, QObject *parent = 0);
|
||||
explicit JsonApiJob(const AccountPtr &account, const QString &path, QObject *parent = nullptr);
|
||||
|
||||
/**
|
||||
* @brief addQueryParams - add more parameters to the ocs call
|
||||
@ -415,7 +415,7 @@ public:
|
||||
WebViewFlow
|
||||
};
|
||||
|
||||
explicit DetermineAuthTypeJob(AccountPtr account, QObject *parent = 0);
|
||||
explicit DetermineAuthTypeJob(AccountPtr account, QObject *parent = nullptr);
|
||||
void start();
|
||||
signals:
|
||||
void authType(AuthType);
|
||||
@ -440,11 +440,11 @@ class OWNCLOUDSYNC_EXPORT SimpleNetworkJob : public AbstractNetworkJob
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SimpleNetworkJob(AccountPtr account, QObject *parent = 0);
|
||||
explicit SimpleNetworkJob(AccountPtr account, QObject *parent = nullptr);
|
||||
|
||||
QNetworkReply *startRequest(const QByteArray &verb, const QUrl &url,
|
||||
QNetworkRequest req = QNetworkRequest(),
|
||||
QIODevice *requestBody = 0);
|
||||
QIODevice *requestBody = nullptr);
|
||||
|
||||
signals:
|
||||
void finishedSignal(QNetworkReply *reply);
|
||||
|
@ -334,7 +334,7 @@ PropagateItemJob *OwncloudPropagator::createJob(const SyncFileItemPtr &item)
|
||||
job->setDeleteExistingFolder(deleteExisting);
|
||||
return job;
|
||||
} else {
|
||||
PropagateUploadFileCommon *job = 0;
|
||||
PropagateUploadFileCommon *job = nullptr;
|
||||
if (item->_size > syncOptions()._initialChunkSize && account()->capabilities().chunkingNg()) {
|
||||
// Item is above _initialChunkSize, thus will be classified as to be chunked
|
||||
job = new PropagateUploadFileNG(this, item);
|
||||
@ -354,9 +354,9 @@ PropagateItemJob *OwncloudPropagator::createJob(const SyncFileItemPtr &item)
|
||||
case CSYNC_INSTRUCTION_ERROR:
|
||||
return new PropagateIgnoreJob(this, item);
|
||||
default:
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
quint64 OwncloudPropagator::smallFileSize()
|
||||
|
@ -565,7 +565,7 @@ class CleanupPollsJob : public QObject
|
||||
|
||||
public:
|
||||
explicit CleanupPollsJob(const QVector<SyncJournalDb::PollInfo> &pollInfos, AccountPtr account,
|
||||
SyncJournalDb *journal, const QString &localPath, QObject *parent = 0)
|
||||
SyncJournalDb *journal, const QString &localPath, QObject *parent = nullptr)
|
||||
: QObject(parent)
|
||||
, _pollInfos(pollInfos)
|
||||
, _account(account)
|
||||
|
@ -60,7 +60,7 @@ inline QByteArray getEtagFromReply(QNetworkReply *reply)
|
||||
*/
|
||||
inline SyncFileItem::Status classifyError(QNetworkReply::NetworkError nerror,
|
||||
int httpCode,
|
||||
bool *anotherSyncNeeded = NULL)
|
||||
bool *anotherSyncNeeded = nullptr)
|
||||
{
|
||||
Q_ASSERT(nerror != QNetworkReply::NoError); // we should only be called when there is an error
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
namespace OCC {
|
||||
|
||||
ProgressDispatcher *ProgressDispatcher::_instance = 0;
|
||||
ProgressDispatcher *ProgressDispatcher::_instance = nullptr;
|
||||
|
||||
QString Progress::asResultString(const SyncFileItem &item)
|
||||
{
|
||||
|
@ -305,7 +305,7 @@ protected:
|
||||
void setProgressInfo(const QString &folder, const ProgressInfo &progress);
|
||||
|
||||
private:
|
||||
ProgressDispatcher(QObject *parent = 0);
|
||||
ProgressDispatcher(QObject *parent = nullptr);
|
||||
|
||||
QElapsedTimer _timer;
|
||||
static ProgressDispatcher *_instance;
|
||||
|
@ -80,7 +80,7 @@ GETFileJob::GETFileJob(AccountPtr account, const QString &path, QFile *device,
|
||||
, _bandwidthLimited(false)
|
||||
, _bandwidthChoked(false)
|
||||
, _bandwidthQuota(0)
|
||||
, _bandwidthManager(0)
|
||||
, _bandwidthManager(nullptr)
|
||||
, _hasEmittedFinishedSignal(false)
|
||||
, _lastModified()
|
||||
{
|
||||
@ -100,7 +100,7 @@ GETFileJob::GETFileJob(AccountPtr account, const QUrl &url, QFile *device,
|
||||
, _bandwidthLimited(false)
|
||||
, _bandwidthChoked(false)
|
||||
, _bandwidthQuota(0)
|
||||
, _bandwidthManager(0)
|
||||
, _bandwidthManager(nullptr)
|
||||
, _hasEmittedFinishedSignal(false)
|
||||
, _lastModified()
|
||||
{
|
||||
|
@ -52,11 +52,11 @@ public:
|
||||
// DOES NOT take ownership of the device.
|
||||
explicit GETFileJob(AccountPtr account, const QString &path, QFile *device,
|
||||
const QMap<QByteArray, QByteArray> &headers, const QByteArray &expectedEtagForResume,
|
||||
quint64 resumeStart, QObject *parent = 0);
|
||||
quint64 resumeStart, QObject *parent = nullptr);
|
||||
// For directDownloadUrl:
|
||||
explicit GETFileJob(AccountPtr account, const QUrl &url, QFile *device,
|
||||
const QMap<QByteArray, QByteArray> &headers, const QByteArray &expectedEtagForResume,
|
||||
quint64 resumeStart, QObject *parent = 0);
|
||||
quint64 resumeStart, QObject *parent = nullptr);
|
||||
virtual ~GETFileJob()
|
||||
{
|
||||
if (_bandwidthManager) {
|
||||
|
@ -27,8 +27,8 @@ class DeleteJob : public AbstractNetworkJob
|
||||
Q_OBJECT
|
||||
QUrl _url; // Only used if the constructor taking a url is taken.
|
||||
public:
|
||||
explicit DeleteJob(AccountPtr account, const QString &path, QObject *parent = 0);
|
||||
explicit DeleteJob(AccountPtr account, const QUrl &url, QObject *parent = 0);
|
||||
explicit DeleteJob(AccountPtr account, const QString &path, QObject *parent = nullptr);
|
||||
explicit DeleteJob(AccountPtr account, const QUrl &url, QObject *parent = nullptr);
|
||||
|
||||
void start() override;
|
||||
bool finished() override;
|
||||
|
@ -30,9 +30,9 @@ class MoveJob : public AbstractNetworkJob
|
||||
QMap<QByteArray, QByteArray> _extraHeaders;
|
||||
|
||||
public:
|
||||
explicit MoveJob(AccountPtr account, const QString &path, const QString &destination, QObject *parent = 0);
|
||||
explicit MoveJob(AccountPtr account, const QString &path, const QString &destination, QObject *parent = nullptr);
|
||||
explicit MoveJob(AccountPtr account, const QUrl &url, const QString &destination,
|
||||
QMap<QByteArray, QByteArray> _extraHeaders, QObject *parent = 0);
|
||||
QMap<QByteArray, QByteArray> _extraHeaders, QObject *parent = nullptr);
|
||||
|
||||
void start() override;
|
||||
bool finished() override;
|
||||
|
@ -69,7 +69,7 @@ static bool fileIsStillChanging(const SyncFileItem &item)
|
||||
PUTFileJob::~PUTFileJob()
|
||||
{
|
||||
// Make sure that we destroy the QNetworkReply before our _device of which it keeps an internal pointer.
|
||||
setReply(0);
|
||||
setReply(nullptr);
|
||||
}
|
||||
|
||||
void PUTFileJob::start()
|
||||
|
@ -93,7 +93,7 @@ private:
|
||||
public:
|
||||
// Takes ownership of the device
|
||||
explicit PUTFileJob(AccountPtr account, const QString &path, QIODevice *device,
|
||||
const QMap<QByteArray, QByteArray> &headers, int chunk, QObject *parent = 0)
|
||||
const QMap<QByteArray, QByteArray> &headers, int chunk, QObject *parent = nullptr)
|
||||
: AbstractNetworkJob(account, path, parent)
|
||||
, _device(device)
|
||||
, _headers(headers)
|
||||
@ -102,7 +102,7 @@ public:
|
||||
_device->setParent(this);
|
||||
}
|
||||
explicit PUTFileJob(AccountPtr account, const QUrl &url, QIODevice *device,
|
||||
const QMap<QByteArray, QByteArray> &headers, int chunk, QObject *parent = 0)
|
||||
const QMap<QByteArray, QByteArray> &headers, int chunk, QObject *parent = nullptr)
|
||||
: AbstractNetworkJob(account, QString(), parent)
|
||||
, _device(device)
|
||||
, _headers(headers)
|
||||
@ -232,7 +232,7 @@ public:
|
||||
: PropagateItemJob(propagator, item)
|
||||
, _finished(false)
|
||||
, _deleteExisting(false)
|
||||
, _uploadEncryptedHelper(0)
|
||||
, _uploadEncryptedHelper(nullptr)
|
||||
, _uploadingEncrypted(false)
|
||||
{
|
||||
}
|
||||
|
@ -37,7 +37,7 @@
|
||||
|
||||
namespace OCC {
|
||||
|
||||
Theme *Theme::_instance = 0;
|
||||
Theme *Theme::_instance = nullptr;
|
||||
|
||||
Theme *Theme::instance()
|
||||
{
|
||||
@ -201,7 +201,7 @@ QString Theme::hidpiFileName(const QString &fileName, QPaintDevice *dev)
|
||||
#endif
|
||||
|
||||
Theme::Theme()
|
||||
: QObject(0)
|
||||
: QObject(nullptr)
|
||||
, _mono(false)
|
||||
{
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ public:
|
||||
virtual QString configFileName() const;
|
||||
|
||||
#ifndef TOKEN_AUTH_ONLY
|
||||
static QString hidpiFileName(const QString &fileName, QPaintDevice *dev = 0);
|
||||
static QString hidpiFileName(const QString &fileName, QPaintDevice *dev = nullptr);
|
||||
|
||||
/**
|
||||
* get an sync state icon
|
||||
|
Loading…
Reference in New Issue
Block a user