Qt5: toAscii() and fromAscii() Methods are deprecated

This commit is contained in:
Mark Morschhäuser 2014-06-20 16:55:26 +02:00
parent a903c231f2
commit 6fa94dd475
3 changed files with 3 additions and 3 deletions

View file

@ -553,7 +553,7 @@ int Json::nextToken(const QString &json, int &index)
QChar c = json[index];
index++;
switch(c.toAscii())
switch(c.toLatin1())
{
case '{': return JsonTokenCurlyOpen;
case '}': return JsonTokenCurlyClose;

View file

@ -16,7 +16,7 @@ QString PasswordHasher::computeHash(const QString &password, const QString &salt
const int algo = GCRY_MD_SHA512;
const int rounds = 1000;
QByteArray passwordBuffer = (salt + password).toAscii();
QByteArray passwordBuffer = (salt + password).toLatin1();
int hashLen = gcry_md_get_algo_dlen(algo);
char hash[hashLen], tmp[hashLen];
gcry_md_hash_buffer(algo, hash, passwordBuffer.data(), passwordBuffer.size());

View file

@ -319,7 +319,7 @@ void Servatrice::updateServerList()
query.prepare("select id, ssl_cert, hostname, address, game_port, control_port from " + dbPrefix + "_servers order by id asc");
servatriceDatabaseInterface->execSqlQuery(query);
while (query.next()) {
ServerProperties prop(query.value(0).toInt(), QSslCertificate(query.value(1).toString().toAscii()), query.value(2).toString(), QHostAddress(query.value(3).toString()), query.value(4).toInt(), query.value(5).toInt());
ServerProperties prop(query.value(0).toInt(), QSslCertificate(query.value(1).toString().toLatin1()), query.value(2).toString(), QHostAddress(query.value(3).toString()), query.value(4).toInt(), query.value(5).toInt());
serverList.append(prop);
qDebug() << QString("#%1 CERT=%2 NAME=%3 IP=%4:%5 CPORT=%6").arg(prop.id).arg(QString(prop.cert.digest().toHex())).arg(prop.hostname).arg(prop.address.toString()).arg(prop.gamePort).arg(prop.controlPort);
}