[CSE] Correctly Set's the client as connected

If we manage to encrypt and upload the private key
to the server, the client is in it's connected state.
This commit is contained in:
Tomaz Canabrava 2017-10-18 19:22:59 +02:00 committed by Roeland Jago Douma
parent cfb6e3be8c
commit 0b50afe915
No known key found for this signature in database
GPG key ID: F941078878347C0C

View file

@ -485,8 +485,14 @@ void ClientSideEncryption::encryptPrivateKey(EVP_PKEY *keyPair)
auto job = new StorePrivateKeyApiJob(_account, baseUrl + "private-key", this);
job->setPrivateKey(QByteArray((const char*) cryptedText, 128));
connect(job, &StorePrivateKeyApiJob::jsonReceived, [this](const QJsonDocument& doc, int retCode) {
qCInfo(lcCse()) << doc;
qCInfo(lcCse()) << "Store Private Key returned with" << retCode;
switch(retCode) {
case 200:
qCInfo(lcCse()) << "Store private key working as expected.";
emit initializationFinished();
break;
default:
qCInfo(lcCse()) << "Store private key failed, return code:" << retCode;
}
});
job->start();
}