tempo: Add Qt6 support

This commit is contained in:
Simon Stürz 2025-08-08 16:48:50 +02:00
parent c04d9a5ae5
commit d480c61cc9
4 changed files with 13 additions and 12 deletions

View File

@ -1,6 +1,6 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Copyright 2013 - 2020, nymea GmbH * Copyright 2013 - 2025, nymea GmbH
* Contact: contact@nymea.io * Contact: contact@nymea.io
* *
* This file is part of nymea. * This file is part of nymea.
@ -31,7 +31,8 @@
#include "integrationplugintempo.h" #include "integrationplugintempo.h"
#include "plugininfo.h" #include "plugininfo.h"
#include "network/networkaccessmanager.h" #include <network/networkaccessmanager.h>
#include <plugintimer.h>
#include <QTimer> #include <QTimer>
#include <QUrlQuery> #include <QUrlQuery>

View File

@ -31,11 +31,12 @@
#ifndef INTEGRATIONPLUGINTEMPO_H #ifndef INTEGRATIONPLUGINTEMPO_H
#define INTEGRATIONPLUGINTEMPO_H #define INTEGRATIONPLUGINTEMPO_H
#include "integrations/integrationplugin.h" #include <integrations/integrationplugin.h>
#include "plugintimer.h"
#include "tempo.h" #include "tempo.h"
class PluginTimer;
class IntegrationPluginTempo : public IntegrationPlugin class IntegrationPluginTempo : public IntegrationPlugin
{ {
Q_OBJECT Q_OBJECT
@ -70,5 +71,6 @@ private slots:
void onAccountWorkloadReceived(const QString &accountKey, QList<Tempo::Worklog> workloads, int limit, int offset); void onAccountWorkloadReceived(const QString &accountKey, QList<Tempo::Worklog> workloads, int limit, int offset);
void onTeamWorkloadReceived(int teamId, QList<Tempo::Worklog> workloads, int limit, int offset); void onTeamWorkloadReceived(int teamId, QList<Tempo::Worklog> workloads, int limit, int offset);
}; };
#endif // INTEGRATIONPLUGINTEMPO_H #endif // INTEGRATIONPLUGINTEMPO_H

View File

@ -291,19 +291,19 @@ bool Tempo::checkStatusCode(QNetworkReply *reply, const QByteArray &rawData)
case 400: //Error occurred (e.g. validation error - value is out of range) case 400: //Error occurred (e.g. validation error - value is out of range)
if(!jsonDoc.toVariant().toMap().contains("error")) { if(!jsonDoc.toVariant().toMap().contains("error")) {
if(jsonDoc.toVariant().toMap().value("error").toString() == "invalid_client") { if(jsonDoc.toVariant().toMap().value("error").toString() == "invalid_client") {
qWarning(dcTempo()) << "Client token provided doesnt correspond to client that generated auth code."; qCWarning(dcTempo()) << "Client token provided doesnt correspond to client that generated auth code.";
} }
if(jsonDoc.toVariant().toMap().value("error").toString() == "invalid_redirect_uri") { if(jsonDoc.toVariant().toMap().value("error").toString() == "invalid_redirect_uri") {
qWarning(dcTempo()) << "Missing redirect_uri parameter."; qCWarning(dcTempo()) << "Missing redirect_uri parameter.";
} }
if(jsonDoc.toVariant().toMap().value("error").toString() == "invalid_code") { if(jsonDoc.toVariant().toMap().value("error").toString() == "invalid_code") {
qWarning(dcTempo()) << "Expired authorization code."; qCWarning(dcTempo()) << "Expired authorization code.";
} }
} }
setAuthenticated(false); setAuthenticated(false);
return false; return false;
case 401: case 401:
qWarning(dcTempo()) << "Client does not have permission to use this API."; qCWarning(dcTempo()) << "Client does not have permission to use this API.";
setAuthenticated(false); setAuthenticated(false);
return false; return false;
case 403: case 403:
@ -314,7 +314,7 @@ bool Tempo::checkStatusCode(QNetworkReply *reply, const QByteArray &rawData)
qCWarning(dcTempo()) << "Not Found. This resource is not available (e.g. no images on washing machine)"; qCWarning(dcTempo()) << "Not Found. This resource is not available (e.g. no images on washing machine)";
return false; return false;
case 405: case 405:
qWarning(dcTempo()) << "Wrong HTTP method used."; qCWarning(dcTempo()) << "Wrong HTTP method used.";
setAuthenticated(false); setAuthenticated(false);
return false; return false;
case 408: case 408:

View File

@ -1,8 +1,6 @@
include(../plugins.pri) include(../plugins.pri)
QT += network QT *= network
TARGET = $$qtLibraryTarget(nymea_integrationplugintempo)
SOURCES += \ SOURCES += \
integrationplugintempo.cpp \ integrationplugintempo.cpp \