[CSE] Renane GetFolderEncryptStatus to GetFolderEncryptStatusJob

it's a network job after all
This commit is contained in:
Tomaz Canabrava 2017-12-07 18:06:55 +01:00
parent 863e86138f
commit 7fe4dd2163
3 changed files with 11 additions and 11 deletions

View file

@ -984,10 +984,10 @@ void ClientSideEncryption::getPublicKeyFromServer()
void ClientSideEncryption::fetchFolderEncryptedStatus() { void ClientSideEncryption::fetchFolderEncryptedStatus() {
_refreshingEncryptionStatus = true; _refreshingEncryptionStatus = true;
auto getEncryptedStatus = new GetFolderEncryptStatus(_account, QString()); auto getEncryptedStatus = new GetFolderEncryptStatusJob(_account, QString());
connect(getEncryptedStatus, &GetFolderEncryptStatus::encryptStatusReceived, connect(getEncryptedStatus, &GetFolderEncryptStatusJob::encryptStatusReceived,
this, &ClientSideEncryption::folderEncryptedStatusFetched); this, &ClientSideEncryption::folderEncryptedStatusFetched);
connect(getEncryptedStatus, &GetFolderEncryptStatus::encryptStatusError, connect(getEncryptedStatus, &GetFolderEncryptStatusJob::encryptStatusError,
this, &ClientSideEncryption::folderEncryptedStatusError); this, &ClientSideEncryption::folderEncryptedStatusError);
getEncryptedStatus->start(); getEncryptedStatus->start();
} }
@ -1483,12 +1483,12 @@ bool GetMetadataApiJob::finished()
return true; return true;
} }
GetFolderEncryptStatus::GetFolderEncryptStatus(const AccountPtr& account, const QString& folder, QObject *parent) GetFolderEncryptStatusJob::GetFolderEncryptStatusJob(const AccountPtr& account, const QString& folder, QObject *parent)
: OCC::AbstractNetworkJob(account, QStringLiteral("remote.php/webdav"), parent), _folder(folder) : OCC::AbstractNetworkJob(account, QStringLiteral("remote.php/webdav"), parent), _folder(folder)
{ {
} }
void GetFolderEncryptStatus::start() void GetFolderEncryptStatusJob::start()
{ {
QNetworkRequest req; QNetworkRequest req;
req.setPriority(QNetworkRequest::HighPriority); req.setPriority(QNetworkRequest::HighPriority);
@ -1505,7 +1505,7 @@ void GetFolderEncryptStatus::start()
AbstractNetworkJob::start(); AbstractNetworkJob::start();
} }
bool GetFolderEncryptStatus::finished() bool GetFolderEncryptStatusJob::finished()
{ {
qCInfo(lcCse()) << "GetFolderEncryptStatus of" << reply()->request().url() << "finished with status" qCInfo(lcCse()) << "GetFolderEncryptStatus of" << reply()->request().url() << "finished with status"
<< reply()->error() << reply()->error()

View file

@ -337,11 +337,11 @@ private:
/* I cant use the propfind network job because it defaults to the /* I cant use the propfind network job because it defaults to the
* wrong dav url. * wrong dav url.
*/ */
class OWNCLOUDSYNC_EXPORT GetFolderEncryptStatus : public AbstractNetworkJob class OWNCLOUDSYNC_EXPORT GetFolderEncryptStatusJob : public AbstractNetworkJob
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit GetFolderEncryptStatus (const AccountPtr &account, const QString& folder, QObject *parent = 0); explicit GetFolderEncryptStatusJob (const AccountPtr &account, const QString& folder, QObject *parent = 0);
public slots: public slots:
void start() override; void start() override;

View file

@ -194,12 +194,12 @@ void PropagateUploadFileCommon::start()
*/ */
QFileInfo info(_item->_file); QFileInfo info(_item->_file);
auto getEncryptedStatus = new GetFolderEncryptStatus(propagator()->account(), auto getEncryptedStatus = new GetFolderEncryptStatusJob(propagator()->account(),
info.path()); info.path());
connect(getEncryptedStatus, &GetFolderEncryptStatus::encryptStatusReceived, connect(getEncryptedStatus, &GetFolderEncryptStatusJob::encryptStatusReceived,
this, &PropagateUploadFileCommon::slotFolderEncryptedStatusFetched); this, &PropagateUploadFileCommon::slotFolderEncryptedStatusFetched);
connect(getEncryptedStatus, &GetFolderEncryptStatus::encryptStatusError, connect(getEncryptedStatus, &GetFolderEncryptStatusJob::encryptStatusError,
this, &PropagateUploadFileCommon::slotFolderEncryptedStatusError); this, &PropagateUploadFileCommon::slotFolderEncryptedStatusError);
getEncryptedStatus->start(); getEncryptedStatus->start();
} else { } else {