diff --git a/cacic-daemon/cacicD/cacicd.cpp b/cacic-daemon/cacicD/cacicd.cpp index c03178e..e46a9fd 100644 --- a/cacic-daemon/cacicD/cacicd.cpp +++ b/cacic-daemon/cacicD/cacicd.cpp @@ -11,8 +11,8 @@ cacicD::cacicD(int argc, char **argv) : QtService(argc, argv, setServiceFlags(QtService::Default); logManager = QLogger::QLoggerManager::getInstance(); - logManager->addDestination(application()->applicationDirPath().append("/log.txt"),"Cacic Daemon",QLogger::InfoLevel); - logManager->addDestination(application()->applicationDirPath().append("/log.txt"),"Cacic Daemon",QLogger::ErrorLevel); + logManager->addDestination(application()->applicationDirPath() + "/cacicLog.txt","Cacic Daemon",QLogger::InfoLevel); + logManager->addDestination(application()->applicationDirPath() + "/cacicLog.txt","Cacic Daemon",QLogger::ErrorLevel); } catch (...){ qCritical() << "Error desconhecido no construtor."; } @@ -34,9 +34,6 @@ void cacicD::start() { qDebug() << "\nServiço iniciado em" << application()->applicationDirPath(); QLogger::QLog_Info("Cacic Daemon", QString("Servico iniciado em ").append(application()->applicationDirPath()).append(".")); QJsonObject result = ccacic->getJsonFromFile(application()->applicationDirPath().append("/getConfig.json")); - - QJsonObject result = ccacic->getJsonFromFile(application()->applicationDirPath() + "/getConfig.json"); - if(!result.contains("error") && !result.isEmpty()){ Ocacictimer->iniciarTimer(result["codestatus"].toInt()); }else{ diff --git a/cacic-daemon/cacicD/cacictimer.cpp b/cacic-daemon/cacicD/cacictimer.cpp index bbd170c..cfb8b86 100644 --- a/cacic-daemon/cacicD/cacictimer.cpp +++ b/cacic-daemon/cacicD/cacictimer.cpp @@ -2,43 +2,12 @@ CacicTimer::CacicTimer(QString dirpath) { - qDebug() << "iniciou o constructor"; definirDirGercols(dirpath); setApplicationDirPath(dirpath); iniciarInstancias(); connect(timer,SIGNAL(timeout()),this,SLOT(mslot())); } -void CacicTimer::iniciarTimer(int x) -{ -======= - OCacicComm = new CacicComm(); - ccacic = new CCacic(); - timer = new QTimer(this); - logManager = QLogger::QLoggerManager::getInstance(); - - OCacicComm = CacicComm("http://teste.cacic.cc", - "rG/HcIDVTZ3pPKCf[[MAIS]]I6aigUb7OMeij3FfC7qNaznk0rBRYb6q6kSK3eNfjgptS8BfwW5yJqCvD2ai7xlw9I6P21j6cvQUqlHmAJpCbfwR13urdRE9AhjfokMcPrH6R1/zXPGMHveLRRgKLcqWu2X96rmoQQdRq9EW1SXmYUAx1dCV[[MAIS]]3Ha61XBw5pq58q35zH8Gjt998rTi3ecV8ShXXevqyK[[MAIS]]W07xpgTjbbd6Fbs/35gPfdRRgMNFjq7Gq[[MAIS]]llFgYMJ6UcEhw8f0ZLQo2oL/eRW/CNyeBW6wG0hIo6EIdpi/Ht0/95Uwn2Og[[MAIS]]2UPXsmKKuTMeGwUvPdbEfexlinUO0[[MAIS]]j9qIa2dpjtl0Y5Fyk1Bvw2ZYRTXwgJpUHsBboWmtTFpgX3wSGOWMipE80K8ktRTVYOp[[MAIS]]4qS/SzKWXpfCuZoCncfwE0lCEoreTH[[MAIS]]MLrTkHJP2oqYMAyFyQcjC0UGr3BQGa2edSNXjG7jrTdddga/SODUiF94jgh/QBwhiZby34b__CRYPTED__", - "P198PVwtz5F5CfZPSUrzuaQA/QG1sTnwzl/rBnj8M7y5MglANGodG5LLD4q7oY809HuDR4g5tL64lZRBKvKPmEgWd9iAZKvT4UAm9XWN3nKKLGaznCaJohmntNGqrJP1Zd9riTHGu10mPbg/Uh3TCbBHVOICvu5sDlINlCR6A3[[MAIS]]a55RhfKNidvr5uX0kozCxr5t2DyOb5oPocEGyJKyHLQ==__CRYPTED__", - "1", - "0", - "0", - "YwpgjzZ86/eCsjvOki1KkQ==__CRYPTED__", - "8PT6U445MPNr3S7WHFa20ge/8NJSspSYE/UL3zf[[MAIS]]wkEfNZ7p1B/2o6i89gTZ44Ok__CRYPTED__", - "wshPlZWvLPhbUEQFQ1aQmA==__CRYPTED__", - "E9aKtVz/OSmGv7v1xW4FwaFukOob3qQ/HFDIz916K3ys82qfX9vBDz[[MAIS]]M2cdoYedhNkXt[[MAIS]]UVb10nD[[MAIS]]tOfbn7mlOlTDoGzUl9CgdPCsb[[MAIS]]Qa4wzuCrMw0BcCuaKfr62E3b8vh6Ug4JJbOgBo3ohG3x5O7Ap0D94GKtAWjMuTXRBbhGxPrRS4M6AhzvaN5P8pWd9FikrCLWuMs4ebnRlftef3RmVKScBDQ5zmK6sKxYNmX[[MAIS]]kKn/Gi2[[MAIS]]HftZ7HD9JLvZBpYhp4yjqShblQ67d6PlWgrRWXxwDseIiJe3NlF70zrCPBBelkeAhVDXMXnsYtLms3ElsLzxa3c5vpWzTfgyE[[MAIS]]hvALy4ivew7zaxEwrg2KY1T7GOSWZ7vljIvbhVZJgtzbnYiulFjJTtm5W4uJMKLuUJNzB0rxMkzToIE9/kDmeO2OKiwFbIfbe2Wdq0VpllOkjKtj9WM676iBSpYAXG0MsmLMj9CZ/sNi06hGF[[MAIS]]rXxiOSk66M0Hq[[MAIS]]OeUBh4z3Ra6f9yPJn0K9hIQyT[[MAIS]]Dr/QW/QdJIOkLTW8ZyyAF4DW9ojiTlUdySvB5EB1jyZ5nNTpzyE38qIdg7uM1tdWdm9FZGYxMdHwi1tS2dBeIWkDfWEjih01xiVt2dmdRgo0zIZvmmYDJ9LhCU3XPDlwdeQ8[[MAIS]]F7fnxDfxGqZQjZJ[[MAIS]]Y/Q8bdLpgbhcd3gt3SzjMLE0M[[MAIS]]hTmHG1KP2CzCibZ7grFAN3Y3jSPjmEj5Fzs26tdhdjNzSIt1FCueea8P2c4NmxPYkJCg0D1mgNrkH3L5svsO[[MAIS]]6YYrl3df4s[[MAIS]]fcK/to9s/pnkKfBKrAPF6Z4s2WPsALUPBDS5ty7RC2vqXRvH6hPR4o7xhXzQOQ/1xytr/RoEWEVeZ2wgHVVbbtFsALul/IDc7B45wmwxBx9iZHVwpQJVlNZZUBtwKqKhnXz5pM[[MAIS]]7yUAkfhMcO09pPd5kB2MBdRJs[[MAIS]]2FIk0GRUw05IHkc1rZEX5Ow==__CRYPTED__", - "Yot8BeM9lOh431SB7dYQXw==__CRYPTED__", - "Dcr8b5IfZOJjt6qyH5dGyw==__CRYPTED__", - "2.5.1.1.256.32", - "2.8.1.7", - "2.8.1.6"); - OCacicComm->setUrlSsl("https://10.1.0.137/cacic/web/app_dev.php"); - OCacicComm->setUsuario("cacic"); - OCacicComm->setPassword("cacic123"); - - connect(timer,SIGNAL(timeout()),this,SLOT(mslot())); -} - CacicTimer::~CacicTimer() { logManager->closeLogger(); @@ -47,125 +16,129 @@ CacicTimer::~CacicTimer() delete OCacicComm; } -void CacicTimer::iniciarTimer(int x, QString applicationDirPath) +void CacicTimer::iniciarTimer(int x) { - setApplicationDirPath(applicationDirPath); - logManager->addDestination(getApplicationDirPath().append("/cacicLog.txt"), QStringList("Cacic Daemon"), QLogger::InfoLevel); - logManager->addDestination(getApplicationDirPath().append("/cacicLog.txt"), QStringList("Cacic Daemon"), QLogger::ErrorLevel); timer->start(x); } void CacicTimer::mslot(){ + QLogger::QLog_Info("Cacic Daemon (Timer)", QString("mslot();")); cMutex->lock(); - if(getTest()){ - if(getConfig()){ - QLogger::QLog_Info("Cacic Timer", QString("semáforo fechado.")); - iniciarGercols(); - cMutex->unlock(); - QLogger::QLog_Info("Cacic Timer", QString("semáforo aberto.")); - qDebug() << "getConfig() success. - " + QDateTime::currentDateTime().toLocalTime().toString(); - QLogger::QLog_Info("Cacic Daemon", "getConfig() executado com sucesso."); - - // Compara o novo arquivo de configuração com um antigo e se forem diferentes - // mantem o mais recente; caso iguais simplesmente apaga o novo. - QFile *fileOld; - QFile *fileNew; - - fileOld = new QFile(getApplicationDirPath().append("/getConfig.json")); - fileNew = new QFile(getApplicationDirPath().append("/getConfigNew.json")); - if( fileOld->exists() && fileNew->exists() ){ - if( Md5IsEqual(QVariant::fromValue(fileOld), QVariant::fromValue(fileNew)) ) { - fileNew->remove(); - } else { - // Renomeia getConfigNew.json para getConfig.json - fileOld->remove(); - fileNew->rename("getConfigNew.json","getConfig.json"); - } - jsonConfig = ccacic->getJsonFromFile(getApplicationDirPath().append("/getConfig.json")); - } else if( fileOld->exists() ){ - jsonConfig = ccacic->getJsonFromFile(getApplicationDirPath().append("/getConfig.json")); - } else { - QLogger::QLog_Error("Cacic Daemon", "Arquivo de configuração não criado."); - } - delete fileOld; - delete fileNew; - - /* lê json de configurações e armazena quais módulos executáveis. - * E faz o mesmo tipo de comparação de hashs, com o fim de: - * ou mantem o binário do módulo ou baixa um novo. - */ - - /* Aqui estou assumindo um formato do .json em que: - * há a key modulos contem uma lista com o nome dos executaveis e os seus valores hash md5 - * há a key metodo que explicita o método de download dos executaveis - */ - foreach( QJsonValue moduloValues, jsonConfig["modulos"].toArray() ) { - QString moduloKey, moduloValue; - - moduloKey = moduloValues.toObject()["md5"].toString(); - moduloValue = moduloValues.toObject()["nome"].toString(); - - moduleMap.insert(moduloKey, moduloValue); - } - metodoDownload = jsonConfig["metodo"].toString(); - - int countExecNotFound = 0; - QMap::const_iterator mapIterator = moduleMap.constBegin(); - while (mapIterator != moduleMap.constEnd()) { - QString nomeModulo = mapIterator.value(); - QString hashModulo = mapIterator.key(); - - // Calcula hash do binario atual -#if defined(Q_OS_WIN) - fileOld = new QFile(getApplicationDirPath().append("/").append(modulo).append(".exe")); -#else - fileOld = new QFile(getApplicationDirPath().append("/").append(nomeModulo)); -#endif - if(!fileOld->exists()) { - QLogger::QLog_Error("Cacic Daemon", QString("Módulo ").append(nomeModulo).append(" não encontrado.")); - - countExecNotFound++; - if( countExecNotFound == moduleMap.size() ) { - QLogger::QLog_Error("Cacic Daemon", "Não foi possível encontrar nenhum módulo executável!"); - return; - } - continue; - } - - QString oldMd5 = QString(QCryptographicHash::hash(fileOld->readAll(),QCryptographicHash::Md5).toHex()); - - if ( oldMd5 != hashModulo ) { - - fileOld->rename(getApplicationDirPath().append("/").append(nomeModulo), - getApplicationDirPath().append("/").append("nomeModulo").append("Old") ); - - // Download nova versão do executável - if(metodoDownload == "ftp" || metodoDownload == "") { -// OCacicComm->ftpDownload( QString("/ws/get/").append(nomeModulo) ); - } - - - fileOld->remove(); - delete fileOld; - } - - mapIterator++; - } - }else{ - qDebug() << "getConfig() failed. - " + QDateTime::currentDateTime().toLocalTime().toString(); - QLogger::QLog_Error("Cacic Daemon", "Falha na obtenção do arquivo de configuração."); - } - }else{ - qDebug() << "getTest() failed. - " + QDateTime::currentDateTime().toLocalTime().toString(); - QLogger::QLog_Error("Cacic Daemon", "Falha na execução do getTest()."); - } + QLogger::QLog_Info("Cacic Daemon (Timer)", QString("Semáforo fechado.")); + //if(getTest()){ + // QLogger::QLog_Info("Cacic Daemon (Timer)", QString("getTeste() success.")); + // if(getConfig()){ + // QLogger::QLog_Info("Cacic Daemon (Timer)", QString("getConfig() success.")); + iniciarGercols(); + // } + // } + cMutex->unlock(); + QLogger::QLog_Info("Cacic Daemon (Timer)", QString("Semáforo aberto.")); } +// QLogger::QLog_Info("Cacic Timer", QString("semáforo aberto.")); +// qDebug() << "getConfig() success. - " + QDateTime::currentDateTime().toLocalTime().toString(); +// QLogger::QLog_Info("Cacic Daemon (Timer)", "getConfig() executado com sucesso."); + +// // Compara o novo arquivo de configuração com um antigo e se forem diferentes +// // mantem o mais recente; caso iguais simplesmente apaga o novo. +// QFile *fileOld; +// QFile *fileNew; + +// fileOld = new QFile(getApplicationDirPath().append("/getConfig.json")); +// fileNew = new QFile(getApplicationDirPath().append("/getConfigNew.json")); +// if( fileOld->exists() && fileNew->exists() ){ +// if( Md5IsEqual(QVariant::fromValue(fileOld), QVariant::fromValue(fileNew)) ) { +// fileNew->remove(); +// } else { +// // Renomeia getConfigNew.json para getConfig.json +// fileOld->remove(); +// fileNew->rename("getConfigNew.json","getConfig.json"); +// } +// jsonConfig = ccacic->getJsonFromFile(getApplicationDirPath().append("/getConfig.json")); +// } else if( fileOld->exists() ){ +// jsonConfig = ccacic->getJsonFromFile(getApplicationDirPath().append("/getConfig.json")); +// } else { +// QLogger::QLog_Error("Cacic Daemon (Timer)", "Arquivo de configuração não criado."); +// } +// delete fileOld; +// delete fileNew; + +// /* lê json de configurações e armazena quais módulos executáveis. +// * E faz o mesmo tipo de comparação de hashs, com o fim de: +// * ou mantem o binário do módulo ou baixa um novo. +// */ + +// /* Aqui estou assumindo um formato do .json em que: +// * há a key modulos contem uma lista com o nome dos executaveis e os seus valores hash md5 +// * há a key metodo que explicita o método de download dos executaveis +// */ +// foreach( QJsonValue moduloValues, jsonConfig["modulos"].toArray() ) { +// QString moduloKey, moduloValue; + +// moduloKey = moduloValues.toObject()["md5"].toString(); +// moduloValue = moduloValues.toObject()["nome"].toString(); + +// moduleMap.insert(moduloKey, moduloValue); +// } +// metodoDownload = jsonConfig["metodo"].toString(); + +// int countExecNotFound = 0; +// QMap::const_iterator mapIterator = moduleMap.constBegin(); +// while (mapIterator != moduleMap.constEnd()) { +// QString nomeModulo = mapIterator.value(); +// QString hashModulo = mapIterator.key(); + +// // Calcula hash do binario atual +//#if defined(Q_OS_WIN) +// fileOld = new QFile(getApplicationDirPath().append("/").append(modulo).append(".exe")); +//#else +// fileOld = new QFile(getApplicationDirPath().append("/").append(nomeModulo)); +//#endif +// if(!fileOld->exists()) { +// QLogger::QLog_Error("Cacic Daemon (Timer)", QString("Módulo ").append(nomeModulo).append(" não encontrado.")); + +// countExecNotFound++; +// if( countExecNotFound == moduleMap.size() ) { +// QLogger::QLog_Error("Cacic Daemon (Timer)", "Não foi possível encontrar nenhum módulo executável!"); +// return; +// } +// continue; +// } + +// QString oldMd5 = QString(QCryptographicHash::hash(fileOld->readAll(),QCryptographicHash::Md5).toHex()); + +// if ( oldMd5 != hashModulo ) { + +// fileOld->rename(getApplicationDirPath().append("/").append(nomeModulo), +// getApplicationDirPath().append("/").append("nomeModulo").append("Old") ); + +// // Download nova versão do executável +// if(metodoDownload == "ftp" || metodoDownload == "") { +// // OCacicComm->ftpDownload( QString("/ws/get/").append(nomeModulo) ); +// } + + +// fileOld->remove(); +// delete fileOld; +// } + +// mapIterator++; +// } +// }else{ +// qDebug() << "getConfig() failed. - " + QDateTime::currentDateTime().toLocalTime().toString(); +// QLogger::QLog_Error("Cacic Daemon (Timer)", "Falha na obtenção do arquivo de configuração."); +// } +// }else{ +// qDebug() << "getTest() failed. - " + QDateTime::currentDateTime().toLocalTime().toString(); +// QLogger::QLog_Error("Cacic Daemon (Timer)", "Falha na execução do getTest()."); +// } +// } +// } +//} + bool CacicTimer::getTest(){ try{ - OCacicComm->setUrlGerente("http://10.1.0.137/cacic/web/app_dev.php"); - OCacicComm->setUsuario("cacic"); - OCacicComm->setPassword("cacic123"); bool ok; QJsonObject as; as["computador"] = OCacic_Computer.toJsonObject(); @@ -174,7 +147,7 @@ bool CacicTimer::getTest(){ // return false; // } try{ - ccacic->setJsonToFile(jsonresult, getApplicationDirPath() + "/getTest.json"); + ccacic->setJsonToFile(jsonresult, this->applicationDirPath + "/getTest.json"); return true; } catch (...) { qDebug() << "Erro ao salvar o arquivo de configurações."; @@ -188,9 +161,6 @@ bool CacicTimer::getTest(){ bool CacicTimer::getConfig(){ try{ - OCacicComm->setUrlGerente("http://10.1.0.137/cacic/web/app_dev.php"); - OCacicComm->setUsuario("cacic"); - OCacicComm->setPassword("cacic123"); bool ok; QJsonObject as; as["computador"] = OCacic_Computer.toJsonObject(); @@ -199,7 +169,7 @@ bool CacicTimer::getConfig(){ // return false; // } try{ - ccacic->setJsonToFile(jsonresult, getApplicationDirPath().append("/getConfigNew.json")); + ccacic->setJsonToFile(jsonresult, this->applicationDirPath + "/getConfigNew.json"); return true; } catch (...) { qDebug() << "Erro ao salvar o arquivo de configurações."; @@ -213,6 +183,7 @@ bool CacicTimer::getConfig(){ void CacicTimer::registraInicio() { + QLogger::QLog_Info("Cacic Daemon (Timer)","Coleta iniciada em: " + QDateTime::currentDateTime().toLocalTime().toString()); } QString CacicTimer::getDirProgram() const @@ -220,11 +191,6 @@ QString CacicTimer::getDirProgram() const return dirProgram; } -QString CacicTimer::getApplicationDirPath() const -{ - return applicationDirPath; -} - void CacicTimer::setDirProgram(const QString &value) { dirProgram = value; @@ -233,22 +199,20 @@ void CacicTimer::setDirProgram(const QString &value) void CacicTimer::iniciarGercols() { - + registraInicio(); + QDir::setCurrent(this->applicationDirPath); QProcess proc; - proc.children(); + proc.setWorkingDirectory(this->applicationDirPath); proc.execute(getDirProgram()); - if(proc.atEnd()){ - + if((proc.atEnd()) && (proc.exitStatus() == QProcess::NormalExit)){ + registraFim("SUCESSO"); + }else{ + proc.waitForFinished(120000); + if((!proc.atEnd()) || (proc.exitStatus() == QProcess::CrashExit)){ + registraFim("ERRO"); + proc.kill(); + } } - // QString retorno = ccacic->startProcess(getDirProgram(),true,ok); - // qDebug() << retorno; - QLogger::QLog_Info("Cacic Timer","processo finalizado."); - // if (myProcess.waitForFinished(-1)){ - // qDebug() << "erro:" << myProcess.errorString(); - // }else{ - // qDebug() << "não deu erro:" << myProcess.readAll(); - // QLogger::QLog_Info("Cacic Timer","processo está aberto."); - // } } void CacicTimer::setApplicationDirPath(const QString &value) @@ -257,8 +221,9 @@ void CacicTimer::setApplicationDirPath(const QString &value) } -void CacicTimer::registraFim() +void CacicTimer::registraFim(QString msg) { + QLogger::QLog_Info("Cacic Daemon (Timer)","Coleta finalizada com " + msg + " em: " + QDateTime::currentDateTime().toLocalTime().toString()); } bool CacicTimer::Md5IsEqual(QVariant document01,QVariant document02){ @@ -275,19 +240,21 @@ bool CacicTimer::Md5IsEqual(QVariant document01,QVariant document02){ void CacicTimer::iniciarInstancias(){ logManager = QLogger::QLoggerManager::getInstance(); - logManager->addDestination(getApplicationDirPath().append("/log.txt"),"Cacic Timer",QLogger::InfoLevel); - logManager->addDestination(getApplicationDirPath().append("/log.txt"),"Cacic Timer",QLogger::ErrorLevel); - OCacicComm = new CacicComm(); + logManager->addDestination(this->applicationDirPath + "/cacicLog.txt","Cacic Daemon (Timer)",QLogger::InfoLevel); + logManager->addDestination(this->applicationDirPath + "/cacicLog.txt","Cacic Daemon (Timer)",QLogger::ErrorLevel); ccacic = new CCacic(); timer = new QTimer(this); cMutex = new QMutex(QMutex::Recursive); - QLogger::QLog_Info("Cacic Timer", QString("terminou as instancias")); + OCacicComm = new CacicComm(); + OCacicComm->setUrlSsl("https://10.1.0.137/cacic/web/app_dev.php"); + OCacicComm->setUsuario("cacic"); + OCacicComm->setPassword("cacic123"); } -void CacicTimer::definirDirGercols(QString applicationDirPath){ +void CacicTimer::definirDirGercols(QString appDirPath){ #if defined (Q_OS_WIN) - setDirProgram(applicationDirPath.append("\cacic-gercols.exe")); + setDirProgram(appDirPath + "\cacic-gercols.exe"); #elif defined (Q_OS_LINUX) - setDirProgram(applicationDirPath.append("/cacic-gercols")); + setDirProgram(appDirPath + "/cacic-gercols"); #endif } diff --git a/cacic-daemon/cacicD/cacictimer.h b/cacic-daemon/cacicD/cacictimer.h index 2051e37..18623e9 100644 --- a/cacic-daemon/cacicD/cacictimer.h +++ b/cacic-daemon/cacicD/cacictimer.h @@ -18,6 +18,7 @@ class CacicTimer : public QObject Q_OBJECT public: CacicTimer(QString dirpath); + ~CacicTimer(); QTimer *timer; CacicComm *OCacicComm; CACIC_Computer OCacic_Computer; @@ -26,15 +27,12 @@ public: void iniciarTimer(int x); bool getTest(); bool getConfig(); - bool compararHashMD5(QJsonDocument getconfigfile,QJsonDocument getConfig); bool Md5IsEqual(QVariant document01,QVariant document02); - QString getApplicationDirPath() const; void setApplicationDirPath(const QString &value); - QString getApplicationDirPath() const; void setDirProgram(const QString &value); private: - void registraFim(); + void registraFim(QString msg); void registraInicio(); QLogger::QLoggerManager *logManager; QString dirProgram; @@ -43,10 +41,8 @@ private: QString getDirProgram() const; void iniciarGercols(); void iniciarInstancias(); - void definirDirGercols(QString applicationDirPath); + void definirDirGercols(QString appDirPath); QJsonObject jsonConfig; - QLogger::QLoggerManager *logManager; - QString applicationDirPath; QString metodoDownload; QMap moduleMap; // key = hash md5, value = nome do modulo diff --git a/src/cacic_comm.h b/src/cacic_comm.h index ea9f9a9..6c2c36d 100644 --- a/src/cacic_comm.h +++ b/src/cacic_comm.h @@ -62,7 +62,7 @@ public: if (isSsl){ url = urlSsl.isEmpty() ? "https://" + this->urlGerente + route : this->urlSsl + route; if (!url.isValid()){ - jsonObj["error"] = QVariant("Invalid Url"); + jsonObj["error"] = QVariant("Invalid Url").toJsonValue(); return jsonObj; } req.setSslConfiguration(QSslConfiguration::defaultConfiguration()); -- libgit2 0.21.2