Update to c++14 and fix warnings

This commit is contained in:
Simon Stürz 2024-07-18 14:49:06 +02:00
parent 6d50019e1b
commit a30755238d
6 changed files with 16 additions and 11 deletions

View File

@ -28,9 +28,8 @@ NetworkReachabilityMonitor::NetworkReachabilityMonitor(QObject *parent)
});
QGuiApplication *app = static_cast<QGuiApplication*>(QGuiApplication::instance());
QObject::connect(app, &QGuiApplication::applicationStateChanged, this, [app, this](Qt::ApplicationState state) {
QObject::connect(app, &QGuiApplication::applicationStateChanged, this, [this](Qt::ApplicationState state) {
qCDebug(dcNymeaConnection()) << "Application state changed to:" << state;
updateActiveBearers();
});

View File

@ -77,19 +77,24 @@ QUrl TunnelProxyTransport::url() const
NymeaTransportInterface::ConnectionState TunnelProxyTransport::connectionState() const
{
NymeaTransportInterface::ConnectionState state = NymeaTransportInterface::ConnectionStateDisconnected;
switch (m_remoteConnection->state()) {
case TunnelProxyRemoteConnection::StateRemoteConnected:
return NymeaTransportInterface::ConnectionStateConnected;
state = NymeaTransportInterface::ConnectionStateConnected;
break;
case TunnelProxyRemoteConnection::StateConnecting:
case TunnelProxyRemoteConnection::StateHostLookup:
case TunnelProxyRemoteConnection::StateConnected:
case TunnelProxyRemoteConnection::StateInitializing:
case TunnelProxyRemoteConnection::StateRegister:
return NymeaTransportInterface::ConnectionStateConnecting;
state = NymeaTransportInterface::ConnectionStateConnecting;
break;
case TunnelProxyRemoteConnection::StateDiconnecting:
case TunnelProxyRemoteConnection::StateDisconnected:
return NymeaTransportInterface::ConnectionStateDisconnected;
state = NymeaTransportInterface::ConnectionStateDisconnected;
break;
}
return state;
}
void TunnelProxyTransport::disconnect()

View File

@ -334,11 +334,9 @@ void BtWiFiSetup::streamData(QLowEnergyService *service, const QUuid &characteri
QLowEnergyCharacteristic characteristic = service->characteristic(characteristicUuid);
QByteArray data = QJsonDocument::fromVariant(request).toJson(QJsonDocument::Compact) + '\n';
int sentDataLength = 0;
QByteArray remainingData = data;
while (!remainingData.isEmpty()) {
QByteArray package = remainingData.left(20);
sentDataLength += package.count();
m_wifiService->writeCharacteristic(characteristic, package);
remainingData = remainingData.remove(0, package.count());
}

View File

@ -296,6 +296,8 @@ int ZWaveNodes::rowCount(const QModelIndex &parent) const
QVariant ZWaveNodes::data(const QModelIndex &index, int role) const
{
Q_UNUSED(index)
Q_UNUSED(role)
return QVariant();
}

View File

@ -137,10 +137,9 @@ void NfcThingActionWriter::updateContent()
QNdefNfcUriRecord record;
record.setUri(url);
QNdefMessage message;
message.append(record);
m_currentMessage = message;
m_currentMessage.clear();
m_currentMessage.append(record);
emit messageSizeChanged();
}

View File

@ -1,4 +1,6 @@
CONFIG += c++11
CONFIG *= c++14
QMAKE_LFLAGS *= -std=c++14
QMAKE_CXXFLAGS *= -std=c++14
top_srcdir=$$PWD
top_builddir=$$shadowed($$PWD)