Skip to content
Snippets Groups Projects
Commit 186f82a7 authored by Tim Jenssen's avatar Tim Jenssen Committed by Christian Stenger
Browse files

QmlDesigner: SharedMemory key needs to be the same with all Qts


Change-Id: I7b514e3d21f0874fec35331e7fd73c209e9b30d7
Reviewed-by: default avatarChristian Stenger <christian.stenger@digia.com>
parent 2bfd14db
No related branches found
No related tags found
No related merge requests found
......@@ -102,17 +102,13 @@ static QByteArray makePlatformSafeKey(const QString &key)
{
if (key.isEmpty())
return QByteArray();
#if QT_VERSION < QT_VERSION_CHECK(5, 2, 0)
QByteArray data(QCryptographicHash::hash(key.toLatin1(), QCryptographicHash::Sha1).toBase64());
QString ambiguousChars(QStringLiteral("[=~<>|?*!@#$%^&:,; \\\\]"));
QString notBase64UrlChars(QStringLiteral("[=+/]"));
QByteArray normalizedData;
normalizedData = QString(data).replace(QRegExp(ambiguousChars), QStringLiteral("_")).toLatin1();
normalizedData = QString(data).replace(QRegExp(notBase64UrlChars), QStringLiteral("_")).toLatin1();
return normalizedData;
#else
return QCryptographicHash::hash(key.toLatin1(), QCryptographicHash::Sha1).toBase64(QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals);
#endif
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment