forked from ondra/colnod-connector
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
|
||||
|
||||
|
||||
|
||||
/*
|
||||
QFile configFile(QDir::current().filePath("config.json"));
|
||||
if (!configFile.open(QIODevice::ReadOnly)) {
|
||||
qCritical() << "Couldn't open config file config.json" << QDir::current().filePath("config.json");
|
||||
QCoreApplication::exit(-1);
|
||||
return;
|
||||
}
|
||||
this->config = QJsonDocument::fromJson(configFile.readAll());
|
||||
this->config = QJsonDocument::fromJson(configFile.readAll());*/
|
||||
QObject::connect(manager, &QNetworkAccessManager::sslErrors, this, &RequestManager::onSSLError);
|
||||
}
|
||||
|
||||
@ -55,7 +55,8 @@ void RequestManager::getRequest(QString endpoint)
|
||||
{
|
||||
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;
|
||||
// QObject::connect(this, &RequestManager::successLogin, &loop, &QEventLoop::quit);
|
||||
// loop.exec();
|
||||
|
||||
@ -61,7 +61,9 @@ private:
|
||||
QNetworkAccessManager* manager;
|
||||
QJsonDocument config;
|
||||
QString authHeader;
|
||||
QString host;
|
||||
QString host = "https://192.168.1.3:8443";
|
||||
QString password = "spaceti1";
|
||||
QString user = "spaceti";
|
||||
QString token;
|
||||
QString jsonResponse;
|
||||
bool loginStatus;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user