[CSE] Request the Folder ID.

This commit is contained in:
Tomaz Canabrava 2017-12-07 19:39:30 +01:00
parent 4878e824e5
commit 76916b6c48
2 changed files with 20 additions and 1 deletions

View file

@ -229,8 +229,15 @@ void PropagateUploadFileCommon::slotFolderEncryptedStatusFetched(const QMap<QStr
qDebug() << "###################################";
qDebug() << "Retrieved correctly the encrypted status of the folders." << result;
/* We are inside an encrypted folder, we need to find it's Id. */
if (result[currFilePath] == true) {
qDebug() << "Uploading to an encrypted folder. do the thing.";
QFileInfo info(_item->_file);
LsColJob *job = new LsColJob(propagator()->account(), info.path(), this);
job->setProperties({"resourcetype", "http://owncloud.org/ns:fileid"});
connect(job, &LsColJob::directoryListingSubfolders, this, &PropagateUploadFileCommon::slotFolderEncryptedIdReceived);
connect(job, &LsColJob::finishedWithError, this, &PropagateUploadFileCommon::slotFolderEncryptedIdError);
job->start();
} else {
_fileToUpload._file = _item->_file;
_fileToUpload._size = _item->_size;
@ -240,6 +247,16 @@ void PropagateUploadFileCommon::slotFolderEncryptedStatusFetched(const QMap<QStr
}
}
void PropagateUploadFileCommon::slotFolderEncryptedIdReceived(const QStringList &list)
{
qDebug() << "Successfully retrieved the id of the encrypted folder" << list;
}
void PropagateUploadFileCommon::slotFolderEncryptedIdError(QNetworkReply *r)
{
qDebug() << "Error retrieving the Id of the encrypted folder.";
}
void PropagateUploadFileCommon::slotFolderEncryptedStatusError(int error)
{
qDebug() << "Failed to retrieve the status of the folders." << error;

View file

@ -281,6 +281,8 @@ private slots:
// Encryption Stuff
void slotFolderEncryptedStatusFetched(const QMap<QString, bool>& result);
void slotFolderEncryptedStatusError(int error);
void slotFolderEncryptedIdReceived(const QStringList &list);
void slotFolderEncryptedIdError(QNetworkReply *r);
protected:
/**