mirror of
https://gitlab.com/spaceti-app/integrations/acs/colnod-connector.git
synced 2026-07-12 18:00:37 +02:00
stopep using config file
This commit is contained in:
parent
83c77c9b1c
commit
94edc63f5e
@ -7,14 +7,14 @@ RequestManager::RequestManager()
|
|||||||
loginStatus = false; //should be false, true for testing request header
|
loginStatus = false; //should be false, true for testing request header
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
QFile configFile(QDir::current().filePath("config.json"));
|
QFile configFile(QDir::current().filePath("config.json"));
|
||||||
if (!configFile.open(QIODevice::ReadOnly)) {
|
if (!configFile.open(QIODevice::ReadOnly)) {
|
||||||
qCritical() << "Couldn't open config file config.json" << QDir::current().filePath("config.json");
|
qCritical() << "Couldn't open config file config.json" << QDir::current().filePath("config.json");
|
||||||
QCoreApplication::exit(-1);
|
QCoreApplication::exit(-1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this->config = QJsonDocument::fromJson(configFile.readAll());
|
this->config = QJsonDocument::fromJson(configFile.readAll());*/
|
||||||
QObject::connect(manager, &QNetworkAccessManager::sslErrors, this, &RequestManager::onSSLError);
|
QObject::connect(manager, &QNetworkAccessManager::sslErrors, this, &RequestManager::onSSLError);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,7 +55,8 @@ void RequestManager::getRequest(QString endpoint)
|
|||||||
{
|
{
|
||||||
if (!loginStatus)
|
if (!loginStatus)
|
||||||
{
|
{
|
||||||
login(config.object()["host"].toString(), config.object()["username"].toString(), config.object()["password"].toString());
|
// login(config.object()["host"].toString(), config.object()["username"].toString(), config.object()["password"].toString());
|
||||||
|
login(host, user, password);
|
||||||
// QEventLoop loop;
|
// QEventLoop loop;
|
||||||
// QObject::connect(this, &RequestManager::successLogin, &loop, &QEventLoop::quit);
|
// QObject::connect(this, &RequestManager::successLogin, &loop, &QEventLoop::quit);
|
||||||
// loop.exec();
|
// loop.exec();
|
||||||
|
|||||||
@ -61,7 +61,9 @@ private:
|
|||||||
QNetworkAccessManager* manager;
|
QNetworkAccessManager* manager;
|
||||||
QJsonDocument config;
|
QJsonDocument config;
|
||||||
QString authHeader;
|
QString authHeader;
|
||||||
QString host;
|
QString host = "https://192.168.1.3:8443";
|
||||||
|
QString password = "spaceti1";
|
||||||
|
QString user = "spaceti";
|
||||||
QString token;
|
QString token;
|
||||||
QString jsonResponse;
|
QString jsonResponse;
|
||||||
bool loginStatus;
|
bool loginStatus;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user