mirror of
https://github.com/chylex/Nextcloud-Desktop.git
synced 2025-05-23 02:34:08 +02:00
propage*encrypted Q_UNUSED
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
e871359453
commit
ce545b1e47
@ -106,10 +106,10 @@ bool PropagateDownloadEncrypted::decryptFile(QFile& tmpFile)
|
|||||||
|
|
||||||
tmpFile.close();
|
tmpFile.close();
|
||||||
QFile _tmpOutput(_propagator->getFilePath(tmpFileName), this);
|
QFile _tmpOutput(_propagator->getFilePath(tmpFileName), this);
|
||||||
bool fileDecrypted = EncryptionHelper::fileDecryption(_encryptedInfo.encryptionKey,
|
EncryptionHelper::fileDecryption(_encryptedInfo.encryptionKey,
|
||||||
_encryptedInfo.initializationVector,
|
_encryptedInfo.initializationVector,
|
||||||
&tmpFile,
|
&tmpFile,
|
||||||
&_tmpOutput);
|
&_tmpOutput);
|
||||||
|
|
||||||
qCDebug(lcPropagateDownloadEncrypted) << "Decryption finished" << tmpFile.fileName() << _tmpOutput.fileName();
|
qCDebug(lcPropagateDownloadEncrypted) << "Decryption finished" << tmpFile.fileName() << _tmpOutput.fileName();
|
||||||
|
|
||||||
|
@ -114,8 +114,10 @@ void PropagateUploadEncrypted::slotFolderLockedSuccessfully(const QByteArray& fi
|
|||||||
|
|
||||||
void PropagateUploadEncrypted::slotFolderEncryptedMetadataError(const QByteArray& fileId, int httpReturnCode)
|
void PropagateUploadEncrypted::slotFolderEncryptedMetadataError(const QByteArray& fileId, int httpReturnCode)
|
||||||
{
|
{
|
||||||
qCDebug(lcPropagateUploadEncrypted()) << "Error Getting the encrypted metadata. unlock the folder.";
|
Q_UNUSED(fileId);
|
||||||
unlockFolder();
|
Q_UNUSED(httpReturnCode);
|
||||||
|
qCDebug(lcPropagateUploadEncrypted()) << "Error Getting the encrypted metadata. unlock the folder.";
|
||||||
|
unlockFolder();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PropagateUploadEncrypted::slotFolderEncryptedMetadataReceived(const QJsonDocument &json, int statusCode)
|
void PropagateUploadEncrypted::slotFolderEncryptedMetadataReceived(const QJsonDocument &json, int statusCode)
|
||||||
@ -207,14 +209,15 @@ void PropagateUploadEncrypted::slotFolderEncryptedMetadataReceived(const QJsonDo
|
|||||||
|
|
||||||
void PropagateUploadEncrypted::slotUpdateMetadataSuccess(const QByteArray& fileId)
|
void PropagateUploadEncrypted::slotUpdateMetadataSuccess(const QByteArray& fileId)
|
||||||
{
|
{
|
||||||
qCDebug(lcPropagateUploadEncrypted) << "Uploading of the metadata success, Encrypting the file";
|
Q_UNUSED(fileId);
|
||||||
QFileInfo outputInfo(_completeFileName);
|
qCDebug(lcPropagateUploadEncrypted) << "Uploading of the metadata success, Encrypting the file";
|
||||||
|
QFileInfo outputInfo(_completeFileName);
|
||||||
|
|
||||||
qCDebug(lcPropagateUploadEncrypted) << "Encrypted Info:" << outputInfo.path() << outputInfo.fileName() << outputInfo.size();
|
qCDebug(lcPropagateUploadEncrypted) << "Encrypted Info:" << outputInfo.path() << outputInfo.fileName() << outputInfo.size();
|
||||||
qCDebug(lcPropagateUploadEncrypted) << "Finalizing the upload part, now the actuall uploader will take over";
|
qCDebug(lcPropagateUploadEncrypted) << "Finalizing the upload part, now the actuall uploader will take over";
|
||||||
emit finalized(outputInfo.path() + QLatin1Char('/') + outputInfo.fileName(),
|
emit finalized(outputInfo.path() + QLatin1Char('/') + outputInfo.fileName(),
|
||||||
_item->_file.section(QLatin1Char('/'), 0, -2) + QLatin1Char('/') + outputInfo.fileName(),
|
_item->_file.section(QLatin1Char('/'), 0, -2) + QLatin1Char('/') + outputInfo.fileName(),
|
||||||
outputInfo.size());
|
outputInfo.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
void PropagateUploadEncrypted::slotUpdateMetadataError(const QByteArray& fileId, int httpErrorResponse)
|
void PropagateUploadEncrypted::slotUpdateMetadataError(const QByteArray& fileId, int httpErrorResponse)
|
||||||
@ -226,30 +229,32 @@ void PropagateUploadEncrypted::slotUpdateMetadataError(const QByteArray& fileId,
|
|||||||
|
|
||||||
void PropagateUploadEncrypted::slotFolderLockedError(const QByteArray& fileId, int httpErrorCode)
|
void PropagateUploadEncrypted::slotFolderLockedError(const QByteArray& fileId, int httpErrorCode)
|
||||||
{
|
{
|
||||||
/* try to call the lock from 5 to 5 seconds
|
Q_UNUSED(httpErrorCode);
|
||||||
and fail if it's more than 5 minutes. */
|
/* try to call the lock from 5 to 5 seconds
|
||||||
QTimer::singleShot(5000, this, [this, fileId]{
|
* and fail if it's more than 5 minutes. */
|
||||||
if (!_currentLockingInProgress) {
|
QTimer::singleShot(5000, this, [this, fileId]{
|
||||||
qCDebug(lcPropagateUploadEncrypted) << "Error locking the folder while no other update is locking it up.";
|
if (!_currentLockingInProgress) {
|
||||||
qCDebug(lcPropagateUploadEncrypted) << "Perhaps another client locked it.";
|
qCDebug(lcPropagateUploadEncrypted) << "Error locking the folder while no other update is locking it up.";
|
||||||
qCDebug(lcPropagateUploadEncrypted) << "Abort";
|
qCDebug(lcPropagateUploadEncrypted) << "Perhaps another client locked it.";
|
||||||
return;
|
qCDebug(lcPropagateUploadEncrypted) << "Abort";
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Perhaps I should remove the elapsed timer if the lock is from this client?
|
// Perhaps I should remove the elapsed timer if the lock is from this client?
|
||||||
if (_folderLockFirstTry.elapsed() > /* five minutes */ 1000 * 60 * 5 ) {
|
if (_folderLockFirstTry.elapsed() > /* five minutes */ 1000 * 60 * 5 ) {
|
||||||
qCDebug(lcPropagateUploadEncrypted) << "One minute passed, ignoring more attemps to lock the folder.";
|
qCDebug(lcPropagateUploadEncrypted) << "One minute passed, ignoring more attemps to lock the folder.";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
slotTryLock(fileId);
|
slotTryLock(fileId);
|
||||||
});
|
});
|
||||||
|
|
||||||
qCDebug(lcPropagateUploadEncrypted) << "Folder" << fileId << "Coundn't be locked.";
|
qCDebug(lcPropagateUploadEncrypted) << "Folder" << fileId << "Coundn't be locked.";
|
||||||
}
|
}
|
||||||
|
|
||||||
void PropagateUploadEncrypted::slotFolderEncryptedIdError(QNetworkReply *r)
|
void PropagateUploadEncrypted::slotFolderEncryptedIdError(QNetworkReply *r)
|
||||||
{
|
{
|
||||||
qCDebug(lcPropagateUploadEncrypted) << "Error retrieving the Id of the encrypted folder.";
|
Q_UNUSED(r);
|
||||||
|
qCDebug(lcPropagateUploadEncrypted) << "Error retrieving the Id of the encrypted folder.";
|
||||||
}
|
}
|
||||||
|
|
||||||
void PropagateUploadEncrypted::slotFolderEncryptedStatusError(int error)
|
void PropagateUploadEncrypted::slotFolderEncryptedStatusError(int error)
|
||||||
|
Loading…
Reference in New Issue
Block a user