From 3114151f29b180e042e227a50f3dca135b916ce1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Tue, 8 Oct 2019 09:47:04 +0200 Subject: [PATCH] Fix hostname parsing for Qt < 5.6 --- libnymea-core/debugserverhandler.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libnymea-core/debugserverhandler.cpp b/libnymea-core/debugserverhandler.cpp index e0afb0ee..8e883018 100644 --- a/libnymea-core/debugserverhandler.cpp +++ b/libnymea-core/debugserverhandler.cpp @@ -36,6 +36,8 @@ #include #include #include +#include +#include namespace nymeaserver { @@ -1007,7 +1009,12 @@ QByteArray DebugServerHandler::createDebugXmlDocument() writer.writeStartElement("tr"); //: The command description in the server infromation section of the debug interface writer.writeTextElement("th", tr("Hostname")); +#if (QT_VERSION < QT_VERSION_CHECK(5, 6, 0)) + writer.writeTextElement("td", QHostInfo::localHostName()); +#else writer.writeTextElement("td", QSysInfo::machineHostName()); +#endif + writer.writeEndElement(); // tr writer.writeStartElement("tr");