Commit 80a39815 authored by Marco Bubke's avatar Marco Bubke Committed by Tim Jenssen
Browse files

QmlDesigner: Limit native key to 31 letter



OS X is only supporting a maximum of 31 letters for shared memory names.

Change-Id: I61351228decaa3fa7ec19a6035620ab932cf5386
Reviewed-by: default avatarTim Jenssen <tim.jenssen@digia.com>
parent ed02e7f3
......@@ -101,12 +101,13 @@ static QByteArray makePlatformSafeKey(const QString &key)
if (key.isEmpty())
return QByteArray();
QByteArray data(QCryptographicHash::hash(key.toLatin1(), QCryptographicHash::Sha1).toBase64());
QString notBase64UrlChars(QStringLiteral("[=+/]"));
QByteArray normalizedData;
normalizedData = QString(data).replace(QRegExp(notBase64UrlChars), QStringLiteral("_")).toLatin1();
data = data.replace('+', '-');
data = data.replace('/', '_');
return normalizedData;
data.truncate(31); // OS X is only supporting 31 byte long names
return data;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment