mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-22 13:05:51 +03:00
Move destination header build to own method
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
a29af562de
commit
2b9b182204
2 changed files with 10 additions and 5 deletions
|
@ -410,6 +410,7 @@ private:
|
|||
|
||||
[[nodiscard]] QUrl chunkUploadFolderUrl() const;
|
||||
[[nodiscard]] QUrl chunkUrl(const int chunk) const;
|
||||
[[nodiscard]] QByteArray destinationHeader() const;
|
||||
|
||||
void startNewUpload();
|
||||
void startNextChunk();
|
||||
|
|
|
@ -85,6 +85,14 @@ QUrl PropagateUploadFileNG::chunkUrl(const int chunk) const
|
|||
|
||||
*/
|
||||
|
||||
QByteArray PropagateUploadFileNG::destinationHeader() const
|
||||
{
|
||||
const auto davUrl = Utility::trailingSlashPath(propagator()->account()->davUrl().toString());
|
||||
const auto remotePath = Utility::noLeadingSlashPath(propagator()->fullRemotePath(_fileToUpload._file));
|
||||
const auto destination = QString(davUrl + remotePath);
|
||||
return destination.toUtf8();
|
||||
}
|
||||
|
||||
void PropagateUploadFileNG::doStartUpload()
|
||||
{
|
||||
propagator()->_activeJobList.append(this);
|
||||
|
@ -362,11 +370,7 @@ void PropagateUploadFileNG::startNextChunk()
|
|||
|
||||
QMap<QByteArray, QByteArray> headers;
|
||||
headers["OC-Chunk-Offset"] = QByteArray::number(_sent);
|
||||
|
||||
const auto davUrl = Utility::trailingSlashPath(propagator()->account()->davUrl().toString());
|
||||
const auto remotePath = Utility::noLeadingSlashPath(propagator()->fullRemotePath(_fileToUpload._file));
|
||||
const auto destination = QString(davUrl + remotePath);
|
||||
headers["Destination"] = destination.toUtf8();
|
||||
headers["Destination"] = destinationHeader();
|
||||
|
||||
_sent += _currentChunkSize;
|
||||
const auto url = chunkUrl(_currentChunk);
|
||||
|
|
Loading…
Reference in a new issue