Use non-deprecated types and methods:

WFlags -> WindowFlags (it's a typedef, and it's BC, nm says QFlags<Qt::WindowType>)
toAscii -> toLatin1
fromAscii -> fromLatin1
as suggested by Treeve Jelbert on kde-frameworks-devel
This commit is contained in:
David Faure 2012-12-13 11:57:36 +01:00
parent aaa7ea1580
commit c8734602b8
6 changed files with 12 additions and 12 deletions

View File

@ -74,7 +74,7 @@ static QScriptValue type(QScriptContext *ctx, QScriptEngine *eng)
QMetaObject meta = QEasingCurve::staticMetaObject;
QMetaEnum easingCurveEnum = meta.enumerator(meta.indexOfEnumerator("Type"));
type = easingCurveEnum.keyToValue(arg.toString().toAscii().data());
type = easingCurveEnum.keyToValue(arg.toString().toLatin1().data());
}
if (type > -1 && type < QEasingCurve::Custom) {
self->setType(static_cast<QEasingCurve::Type>(type));

View File

@ -484,7 +484,7 @@ void PackageStructure::read(const KConfigBase *config)
QStringList groups = config->groupList();
foreach (const QString &group, groups) {
KConfigGroup entry(config, group);
QByteArray key = group.toAscii();
QByteArray key = group.toLatin1();
QString path = entry.readEntry("Path", QString());
QString name = entry.readEntry("Name", QString());

View File

@ -111,7 +111,7 @@ void RemoteService::setLocation(const KUrl &location)
"startConnection");
Jolie::Value data;
data.children(JolieMessage::Field::IDENTITY) << Jolie::Value(identityByteArray);
data.children(JolieMessage::Field::UUID) << Jolie::Value(m_uuid.toAscii());
data.children(JolieMessage::Field::UUID) << Jolie::Value(m_uuid.toLatin1());
getOpDesc.setData(data);
Jolie::PendingCall pendingReply = m_client->asyncCall(getOpDesc);
@ -199,7 +199,7 @@ void RemoteService::slotGotPin(Plasma::ClientPinRequest *request)
Jolie::Value value;
value.children(JolieMessage::Field::PARAMETERS) << Jolie::Value(QByteArray());
if (!request->pin().isEmpty()) {
value.children(JolieMessage::Field::PIN) << Jolie::Value(request->pin().toAscii());
value.children(JolieMessage::Field::PIN) << Jolie::Value(request->pin().toLatin1());
}
getOpDesc.setData(value);
//TODO: async
@ -269,9 +269,9 @@ Jolie::Message RemoteService::signMessage(const Jolie::Message &message) const
}
Jolie::Value data = response.data();
data.children(JolieMessage::Field::IDENTITYID) << Jolie::Value(identity.id().toAscii());
data.children(JolieMessage::Field::IDENTITYID) << Jolie::Value(identity.id().toLatin1());
data.children(JolieMessage::Field::TOKEN) << Jolie::Value(m_token);
data.children(JolieMessage::Field::UUID) << Jolie::Value(m_uuid.toAscii());
data.children(JolieMessage::Field::UUID) << Jolie::Value(m_uuid.toLatin1());
response.setData(data);
data.children(JolieMessage::Field::SIGNATURE) <<
Jolie::Value(identity.signMessage(JolieMessage::payload(response)));

View File

@ -91,9 +91,9 @@ void RemoteServiceJob::start()
Jolie::Message message(m_location.path(KUrl::RemoveTrailingSlash).remove(0, 1).toUtf8(),
"startOperationCall");
Jolie::Value data;
data.children(JolieMessage::Field::OPERATION) << (Jolie::Value(operationName().toAscii()));
data.children(JolieMessage::Field::OPERATION) << (Jolie::Value(operationName().toLatin1()));
data.children(JolieMessage::Field::PARAMETERS) << Jolie::Value(params);
data.children(JolieMessage::Field::DESTINATION) << Jolie::Value(destination().toAscii());
data.children(JolieMessage::Field::DESTINATION) << Jolie::Value(destination().toLatin1());
message.setData(data);
Jolie::Client *client = m_service->m_client;

View File

@ -201,7 +201,7 @@ void ServiceProvider::relay(Jolie::Server *server, int descriptor,
Jolie::Message response(message.resourcePath(), message.operationName(), message.id());
QByteArray uuid = JolieMessage::field(JolieMessage::Field::UUID, message);
response = appendToken(response, identity.id().toAscii(), uuid);
response = appendToken(response, identity.id().toLatin1(), uuid);
AuthorizationManager::self()->d->server->sendReply(descriptor, response);
return;
@ -246,7 +246,7 @@ void ServiceProvider::operationCompleted(Plasma::ServiceJob *job)
data.children(JolieMessage::Field::RESULT) << Jolie::Value(byteArrayResult);
response.setData(data);
if (job->error()) {
response.setFault(Jolie::Fault(job->errorString().toAscii()));
response.setFault(Jolie::Fault(job->errorString().toLatin1()));
}
QByteArray id = JolieMessage::field(JolieMessage::Field::IDENTITYID, message);

View File

@ -112,7 +112,7 @@ Credentials Credentials::createCredentials(const QString &name)
QCA::KeyGenerator generator;
QCA::PrivateKey key = generator.createRSA(2048);
QString pemKey(key.toPublicKey().toPEM());
QString id = QCA::Hash("sha1").hashToString(pemKey.toAscii());
QString id = QCA::Hash("sha1").hashToString(pemKey.toLatin1());
return Credentials(id, name, key.toPEM(), true);
#else
return Credentials();
@ -146,7 +146,7 @@ bool Credentials::isValid() const
if (d->publicKey.isNull()) {
return false;
} else {
QString id = QCA::Hash("sha1").hashToString(d->publicKey.toPEM().toAscii());
QString id = QCA::Hash("sha1").hashToString(d->publicKey.toPEM().toLatin1());
return (id == d->id);
}
#else