diff --git a/src/pws2mqtt.cpp b/src/pws2mqtt.cpp index d3f78a2..16658a9 100644 --- a/src/pws2mqtt.cpp +++ b/src/pws2mqtt.cpp @@ -173,7 +173,7 @@ void notify(QString notif, QString priority, QString inputPath, QString tag) request.setRawHeader("Firebase", "no"); QNetworkReply *reply = manager->post(request, notif.toUtf8()); - QObject::connect(reply, &QNetworkReply::finished, [manager, reply]() + QObject::connect(reply, &QNetworkReply::finished, [ manager, reply]() { if (reply->error() != QNetworkReply::NoError) { @@ -183,11 +183,10 @@ void notify(QString notif, QString priority, QString inputPath, QString tag) debug(DEBUGMACRO, "Notification envoyée", INFO); } reply->deleteLater(); + delete(manager); }); - delete(manager); } - void Pws2mqtt::listeningHttp() { //QByteArray data; @@ -580,7 +579,9 @@ void Pws2mqtt::parseData(QList> queryList) debug(DEBUGMACRO, "looping to fill notif", DEBUG); QTime currentTime = QTime::currentTime(); - if ((currentTime.minute() == 0 and currentTime.second() <= 30)or start == false) + debug(DEBUGMACRO, "current time : " + QByteArray::number(currentTime.minute()),DEBUG); + + if ((currentTime.minute() == 0 and currentTime.second() <= 35) or start == false) { timer = QDateTime::currentDateTime(); start = true; @@ -593,7 +594,7 @@ void Pws2mqtt::parseData(QList> queryList) notify (notif, priorityList[aPriority], "", tag); debug(DEBUGMACRO, "calling notify with notif = #" + notif + "#", INFO); } - /*if (aPriority >= 3) + /*f (aPriority >= 3) { notif = "**ALERTES**\n" + listProperties2notify (precPropertyList, propertyList, priority, 3); precPropertyList = propertyList;