mirror of
https://github.com/nextcloud/desktop.git
synced 2024-12-21 21:24:40 +03:00
3182c613ac
This means adjusting PropagateDownloadEncrypted so that it knows where the file will end (otherwise it would create temporary files in non existant paths for instance). In turn we have to adjust PropagateDownloadFile accordingly so that it resolves the local folder the file will end up in. And last we adjust PropagateLocalMkdir to resolve paths as well and demangle as needed. Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
48 lines
1.1 KiB
C++
48 lines
1.1 KiB
C++
#ifndef PROPAGATEDOWNLOADENCRYPTED_H
|
|
#define PROPAGATEDOWNLOADENCRYPTED_H
|
|
|
|
#include <QObject>
|
|
#include <QFileInfo>
|
|
|
|
#include "syncfileitem.h"
|
|
#include "owncloudpropagator.h"
|
|
#include "clientsideencryption.h"
|
|
|
|
class QJsonDocument;
|
|
|
|
namespace OCC {
|
|
|
|
class PropagateDownloadEncrypted : public QObject {
|
|
Q_OBJECT
|
|
public:
|
|
PropagateDownloadEncrypted(OwncloudPropagator *propagator, const QString &localParentPath, SyncFileItemPtr item, QObject *parent = nullptr);
|
|
void start();
|
|
void checkFolderId(const QStringList &list);
|
|
bool decryptFile(QFile& tmpFile);
|
|
QString errorString() const;
|
|
|
|
public slots:
|
|
void checkFolderEncryptedStatus();
|
|
|
|
void checkFolderEncryptedMetadata(const QJsonDocument &json);
|
|
void folderStatusReceived(const QString &folder, bool isEncrypted);
|
|
void folderStatusError(int httpErrorCode);
|
|
void folderIdError();
|
|
signals:
|
|
void folderStatusEncrypted();
|
|
void folderStatusNotEncrypted();
|
|
void failed();
|
|
|
|
void decryptionFinished();
|
|
|
|
private:
|
|
OwncloudPropagator *_propagator;
|
|
QString _localParentPath;
|
|
SyncFileItemPtr _item;
|
|
QFileInfo _info;
|
|
EncryptedFile _encryptedInfo;
|
|
QString _errorString;
|
|
};
|
|
|
|
}
|
|
#endif
|