Fix hostname parsing for Qt < 5.6
This commit is contained in:
parent
79cdf8316e
commit
3114151f29
@ -36,6 +36,8 @@
|
|||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QWebSocket>
|
#include <QWebSocket>
|
||||||
|
#include <QPair>
|
||||||
|
#include <QHostInfo>
|
||||||
|
|
||||||
|
|
||||||
namespace nymeaserver {
|
namespace nymeaserver {
|
||||||
@ -1007,7 +1009,12 @@ QByteArray DebugServerHandler::createDebugXmlDocument()
|
|||||||
writer.writeStartElement("tr");
|
writer.writeStartElement("tr");
|
||||||
//: The command description in the server infromation section of the debug interface
|
//: The command description in the server infromation section of the debug interface
|
||||||
writer.writeTextElement("th", tr("Hostname"));
|
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());
|
writer.writeTextElement("td", QSysInfo::machineHostName());
|
||||||
|
#endif
|
||||||
|
|
||||||
writer.writeEndElement(); // tr
|
writer.writeEndElement(); // tr
|
||||||
|
|
||||||
writer.writeStartElement("tr");
|
writer.writeStartElement("tr");
|
||||||
|
|||||||
Reference in New Issue
Block a user