116 QList<QString> possibleHardwareAdresses;
120#ifndef __EMSCRIPTEN__
121 QList<QNetworkInterface> ifaces = QNetworkInterface::allInterfaces();
123 if (!ifaces.isEmpty()) {
124 for (
int i = 0; i < ifaces.size(); ++i) {
125 unsigned int flags = ifaces[i].flags();
126 bool isLoopback =
static_cast<bool>(flags & QNetworkInterface::IsLoopBack);
127 bool isP2P =
static_cast<bool>(flags & QNetworkInterface::IsPointToPoint);
128 bool isRunning =
static_cast<bool>(flags & QNetworkInterface::IsRunning);
133 if (!ifaces[i].isValid() || isLoopback || isP2P)
135 possibleHardwareAdresses << ifaces[i].hardwareAddress();
137 if (possibleHardwareAdresses.size() > 0) {
139 QStringList hexPresentation = possibleHardwareAdresses[0].split(
":");
140 if (hexPresentation.size() == 6) {
141 fixed_id[0] = QString(hexPresentation[0] + hexPresentation[1] + hexPresentation[2]).toInt(
nullptr, 16);
142 fixed_id[1] = QString(hexPresentation[3] + hexPresentation[4] + hexPresentation[5]).toInt(
nullptr, 16);
207 time_t secs =
time.secs;
215 const bool bTimeValid = (localtime_s(<ime, &secs) == 0);
217 const bool bTimeValid = (localtime_r(&secs, <ime) !=
nullptr);
221 if (!bTimeValid || strftime(timebuf,
sizeof(timebuf),
"%c", <ime) == 0) {
225 return QString(
"%1.%2 0x%3%4 %5")
230 .arg(QString::fromLatin1(timebuf));