Add Qt6 support
parent
2adf638abf
commit
5bd0a413f1
|
|
@ -3,8 +3,20 @@ TEMPLATE = lib
|
||||||
|
|
||||||
QT += dbus network
|
QT += dbus network
|
||||||
|
|
||||||
QMAKE_CXXFLAGS *= -Werror -std=c++11 -g
|
greaterThan(QT_MAJOR_VERSION, 5) {
|
||||||
QMAKE_LFLAGS *= -std=c++11
|
message("Building using Qt6 support")
|
||||||
|
CONFIG *= c++17
|
||||||
|
QMAKE_LFLAGS *= -std=c++17
|
||||||
|
QMAKE_CXXFLAGS *= -std=c++17
|
||||||
|
} else {
|
||||||
|
message("Building using Qt5 support")
|
||||||
|
CONFIG *= c++11
|
||||||
|
QMAKE_LFLAGS *= -std=c++11
|
||||||
|
QMAKE_CXXFLAGS *= -std=c++11
|
||||||
|
DEFINES += QT_DISABLE_DEPRECATED_UP_TO=0x050F00
|
||||||
|
}
|
||||||
|
|
||||||
|
QMAKE_CXXFLAGS *= -Werror -g
|
||||||
|
|
||||||
DEFINES += VERSION_STRING=\\\"$${VERSION_STRING}\\\"
|
DEFINES += VERSION_STRING=\\\"$${VERSION_STRING}\\\"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
*
|
*
|
||||||
* Copyright 2013 - 2020, nymea GmbH
|
* Copyright 2013 - 2024, nymea GmbH
|
||||||
* Contact: contact@nymea.io
|
* Contact: contact@nymea.io
|
||||||
*
|
*
|
||||||
* This file is part of nymea.
|
* This file is part of nymea.
|
||||||
|
|
@ -137,7 +137,7 @@ bool NetworkConnection::autoconnect() const
|
||||||
/*! Returns the timestamp of this \l{NetworkConnection} from the last connection. */
|
/*! Returns the timestamp of this \l{NetworkConnection} from the last connection. */
|
||||||
QDateTime NetworkConnection::timeStamp() const
|
QDateTime NetworkConnection::timeStamp() const
|
||||||
{
|
{
|
||||||
return QDateTime::fromTime_t(m_connectionSettings.value("connection").value("timestamp").toUInt());
|
return QDateTime::fromSecsSinceEpoch(m_connectionSettings.value("connection").value("timestamp").toUInt());
|
||||||
}
|
}
|
||||||
|
|
||||||
QDebug operator<<(QDebug debug, NetworkConnection *networkConnection)
|
QDebug operator<<(QDebug debug, NetworkConnection *networkConnection)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
*
|
*
|
||||||
* Copyright 2013 - 2020, nymea GmbH
|
* Copyright 2013 - 2024, nymea GmbH
|
||||||
* Contact: contact@nymea.io
|
* Contact: contact@nymea.io
|
||||||
*
|
*
|
||||||
* This file is part of nymea.
|
* This file is part of nymea.
|
||||||
|
|
@ -45,6 +45,7 @@
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QMetaEnum>
|
#include <QMetaEnum>
|
||||||
|
#include <QRegularExpression>
|
||||||
|
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
|
|
@ -346,7 +347,7 @@ NetworkManager::NetworkManagerError NetworkManager::createWiredAutoConnection(co
|
||||||
QVariantMap connectionSettings {
|
QVariantMap connectionSettings {
|
||||||
{"id", "auto"},
|
{"id", "auto"},
|
||||||
{"autoconnect", true},
|
{"autoconnect", true},
|
||||||
{"uuid", QUuid::createUuid().toString().remove(QRegExp("[{}]"))},
|
{"uuid", QUuid::createUuid().toString().remove(QRegularExpression("[{}]"))},
|
||||||
{"type", "802-3-ethernet"}
|
{"type", "802-3-ethernet"}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -411,7 +412,7 @@ NetworkManager::NetworkManagerError NetworkManager::createWiredManualConnection(
|
||||||
QVariantMap connectionSettings {
|
QVariantMap connectionSettings {
|
||||||
{"id", "manual"},
|
{"id", "manual"},
|
||||||
{"autoconnect", true},
|
{"autoconnect", true},
|
||||||
{"uuid", QUuid::createUuid().toString().remove(QRegExp("[{}]"))},
|
{"uuid", QUuid::createUuid().toString().remove(QRegularExpression("[{}]"))},
|
||||||
{"type", "802-3-ethernet"}
|
{"type", "802-3-ethernet"}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,7 @@ public:
|
||||||
WirelessCapability5Ghz = 0x0400,
|
WirelessCapability5Ghz = 0x0400,
|
||||||
};
|
};
|
||||||
Q_ENUM(WirelessCapability)
|
Q_ENUM(WirelessCapability)
|
||||||
|
|
||||||
Q_DECLARE_FLAGS(WirelessCapabilities, WirelessCapability)
|
Q_DECLARE_FLAGS(WirelessCapabilities, WirelessCapability)
|
||||||
Q_FLAG(WirelessCapabilities)
|
Q_FLAG(WirelessCapabilities)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue