mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-27 09:30:13 +03:00
Chunking-NG: Enable if the server supports it
This commit is contained in:
parent
273590fdfc
commit
e33b89c222
3 changed files with 10 additions and 2 deletions
|
@ -107,4 +107,10 @@ QByteArray Capabilities::uploadChecksumType() const
|
||||||
return QByteArray();
|
return QByteArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Capabilities::chunkingNg() const
|
||||||
|
{
|
||||||
|
return _capabilities["dav"].toMap()["chunking"].toByteArray() >= "1.0";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,6 +39,7 @@ public:
|
||||||
bool sharePublicLinkEnforceExpireDate() const;
|
bool sharePublicLinkEnforceExpireDate() const;
|
||||||
int sharePublicLinkExpireDateDays() const;
|
int sharePublicLinkExpireDateDays() const;
|
||||||
bool shareResharing() const;
|
bool shareResharing() const;
|
||||||
|
bool chunkingNg() const;
|
||||||
|
|
||||||
/// returns true if the capabilities report notifications
|
/// returns true if the capabilities report notifications
|
||||||
bool notificationsAvailable() const;
|
bool notificationsAvailable() const;
|
||||||
|
|
|
@ -270,9 +270,10 @@ PropagateItemJob* OwncloudPropagator::createJob(const SyncFileItemPtr &item) {
|
||||||
job->setDeleteExistingFolder(deleteExisting);
|
job->setDeleteExistingFolder(deleteExisting);
|
||||||
return job;
|
return job;
|
||||||
} else {
|
} else {
|
||||||
static const bool isNg = !qgetenv("OWNCLOUD_CHUNK_NG").isEmpty(); // FIXME! use server version
|
|
||||||
PropagateUploadFileCommon *job = 0;
|
PropagateUploadFileCommon *job = 0;
|
||||||
if (isNg && item->_size > chunkSize()) {
|
static const auto chunkng = qgetenv("OWNCLOUD_CHUNKING_NG");
|
||||||
|
if (item->_size > chunkSize()
|
||||||
|
&& (account()->capabilities().chunkingNg() || chunkng == "1") && chunkng != "0") {
|
||||||
job = new PropagateUploadFileNG(this, item);
|
job = new PropagateUploadFileNG(this, item);
|
||||||
} else {
|
} else {
|
||||||
job = new PropagateUploadFileV1(this, item);
|
job = new PropagateUploadFileV1(this, item);
|
||||||
|
|
Loading…
Reference in a new issue