openuv: Add Qt6 support

master
Simon Stürz 2025-08-08 15:38:09 +02:00
parent c73647c20e
commit 22191713af
3 changed files with 11 additions and 12 deletions

View File

@ -1,6 +1,6 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* Copyright 2013 - 2020, nymea GmbH
* Copyright 2013 - 2025, nymea GmbH
* Contact: contact@nymea.io
*
* This file is part of nymea.
@ -29,9 +29,11 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "integrationpluginopenuv.h"
#include "integrations/thing.h"
#include "plugininfo.h"
#include <integrations/thing.h>
#include <network/networkaccessmanager.h>
#include <QDebug>
#include <QJsonDocument>
#include <QVariantMap>
@ -133,7 +135,7 @@ void IntegrationPluginOpenUv::getUvIndex(Thing *thing)
request.setRawHeader("x-access-token", m_apiKey);
QNetworkReply *reply = hardwareManager()->networkManager()->get(request);
connect(reply, &QNetworkReply::finished, this, [reply, thing, this] {
connect(reply, &QNetworkReply::finished, this, [reply, thing] {
reply->deleteLater();
int status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
@ -150,7 +152,7 @@ void IntegrationPluginOpenUv::getUvIndex(Thing *thing)
QJsonParseError error;
QJsonDocument data = QJsonDocument::fromJson(reply->readAll(), &error);
if (error.error != QJsonParseError::NoError) {
qDebug(dcOpenUv()) << "Recieved invalide JSON object";
qCDebug(dcOpenUv()) << "Recieved invalide JSON object";
return;
}
QVariantMap result = data.toVariant().toMap().value("result").toMap();

View File

@ -31,9 +31,8 @@
#ifndef INTEGRATIONPLUGINOPENUV_H
#define INTEGRATIONPLUGINOPENUV_H
#include "plugintimer.h"
#include "integrations/integrationplugin.h"
#include "network/networkaccessmanager.h"
#include <integrations/integrationplugin.h>
#include <plugintimer.h>
#include <QTimer>
#include <QHostAddress>

View File

@ -1,13 +1,11 @@
include(../plugins.pri)
TARGET = $$qtLibraryTarget(nymea_integrationpluginopenuv)
QT += network
SOURCES += \
integrationpluginopenuv.cpp \
integrationpluginopenuv.cpp
HEADERS += \
integrationpluginopenuv.h \
integrationpluginopenuv.h