Refactor NvPairingManager, NvComputer, and NvHTTP to reduce passing of addresses

This commit is contained in:
Cameron Gutman
2021-07-02 17:14:48 -05:00
parent bee8378795
commit 5afab126b3
9 changed files with 48 additions and 17 deletions

View File

@@ -1,4 +1,4 @@
#include "nvhttp.h"
#include "nvcomputer.h"
#include <Limelight.h>
#include <QDebug>
@@ -35,6 +35,12 @@ NvHTTP::NvHTTP(QString address, QSslCertificate serverCert) :
connect(&m_Nam, &QNetworkAccessManager::sslErrors, this, &NvHTTP::handleSslErrors);
}
NvHTTP::NvHTTP(NvComputer* computer) :
NvHTTP(computer->activeAddress, computer->serverCert)
{
}
void NvHTTP::setServerCert(QSslCertificate serverCert)
{
m_ServerCert = serverCert;
@@ -55,6 +61,21 @@ QString NvHTTP::address()
return m_Address;
}
QSslCertificate NvHTTP::serverCert()
{
return m_ServerCert;
}
uint16_t NvHTTP::httpPort()
{
return m_BaseUrlHttp.port();
}
uint16_t NvHTTP::httpsPort()
{
return m_BaseUrlHttps.port();
}
QVector<int>
NvHTTP::parseQuad(QString quad)
{