Use QString::toLatin1() rather than ::toAscii()

The toAscii (and fromAscii) are removed from Qt5 in favor of Latin1.
This commit is contained in:
Ben Boeckel 2013-11-24 21:19:20 +01:00 committed by Felix Geyer
parent 03e4b2d13c
commit 66b3d22041
7 changed files with 16 additions and 16 deletions

View file

@ -122,7 +122,7 @@ void FileKey::create(QIODevice* device)
xmlWriter.writeStartElement("Key");
QByteArray data = randomGen()->randomArray(32);
xmlWriter.writeTextElement("Data", QString::fromAscii(data.toBase64()));
xmlWriter.writeTextElement("Data", QString::fromLatin1(data.toBase64()));
xmlWriter.writeEndElement();
@ -211,7 +211,7 @@ QByteArray FileKey::loadXmlKey(QXmlStreamReader& xmlReader)
while (!xmlReader.error() && xmlReader.readNextStartElement()) {
if (xmlReader.name() == "Data") {
// TODO: do we need to enforce a specific data.size()?
data = QByteArray::fromBase64(xmlReader.readElementText().toAscii());
data = QByteArray::fromBase64(xmlReader.readElementText().toLatin1());
}
}