Use QString::toLatin instead of deprecated toAscii

This commit is contained in:
Àlex Fiestas 2014-09-23 19:45:29 +02:00
parent 74382f09d2
commit 9a9333035a
2 changed files with 5 additions and 5 deletions

View file

@ -100,9 +100,9 @@ Daemon::Daemon(QObject *parent)
//http://delta.affinix.com/docs/qca/rsatest_8cpp-example.html
if (config->group("myself").hasKey("privateKey")) {
//Migration from older versions of KDE Connect
privKey.write(config->group("myself").readEntry<QString>("privateKey",QCA::KeyGenerator().createRSA(2048).toPEM()).toAscii());
privKey.write(config->group("myself").readEntry<QString>("privateKey",QCA::KeyGenerator().createRSA(2048).toPEM()).toLatin1());
} else {
privKey.write(QCA::KeyGenerator().createRSA(2048).toPEM().toAscii());
privKey.write(QCA::KeyGenerator().createRSA(2048).toPEM().toLatin1());
}
privKey.close();

View file

@ -186,7 +186,7 @@ bool NetworkPackage::decrypt(QCA::PrivateKey& key, NetworkPackage* out) const
QByteArray decryptedJson;
Q_FOREACH(const QString& chunk, chunks) {
const QByteArray encryptedChunk = QByteArray::fromBase64(chunk.toAscii());
const QByteArray encryptedChunk = QByteArray::fromBase64(chunk.toLatin1());
QCA::SecureArray decryptedChunk;
bool success = key.decrypt(encryptedChunk, &decryptedChunk, NetworkPackage::EncryptionAlgorithm);
if (!success) {