[CSE] Start to create the upload logic.

This commit is contained in:
Tomaz Canabrava 2017-12-04 21:33:43 +01:00
parent 8c4928d9f6
commit 387737d908
2 changed files with 26 additions and 4 deletions

View file

@ -176,10 +176,30 @@ void PropagateUploadFileCommon::start()
*
* this by no means is a finished job, but a first step.
*/
_fileToUpload._file = _item->_file;
_fileToUpload._size = _item->_size;
_fileToUpload._path = propagator()->getFilePath(_fileToUpload._file);
if (propagator()->account()->capabilities().clientSideEncryptionAvaliable()) {
qDebug() << "Uploading to Remote Folder: " << propagator()->_remoteFolder;
qDebug() << "Uploading from Local Dir" << propagator()->_localDir;
qDebug() << "Local File" << _item->_file;
qDebug() << QDir::cleanPath(propagator()->account()->url().path() + QLatin1Char('/')
+ propagator()->account()->davPath() + propagator()->_remoteFolder + _item->_file);
//TODO: Those shall die.
_fileToUpload._file = _item->_file;
_fileToUpload._size = _item->_size;
_fileToUpload._path = propagator()->getFilePath(_fileToUpload._file);
} else {
_fileToUpload._file = _item->_file;
_fileToUpload._size = _item->_size;
_fileToUpload._path = propagator()->getFilePath(_fileToUpload._file);
startUploadRawFile();
}
}
void PropageteUploadFileCommon::startUploadEncryptedFile()
{
}
void PropagateUploadFileCommon::startUploadRawFile() {
if (propagator()->_abortRequested.fetchAndAddRelaxed(0)) {
return;
}

View file

@ -250,8 +250,10 @@ public:
*/
void setDeleteExisting(bool enabled);
/* start should setup the file, path and size that will be send to the server */
void start() Q_DECL_OVERRIDE;
void startUploadEncryptedFile();
void startUploadRawFile();
bool isLikelyFinishedQuickly() Q_DECL_OVERRIDE { return _item->_size < propagator()->smallFileSize(); }
private slots: