From c36484de2dc2ac558247dc90db9ab115935d270a Mon Sep 17 00:00:00 2001 From: Ladislav Foldyna Date: Mon, 16 Dec 2024 10:47:23 +0100 Subject: [PATCH] Notification: Code tunning --- core/NetworkNotification.cpp | 7 +------ core/NetworkNotification.h | 4 ++++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/core/NetworkNotification.cpp b/core/NetworkNotification.cpp index 8c031be6..ce809128 100644 --- a/core/NetworkNotification.cpp +++ b/core/NetworkNotification.cpp @@ -1,5 +1,4 @@ #include -#include #include "NetworkNotification.h" #include "debug.h" @@ -251,17 +250,13 @@ void NetworkNotification::send(const QByteArray &data, const HostsPortString &de qCDebug(function_parameters) << QString(data); - if ( data.size() <= 0 ) - { + if ( data.isEmpty() ) return; - } const QList &addrList = dests.getAddrList(); for ( const HostPortAddress &addr : addrList ) { - QUdpSocket udpSocket; - qCDebug(runtime) << "Sending to " << addr; udpSocket.writeDatagram(data, addr, addr.getPort()); } diff --git a/core/NetworkNotification.h b/core/NetworkNotification.h index 8ee85680..da3e01e7 100644 --- a/core/NetworkNotification.h +++ b/core/NetworkNotification.h @@ -5,6 +5,8 @@ #include #include #include +#include + #include "core/HostsPortString.h" #include "logformat/LogFormat.h" #include "data/DxSpot.h" @@ -155,6 +157,8 @@ public slots: private: + QUdpSocket udpSocket; + void send(const QByteArray &, const HostsPortString &); static QString CONFIG_NOTIF_QSO_ADI_ADDRS_KEY;