Skip to content

Commit f60f701

Browse files
committed
Wrap system information in sysinfo key
Refactors the code to allow sending configuration values during connection. There is no need to delete the type from the connect object any more. Change-Id: Ide5df8fd77ddf556558f387d2846f927ac50e716 Reviewed-by: Edward Welbourne <[email protected]>
1 parent 2c0658f commit f60f701

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

src/plugins/platforms/webgl/qwebglwebsocketserver.cpp

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -286,14 +286,19 @@ void QWebGLWebSocketServer::onNewConnection()
286286
&QWebGLWebSocketServer::onTextMessageReceived);
287287

288288
const QVariantMap values{
289-
{ QStringLiteral("buildAbi"), QSysInfo::buildAbi() },
290-
{ QStringLiteral("buildCpuArchitecture"), QSysInfo::buildCpuArchitecture() },
291-
{ QStringLiteral("currentCpuArchitecture"), QSysInfo::currentCpuArchitecture() },
292-
{ QStringLiteral("kernelType"), QSysInfo::kernelType() },
293-
{ QStringLiteral("machineHostName"), QSysInfo::machineHostName() },
294-
{ QStringLiteral("prettyProductName"), QSysInfo::prettyProductName() },
295-
{ QStringLiteral("productType"), QSysInfo::productType() },
296-
{ QStringLiteral("productVersion"), QSysInfo::productVersion() }
289+
{ "sysinfo",
290+
QVariantMap {
291+
{ QStringLiteral("buildAbi"), QSysInfo::buildAbi() },
292+
{ QStringLiteral("buildCpuArchitecture"), QSysInfo::buildCpuArchitecture() },
293+
{ QStringLiteral("currentCpuArchitecture"),
294+
QSysInfo::currentCpuArchitecture() },
295+
{ QStringLiteral("kernelType"), QSysInfo::kernelType() },
296+
{ QStringLiteral("machineHostName"), QSysInfo::machineHostName() },
297+
{ QStringLiteral("prettyProductName"), QSysInfo::prettyProductName() },
298+
{ QStringLiteral("productType"), QSysInfo::productType() },
299+
{ QStringLiteral("productVersion"), QSysInfo::productVersion() }
300+
}
301+
}
297302
};
298303

299304
sendMessage(socket, MessageType::Connect, values);

src/plugins/platforms/webgl/webqt.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,8 +1183,9 @@ window.onload = function () {
11831183
} else if (obj.type === "change_title") {
11841184
document.title = obj.text;
11851185
} else if (obj.type === "connect") {
1186-
var sysinfo = obj;
1187-
delete sysinfo["type"];
1186+
var sysinfo = obj["sysinfo"];
1187+
if (obj["debug"])
1188+
DEBUG = 1;
11881189
console.log(sysinfo);
11891190
} else {
11901191
console.error("Unknown message type");

0 commit comments

Comments
 (0)