[CSE] Build fix

- change the name of one Qt Message Handler
- changed parameter from int to QString
This commit is contained in:
Tomaz Canabrava 2017-10-18 20:29:13 +02:00 committed by Roeland Jago Douma
parent d83e8819ce
commit e0988f482c
No known key found for this signature in database
GPG key ID: F941078878347C0C
3 changed files with 9 additions and 10 deletions

View file

@ -281,10 +281,9 @@ void AccountSettings::slotCustomContextMenuRequested(const QPoint &pos)
ac = menu->addAction(tr("Encrypt"));
connect(ac, &QAction::triggered, [this, &fileId](bool triggered) {
Q_UNUSED(triggered);
auto job = new OCC::JsonApiJob(accountsState()->account(),
"ocs/v2.php/apps/end_to_end_encryption/api/v1/encrypted/" + QString(fileId));
auto job = new OCC::SetEncryptionFlagApiJob(accountsState()->account(), QString(fileId));
connect(job, &OCC::JsonApiJob::jsonReceived, [this](const QJsonDocument& json, int httpResponse) {
connect(job, &OCC::SetEncryptionFlagApiJob::jsonReceived, [this](const QJsonDocument& json, int httpResponse) {
Q_UNUSED(json);
qCInfo(lcAccountSettings) << "Encrypt Http Response" << httpResponse;
});

View file

@ -51,7 +51,7 @@ Q_LOGGING_CATEGORY(lcJsonApiJob, "sync.networkjob.jsonapi", QtInfoMsg)
Q_LOGGING_CATEGORY(lcDetermineAuthTypeJob, "sync.networkjob.determineauthtype", QtInfoMsg)
Q_LOGGING_CATEGORY(lcSignPublicKeyApiJob, "sync.networkjob.sendcsr", QtInfoMsg);
Q_LOGGING_CATEGORY(lcStorePrivateKeyApiJob, "sync.networkjob.storeprivatekey", QtInfoMsg);
Q_LOGGING_CATEGORY(lcCse, "sync.networkjob.clientsideencrypt", QtInfoMsg);
Q_LOGGING_CATEGORY(lcCseJob, "sync.networkjob.clientsideencrypt", QtInfoMsg);
RequestEtagJob::RequestEtagJob(AccountPtr account, const QString &path, QObject *parent)
: AbstractNetworkJob(account, path, parent)
@ -1020,8 +1020,8 @@ bool StorePrivateKeyApiJob::finished()
emit jsonReceived(json, reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt());
}
SetEncryptionFlagApiJob::SetEncryptionFlagApiJob(const AccountPtr& account, int fileId, QObject* parent)
: AbstractNetworkJob(account, baseUrl() + "/encrypt/", parent), _fileId(fileId)
SetEncryptionFlagApiJob::SetEncryptionFlagApiJob(const AccountPtr& account, const QString& fileId, QObject* parent)
: AbstractNetworkJob(account, baseUrl() + QStringLiteral("encrypted/") + fileId, parent), _fileId(fileId)
{
}
@ -1035,7 +1035,7 @@ void SetEncryptionFlagApiJob::start()
};
url.setQueryItems(params);
qCInfo(lcCse()) << "marking the file with id" << _fileId << "as encrypted";
qCInfo(lcCseJob()) << "marking the file with id" << _fileId << "as encrypted";
sendRequest("PUT", url, req);
AbstractNetworkJob::start();
}
@ -1044,7 +1044,7 @@ bool SetEncryptionFlagApiJob::finished()
{
int retCode = reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
if (retCode != 200)
qCInfo(lcCse()) << "Setting the encrypted flag failed with" << path() << errorString() << retCode;
qCInfo(lcCseJob()) << "Setting the encrypted flag failed with" << path() << errorString() << retCode;
QJsonParseError error;
auto json = QJsonDocument::fromJson(reply()->readAll(), &error);

View file

@ -532,7 +532,7 @@ class OWNCLOUDSYNC_EXPORT SetEncryptionFlagApiJob : public AbstractNetworkJob
{
Q_OBJECT
public:
explicit SetEncryptionFlagApiJob(const AccountPtr &account, int fileId, QObject *parent = 0);
explicit SetEncryptionFlagApiJob(const AccountPtr &account, const QString& fileId, QObject *parent = 0);
public slots:
void start() override;
@ -549,7 +549,7 @@ signals:
*/
void jsonReceived(const QJsonDocument &json, int statusCode);
private:
int _fileId;
QString _fileId;
};
} // namespace OCC