From 4111c967e9a0fab6e0e07bc1484558f456259968 Mon Sep 17 00:00:00 2001 From: f4exb Date: Wed, 23 Mar 2022 22:32:23 +0100 Subject: [PATCH] Fixed some signal/slot connects. Removed unnecessary m_channelMessageQueue in ChannelAPI. Fixes #1185 --- .../beamsteeringcwmod/beamsteeringcwmod.cpp | 14 ++++++++-- .../interferometer/interferometer.cpp | 14 ++++++++-- plugins/channelrx/chanalyzer/chanalyzer.cpp | 14 ++++++++-- plugins/channelrx/demodadsb/adsbdemod.cpp | 14 ++++++++-- plugins/channelrx/demodadsb/adsbdemodgui.cpp | 9 +++++-- plugins/channelrx/demodais/aisdemod.cpp | 27 +++++++++---------- plugins/channelrx/demodais/aisdemod.h | 1 - plugins/channelrx/demodam/amdemod.cpp | 27 +++++++++---------- plugins/channelrx/demodam/amdemod.h | 1 - plugins/channelrx/demodapt/aptdemod.cpp | 14 ++++++++-- plugins/channelrx/demodbfm/bfmdemod.cpp | 14 ++++++++-- plugins/channelrx/demoddab/dabdemod.cpp | 27 +++++++++---------- plugins/channelrx/demoddab/dabdemod.h | 1 - plugins/channelrx/demoddatv/datvdemod.cpp | 14 ++++++++-- plugins/channelrx/demoddsd/dsddemod.cpp | 27 +++++++++---------- plugins/channelrx/demoddsd/dsddemod.h | 1 - plugins/channelrx/demodfreedv/freedvdemod.cpp | 14 ++++++++-- plugins/channelrx/demodnfm/nfmdemod.cpp | 27 +++++++++---------- plugins/channelrx/demodnfm/nfmdemod.h | 1 - plugins/channelrx/demodpacket/packetdemod.cpp | 27 +++++++++---------- plugins/channelrx/demodpacket/packetdemod.h | 1 - plugins/channelrx/demodpager/pagerdemod.cpp | 27 +++++++++---------- plugins/channelrx/demodpager/pagerdemod.h | 1 - .../demodradiosonde/radiosondedemod.cpp | 27 +++++++++---------- .../demodradiosonde/radiosondedemod.h | 1 - plugins/channelrx/demodssb/ssbdemod.cpp | 27 +++++++++---------- plugins/channelrx/demodssb/ssbdemod.h | 1 - plugins/channelrx/demodvor/vordemod.cpp | 14 ++++++++-- plugins/channelrx/demodvorsc/vordemodsc.cpp | 14 ++++++++-- plugins/channelrx/demodwfm/wfmdemod.cpp | 27 +++++++++---------- plugins/channelrx/demodwfm/wfmdemod.h | 1 - plugins/channelrx/filesink/filesink.cpp | 14 ++++++++-- plugins/channelrx/freqtracker/freqtracker.cpp | 14 ++++++++-- plugins/channelrx/localsink/localsink.cpp | 14 ++++++++-- plugins/channelrx/noisefigure/noisefigure.cpp | 14 ++++++++-- .../radioastronomy/radioastronomy.cpp | 27 +++++++++---------- .../channelrx/radioastronomy/radioastronomy.h | 1 - .../radioastronomy/radioastronomygui.cpp | 7 ++++- plugins/channelrx/radioclock/radioclock.cpp | 14 ++++++++-- plugins/channelrx/remotesink/remotesink.cpp | 14 ++++++++-- .../channelrx/sigmffilesink/sigmffilesink.cpp | 14 ++++++++-- plugins/channelrx/udpsink/udpsink.cpp | 14 ++++++++-- plugins/channeltx/filesource/filesource.cpp | 14 ++++++++-- plugins/channeltx/localsource/localsource.cpp | 14 ++++++++-- .../mod802.15.4/ieee_802_15_4_mod.cpp | 14 ++++++++-- plugins/channeltx/modais/aismod.cpp | 27 +++++++++---------- plugins/channeltx/modais/aismod.h | 1 - plugins/channeltx/modam/ammod.cpp | 27 +++++++++---------- plugins/channeltx/modam/ammod.h | 1 - plugins/channeltx/modatv/atvmod.cpp | 14 ++++++++-- .../channeltx/modchirpchat/chirpchatmod.cpp | 14 ++++++++-- plugins/channeltx/moddatv/datvmod.cpp | 14 ++++++++-- plugins/channeltx/modfreedv/freedvmod.cpp | 14 ++++++++-- plugins/channeltx/modnfm/nfmmod.cpp | 27 +++++++++---------- plugins/channeltx/modnfm/nfmmod.h | 1 - plugins/channeltx/modpacket/packetmod.cpp | 27 +++++++++---------- plugins/channeltx/modpacket/packetmod.h | 1 - plugins/channeltx/modssb/ssbmod.cpp | 27 +++++++++---------- plugins/channeltx/modssb/ssbmod.h | 1 - plugins/channeltx/modwfm/wfmmod.cpp | 27 +++++++++---------- plugins/channeltx/modwfm/wfmmod.h | 1 - .../channeltx/remotesource/remotesource.cpp | 14 ++++++++-- plugins/channeltx/udpsource/udpsource.cpp | 14 ++++++++-- plugins/feature/afc/afc.cpp | 14 ++++++++-- plugins/feature/ais/ais.cpp | 14 ++++++++-- plugins/feature/antennatools/antennatools.cpp | 14 ++++++++-- plugins/feature/aprs/aprs.cpp | 14 ++++++++-- .../feature/demodanalyzer/demodanalyzer.cpp | 14 ++++++++-- .../gs232controller/gs232controller.cpp | 14 ++++++++-- .../jogdialcontroller/jogdialcontroller.cpp | 14 ++++++++-- plugins/feature/map/map.cpp | 14 ++++++++-- plugins/feature/pertester/pertester.cpp | 14 ++++++++-- plugins/feature/radiosonde/radiosonde.cpp | 16 ++++++++--- plugins/feature/rigctlserver/rigctlserver.cpp | 14 ++++++++-- .../satelliteselectiondialog.cpp | 7 ++++- .../satellitetracker/satellitetracker.cpp | 7 ++++- plugins/feature/simpleptt/simpleptt.cpp | 14 ++++++++-- plugins/feature/startracker/startracker.cpp | 14 ++++++++-- .../feature/startracker/startrackergui.cpp | 14 ++++++++-- plugins/feature/vorlocalizer/vorlocalizer.cpp | 14 ++++++++-- .../samplemimo/bladerf2mimo/bladerf2mimo.cpp | 14 ++++++++-- .../samplemimo/limesdrmimo/limesdrmimo.cpp | 14 ++++++++-- plugins/samplemimo/metismiso/metismiso.cpp | 14 ++++++++-- .../samplemimo/plutosdrmimo/plutosdrmimo.cpp | 14 ++++++++-- plugins/samplemimo/testmi/testmi.cpp | 14 ++++++++-- plugins/samplemimo/xtrxmimo/xtrxmimo.cpp | 14 ++++++++-- .../bladerf1output/bladerf1output.cpp | 16 ++++++++--- .../bladerf2output/bladerf2output.cpp | 14 ++++++++-- .../samplesink/hackrfoutput/hackrfoutput.cpp | 14 ++++++++-- .../limesdroutput/limesdroutput.cpp | 14 ++++++++-- .../samplesink/localoutput/localoutput.cpp | 14 ++++++++-- .../samplesink/localoutput/localoutputgui.cpp | 5 ---- .../samplesink/localoutput/localoutputgui.h | 5 ---- .../plutosdroutput/plutosdroutput.cpp | 14 ++++++++-- .../samplesink/remoteoutput/remoteoutput.cpp | 14 ++++++++-- .../soapysdroutput/soapysdroutput.cpp | 14 ++++++++-- plugins/samplesink/usrpoutput/usrpoutput.cpp | 14 ++++++++-- plugins/samplesink/xtrxoutput/xtrxoutput.cpp | 14 ++++++++-- plugins/samplesource/airspy/airspyinput.cpp | 14 ++++++++-- .../samplesource/airspyhf/airspyhfinput.cpp | 14 ++++++++-- .../samplesource/audioinput/audioinput.cpp | 14 ++++++++-- .../bladerf1input/bladerf1input.cpp | 14 ++++++++-- .../bladerf2input/bladerf2input.cpp | 14 ++++++++-- plugins/samplesource/fcdpro/fcdproinput.cpp | 14 ++++++++-- .../fcdproplus/fcdproplusinput.cpp | 14 ++++++++-- plugins/samplesource/fileinput/fileinput.cpp | 14 ++++++++-- .../samplesource/hackrfinput/hackrfinput.cpp | 14 ++++++++-- plugins/samplesource/kiwisdr/kiwisdrinput.cpp | 14 ++++++++-- .../limesdrinput/limesdrinput.cpp | 14 ++++++++-- .../samplesource/localinput/localinput.cpp | 14 ++++++++-- .../samplesource/localinput/localinputgui.cpp | 5 ---- .../samplesource/localinput/localinputgui.h | 5 ---- plugins/samplesource/perseus/perseusinput.cpp | 14 ++++++++-- .../plutosdrinput/plutosdrinput.cpp | 14 ++++++++-- .../samplesource/remoteinput/remoteinput.cpp | 14 ++++++++-- plugins/samplesource/rtlsdr/rtlsdrinput.cpp | 14 ++++++++-- plugins/samplesource/sdrplay/sdrplayinput.cpp | 14 ++++++++-- .../samplesource/sdrplayv3/sdrplayv3input.cpp | 14 ++++++++-- .../sigmffileinput/sigmffileinput.cpp | 14 ++++++++-- .../soapysdrinput/soapysdrinput.cpp | 14 ++++++++-- .../testsource/testsourceinput.cpp | 14 ++++++++-- plugins/samplesource/usrpinput/usrpinput.cpp | 14 ++++++++-- plugins/samplesource/xtrxinput/xtrxinput.cpp | 14 ++++++++-- sdrbase/channel/channelapi.h | 3 +-- sdrbase/util/flightinformation.cpp | 14 ++++++++-- sdrbase/util/planespotters.cpp | 14 ++++++++-- sdrbase/util/weather.cpp | 14 ++++++++-- 127 files changed, 1240 insertions(+), 469 deletions(-) diff --git a/plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmod.cpp b/plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmod.cpp index d2a4269a9..cd21f50b5 100644 --- a/plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmod.cpp +++ b/plugins/channelmimo/beamsteeringcwmod/beamsteeringcwmod.cpp @@ -56,12 +56,22 @@ BeamSteeringCWMod::BeamSteeringCWMod(DeviceAPI *deviceAPI) : connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &BeamSteeringCWMod::networkManagerFinished + ); } BeamSteeringCWMod::~BeamSteeringCWMod() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &BeamSteeringCWMod::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); diff --git a/plugins/channelmimo/interferometer/interferometer.cpp b/plugins/channelmimo/interferometer/interferometer.cpp index dd5b13122..17e06f543 100644 --- a/plugins/channelmimo/interferometer/interferometer.cpp +++ b/plugins/channelmimo/interferometer/interferometer.cpp @@ -58,12 +58,22 @@ Interferometer::Interferometer(DeviceAPI *deviceAPI) : connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &Interferometer::networkManagerFinished + ); } Interferometer::~Interferometer() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &Interferometer::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); diff --git a/plugins/channelrx/chanalyzer/chanalyzer.cpp b/plugins/channelrx/chanalyzer/chanalyzer.cpp index a54c56203..d009a329b 100644 --- a/plugins/channelrx/chanalyzer/chanalyzer.cpp +++ b/plugins/channelrx/chanalyzer/chanalyzer.cpp @@ -56,7 +56,12 @@ ChannelAnalyzer::ChannelAnalyzer(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSinkAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &ChannelAnalyzer::networkManagerFinished + ); QObject::connect( this, &ChannelAPI::indexInDeviceSetChanged, @@ -68,7 +73,12 @@ ChannelAnalyzer::ChannelAnalyzer(DeviceAPI *deviceAPI) : ChannelAnalyzer::~ChannelAnalyzer() { qDebug("ChannelAnalyzer::~ChannelAnalyzer"); - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &ChannelAnalyzer::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); diff --git a/plugins/channelrx/demodadsb/adsbdemod.cpp b/plugins/channelrx/demodadsb/adsbdemod.cpp index 7ff105653..fb07a85f6 100644 --- a/plugins/channelrx/demodadsb/adsbdemod.cpp +++ b/plugins/channelrx/demodadsb/adsbdemod.cpp @@ -76,7 +76,12 @@ ADSBDemod::ADSBDemod(DeviceAPI *devieAPI) : m_deviceAPI->addChannelSinkAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &ADSBDemod::networkManagerFinished + ); QObject::connect( this, &ChannelAPI::indexInDeviceSetChanged, @@ -90,7 +95,12 @@ ADSBDemod::~ADSBDemod() if (m_worker->isRunning()) { stop(); } - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &ADSBDemod::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); m_deviceAPI->removeChannelSink(this); diff --git a/plugins/channelrx/demodadsb/adsbdemodgui.cpp b/plugins/channelrx/demodadsb/adsbdemodgui.cpp index c35cb26f5..37c8297bb 100644 --- a/plugins/channelrx/demodadsb/adsbdemodgui.cpp +++ b/plugins/channelrx/demodadsb/adsbdemodgui.cpp @@ -2828,7 +2828,7 @@ void ADSBDemodGUI::updateDeviceSetList() { if (m_settings.m_deviceIndex < 0) { ui->device->setCurrentIndex(0); - } else if (m_settings.m_deviceIndex >= deviceUISets.size()) { + } else if (m_settings.m_deviceIndex >= (int) deviceUISets.size()) { ui->device->setCurrentIndex(deviceUISets.size() - 1); } else { ui->device->setCurrentIndex(m_settings.m_deviceIndex); @@ -3827,7 +3827,12 @@ ADSBDemodGUI::ADSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseb connect(&m_importTimer, &QTimer::timeout, this, &ADSBDemodGUI::import); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(handleImportReply(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &ADSBDemodGUI::handleImportReply + ); applyImportSettings(); connect(&m_redrawMapTimer, &QTimer::timeout, this, &ADSBDemodGUI::redrawMap); diff --git a/plugins/channelrx/demodais/aisdemod.cpp b/plugins/channelrx/demodais/aisdemod.cpp index 527587d08..df7c9e779 100644 --- a/plugins/channelrx/demodais/aisdemod.cpp +++ b/plugins/channelrx/demodais/aisdemod.cpp @@ -63,8 +63,12 @@ AISDemod::AISDemod(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSinkAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); - connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages())); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &AISDemod::networkManagerFinished + ); QObject::connect( this, &ChannelAPI::indexInDeviceSetChanged, @@ -76,7 +80,12 @@ AISDemod::AISDemod(DeviceAPI *deviceAPI) : AISDemod::~AISDemod() { qDebug("AISDemod::~AISDemod"); - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &AISDemod::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); m_deviceAPI->removeChannelSink(this); @@ -691,18 +700,6 @@ void AISDemod::networkManagerFinished(QNetworkReply *reply) reply->deleteLater(); } -void AISDemod::handleChannelMessages() -{ - Message* message; - - while ((message = m_channelMessageQueue.pop()) != nullptr) - { - if (handleMessage(*message)) { - delete message; - } - } -} - void AISDemod::handleIndexInDeviceSetChanged(int index) { if (index < 0) { diff --git a/plugins/channelrx/demodais/aisdemod.h b/plugins/channelrx/demodais/aisdemod.h index 00e455b16..51eae9fde 100644 --- a/plugins/channelrx/demodais/aisdemod.h +++ b/plugins/channelrx/demodais/aisdemod.h @@ -182,7 +182,6 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); - void handleChannelMessages(); void handleIndexInDeviceSetChanged(int index); }; diff --git a/plugins/channelrx/demodam/amdemod.cpp b/plugins/channelrx/demodam/amdemod.cpp index 8e7074d1b..2bbfbd814 100644 --- a/plugins/channelrx/demodam/amdemod.cpp +++ b/plugins/channelrx/demodam/amdemod.cpp @@ -65,8 +65,12 @@ AMDemod::AMDemod(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSinkAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); - connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages())); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &AMDemod::networkManagerFinished + ); // Experimental: // QObject::connect( // m_deviceAPI->getSampleSource()->getSampleFifo(), @@ -92,7 +96,12 @@ AMDemod::~AMDemod() // this, // &AMDemod::handleWrittenToFifo // ); - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &AMDemod::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); m_deviceAPI->removeChannelSink(this); @@ -656,18 +665,6 @@ void AMDemod::networkManagerFinished(QNetworkReply *reply) reply->deleteLater(); } -void AMDemod::handleChannelMessages() -{ - Message* message; - - while ((message = m_channelMessageQueue.pop()) != nullptr) - { - if (handleMessage(*message)) { - delete message; - } - } -} - void AMDemod::handleWrittenToFifo(int nsamples, qint64 timestamp) { QDateTime dt; diff --git a/plugins/channelrx/demodam/amdemod.h b/plugins/channelrx/demodam/amdemod.h index 0a7d66064..7e17aa6ed 100644 --- a/plugins/channelrx/demodam/amdemod.h +++ b/plugins/channelrx/demodam/amdemod.h @@ -162,7 +162,6 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); - void handleChannelMessages(); void handleWrittenToFifo(int nsamples, qint64 timestamp); void handleIndexInDeviceSetChanged(int index); }; diff --git a/plugins/channelrx/demodapt/aptdemod.cpp b/plugins/channelrx/demodapt/aptdemod.cpp index 96c9752d9..7e0380edb 100644 --- a/plugins/channelrx/demodapt/aptdemod.cpp +++ b/plugins/channelrx/demodapt/aptdemod.cpp @@ -73,7 +73,12 @@ APTDemod::APTDemod(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSinkAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &APTDemod::networkManagerFinished + ); QObject::connect( this, &ChannelAPI::indexInDeviceSetChanged, @@ -87,7 +92,12 @@ APTDemod::APTDemod(DeviceAPI *deviceAPI) : APTDemod::~APTDemod() { qDebug("APTDemod::~APTDemod"); - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &APTDemod::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); m_deviceAPI->removeChannelSink(this); diff --git a/plugins/channelrx/demodbfm/bfmdemod.cpp b/plugins/channelrx/demodbfm/bfmdemod.cpp index 7252b970d..64d8fad7c 100644 --- a/plugins/channelrx/demodbfm/bfmdemod.cpp +++ b/plugins/channelrx/demodbfm/bfmdemod.cpp @@ -66,7 +66,12 @@ BFMDemod::BFMDemod(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSinkAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &BFMDemod::networkManagerFinished + ); QObject::connect( this, &ChannelAPI::indexInDeviceSetChanged, @@ -77,7 +82,12 @@ BFMDemod::BFMDemod(DeviceAPI *deviceAPI) : BFMDemod::~BFMDemod() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &BFMDemod::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); diff --git a/plugins/channelrx/demoddab/dabdemod.cpp b/plugins/channelrx/demoddab/dabdemod.cpp index 844dae274..245ccfb47 100644 --- a/plugins/channelrx/demoddab/dabdemod.cpp +++ b/plugins/channelrx/demoddab/dabdemod.cpp @@ -74,8 +74,12 @@ DABDemod::DABDemod(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSinkAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); - connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages())); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &DABDemod::networkManagerFinished + ); QObject::connect( this, &ChannelAPI::indexInDeviceSetChanged, @@ -87,7 +91,12 @@ DABDemod::DABDemod(DeviceAPI *deviceAPI) : DABDemod::~DABDemod() { qDebug("DABDemod::~DABDemod"); - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &DABDemod::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); m_deviceAPI->removeChannelSink(this); @@ -646,18 +655,6 @@ void DABDemod::networkManagerFinished(QNetworkReply *reply) reply->deleteLater(); } -void DABDemod::handleChannelMessages() -{ - Message* message; - - while ((message = m_channelMessageQueue.pop()) != nullptr) - { - if (handleMessage(*message)) { - delete message; - } - } -} - void DABDemod::handleIndexInDeviceSetChanged(int index) { if (index < 0) { diff --git a/plugins/channelrx/demoddab/dabdemod.h b/plugins/channelrx/demoddab/dabdemod.h index 71c4f8348..078a7cecb 100644 --- a/plugins/channelrx/demoddab/dabdemod.h +++ b/plugins/channelrx/demoddab/dabdemod.h @@ -399,7 +399,6 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); - void handleChannelMessages(); void handleIndexInDeviceSetChanged(int index); }; diff --git a/plugins/channelrx/demoddatv/datvdemod.cpp b/plugins/channelrx/demoddatv/datvdemod.cpp index d010a513b..b1c67c74d 100644 --- a/plugins/channelrx/demoddatv/datvdemod.cpp +++ b/plugins/channelrx/demoddatv/datvdemod.cpp @@ -54,7 +54,12 @@ DATVDemod::DATVDemod(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSinkAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &DATVDemod::networkManagerFinished + ); QObject::connect( this, &ChannelAPI::indexInDeviceSetChanged, @@ -66,7 +71,12 @@ DATVDemod::DATVDemod(DeviceAPI *deviceAPI) : DATVDemod::~DATVDemod() { qDebug("DATVDemod::~DATVDemod"); - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &DATVDemod::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); m_deviceAPI->removeChannelSink(this); diff --git a/plugins/channelrx/demoddsd/dsddemod.cpp b/plugins/channelrx/demoddsd/dsddemod.cpp index ab6057cf1..05e75178a 100644 --- a/plugins/channelrx/demoddsd/dsddemod.cpp +++ b/plugins/channelrx/demoddsd/dsddemod.cpp @@ -69,8 +69,12 @@ DSDDemod::DSDDemod(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSinkAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); - connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages())); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &DSDDemod::networkManagerFinished + ); QObject::connect( this, &ChannelAPI::indexInDeviceSetChanged, @@ -81,7 +85,12 @@ DSDDemod::DSDDemod(DeviceAPI *deviceAPI) : DSDDemod::~DSDDemod() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &DSDDemod::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); m_deviceAPI->removeChannelSink(this); @@ -746,18 +755,6 @@ void DSDDemod::networkManagerFinished(QNetworkReply *reply) reply->deleteLater(); } -void DSDDemod::handleChannelMessages() -{ - Message* message; - - while ((message = m_channelMessageQueue.pop()) != nullptr) - { - if (handleMessage(*message)) { - delete message; - } - } -} - void DSDDemod::handleIndexInDeviceSetChanged(int index) { if (index < 0) { diff --git a/plugins/channelrx/demoddsd/dsddemod.h b/plugins/channelrx/demoddsd/dsddemod.h index ca8414637..0d656f64e 100644 --- a/plugins/channelrx/demoddsd/dsddemod.h +++ b/plugins/channelrx/demoddsd/dsddemod.h @@ -159,7 +159,6 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); - void handleChannelMessages(); void handleIndexInDeviceSetChanged(int index); }; diff --git a/plugins/channelrx/demodfreedv/freedvdemod.cpp b/plugins/channelrx/demodfreedv/freedvdemod.cpp index e6dac1894..e8e92b373 100644 --- a/plugins/channelrx/demodfreedv/freedvdemod.cpp +++ b/plugins/channelrx/demodfreedv/freedvdemod.cpp @@ -60,7 +60,12 @@ FreeDVDemod::FreeDVDemod(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSinkAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &FreeDVDemod::networkManagerFinished + ); QObject::connect( this, &ChannelAPI::indexInDeviceSetChanged, @@ -71,7 +76,12 @@ FreeDVDemod::FreeDVDemod(DeviceAPI *deviceAPI) : FreeDVDemod::~FreeDVDemod() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &FreeDVDemod::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); m_deviceAPI->removeChannelSink(this); diff --git a/plugins/channelrx/demodnfm/nfmdemod.cpp b/plugins/channelrx/demodnfm/nfmdemod.cpp index 3757497be..b73140806 100644 --- a/plugins/channelrx/demodnfm/nfmdemod.cpp +++ b/plugins/channelrx/demodnfm/nfmdemod.cpp @@ -73,8 +73,12 @@ NFMDemod::NFMDemod(DeviceAPI *devieAPI) : m_deviceAPI->addChannelSinkAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); - connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages())); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &NFMDemod::networkManagerFinished + ); QObject::connect( this, &ChannelAPI::indexInDeviceSetChanged, @@ -85,7 +89,12 @@ NFMDemod::NFMDemod(DeviceAPI *devieAPI) : NFMDemod::~NFMDemod() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &NFMDemod::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); m_deviceAPI->removeChannelSink(this); @@ -688,18 +697,6 @@ void NFMDemod::networkManagerFinished(QNetworkReply *reply) reply->deleteLater(); } -void NFMDemod::handleChannelMessages() -{ - Message* message; - - while ((message = m_channelMessageQueue.pop()) != nullptr) - { - if (handleMessage(*message)) { - delete message; - } - } -} - void NFMDemod::handleIndexInDeviceSetChanged(int index) { if (index < 0) { diff --git a/plugins/channelrx/demodnfm/nfmdemod.h b/plugins/channelrx/demodnfm/nfmdemod.h index 158319e90..1761702f6 100644 --- a/plugins/channelrx/demodnfm/nfmdemod.h +++ b/plugins/channelrx/demodnfm/nfmdemod.h @@ -159,7 +159,6 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); - void handleChannelMessages(); void handleIndexInDeviceSetChanged(int index); }; diff --git a/plugins/channelrx/demodpacket/packetdemod.cpp b/plugins/channelrx/demodpacket/packetdemod.cpp index 929cec556..bdfc85c80 100644 --- a/plugins/channelrx/demodpacket/packetdemod.cpp +++ b/plugins/channelrx/demodpacket/packetdemod.cpp @@ -65,8 +65,12 @@ PacketDemod::PacketDemod(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSinkAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); - connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages())); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &PacketDemod::networkManagerFinished + ); QObject::connect( this, &ChannelAPI::indexInDeviceSetChanged, @@ -78,7 +82,12 @@ PacketDemod::PacketDemod(DeviceAPI *deviceAPI) : PacketDemod::~PacketDemod() { qDebug("PacketDemod::~PacketDemod"); - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &PacketDemod::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); m_deviceAPI->removeChannelSink(this); @@ -676,18 +685,6 @@ void PacketDemod::networkManagerFinished(QNetworkReply *reply) reply->deleteLater(); } -void PacketDemod::handleChannelMessages() -{ - Message* message; - - while ((message = m_channelMessageQueue.pop()) != nullptr) - { - if (handleMessage(*message)) { - delete message; - } - } -} - void PacketDemod::handleIndexInDeviceSetChanged(int index) { if (index < 0) { diff --git a/plugins/channelrx/demodpacket/packetdemod.h b/plugins/channelrx/demodpacket/packetdemod.h index 21fc83ec7..b2ca037ba 100644 --- a/plugins/channelrx/demodpacket/packetdemod.h +++ b/plugins/channelrx/demodpacket/packetdemod.h @@ -160,7 +160,6 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); - void handleChannelMessages(); void handleIndexInDeviceSetChanged(int index); }; diff --git a/plugins/channelrx/demodpager/pagerdemod.cpp b/plugins/channelrx/demodpager/pagerdemod.cpp index f802e517a..773acc50d 100644 --- a/plugins/channelrx/demodpager/pagerdemod.cpp +++ b/plugins/channelrx/demodpager/pagerdemod.cpp @@ -58,8 +58,12 @@ PagerDemod::PagerDemod(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSinkAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); - connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages())); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &PagerDemod::networkManagerFinished + ); QObject::connect( this, &ChannelAPI::indexInDeviceSetChanged, @@ -71,7 +75,12 @@ PagerDemod::PagerDemod(DeviceAPI *deviceAPI) : PagerDemod::~PagerDemod() { qDebug("PagerDemod::~PagerDemod"); - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &PagerDemod::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); m_deviceAPI->removeChannelSink(this); @@ -690,18 +699,6 @@ void PagerDemod::networkManagerFinished(QNetworkReply *reply) reply->deleteLater(); } -void PagerDemod::handleChannelMessages() -{ - Message* message; - - while ((message = m_channelMessageQueue.pop()) != nullptr) - { - if (handleMessage(*message)) { - delete message; - } - } -} - void PagerDemod::handleIndexInDeviceSetChanged(int index) { if (index < 0) { diff --git a/plugins/channelrx/demodpager/pagerdemod.h b/plugins/channelrx/demodpager/pagerdemod.h index 2c6ce0add..378f34c0f 100644 --- a/plugins/channelrx/demodpager/pagerdemod.h +++ b/plugins/channelrx/demodpager/pagerdemod.h @@ -216,7 +216,6 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); - void handleChannelMessages(); void handleIndexInDeviceSetChanged(int index); }; diff --git a/plugins/channelrx/demodradiosonde/radiosondedemod.cpp b/plugins/channelrx/demodradiosonde/radiosondedemod.cpp index e3f508bc6..36fe6a1ab 100644 --- a/plugins/channelrx/demodradiosonde/radiosondedemod.cpp +++ b/plugins/channelrx/demodradiosonde/radiosondedemod.cpp @@ -62,8 +62,12 @@ RadiosondeDemod::RadiosondeDemod(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSinkAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); - connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages())); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &RadiosondeDemod::networkManagerFinished + ); QObject::connect( this, &ChannelAPI::indexInDeviceSetChanged, @@ -75,7 +79,12 @@ RadiosondeDemod::RadiosondeDemod(DeviceAPI *deviceAPI) : RadiosondeDemod::~RadiosondeDemod() { qDebug("RadiosondeDemod::~RadiosondeDemod"); - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &RadiosondeDemod::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); m_deviceAPI->removeChannelSink(this); @@ -708,18 +717,6 @@ void RadiosondeDemod::networkManagerFinished(QNetworkReply *reply) reply->deleteLater(); } -void RadiosondeDemod::handleChannelMessages() -{ - Message* message; - - while ((message = m_channelMessageQueue.pop()) != nullptr) - { - if (handleMessage(*message)) { - delete message; - } - } -} - void RadiosondeDemod::handleIndexInDeviceSetChanged(int index) { if (index < 0) { diff --git a/plugins/channelrx/demodradiosonde/radiosondedemod.h b/plugins/channelrx/demodradiosonde/radiosondedemod.h index d38ea105c..c3f164402 100644 --- a/plugins/channelrx/demodradiosonde/radiosondedemod.h +++ b/plugins/channelrx/demodradiosonde/radiosondedemod.h @@ -189,7 +189,6 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); - void handleChannelMessages(); void handleIndexInDeviceSetChanged(int index); }; diff --git a/plugins/channelrx/demodssb/ssbdemod.cpp b/plugins/channelrx/demodssb/ssbdemod.cpp index f5e40d4c8..658b03e2c 100644 --- a/plugins/channelrx/demodssb/ssbdemod.cpp +++ b/plugins/channelrx/demodssb/ssbdemod.cpp @@ -67,8 +67,12 @@ SSBDemod::SSBDemod(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSinkAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); - connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages())); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &SSBDemod::networkManagerFinished + ); QObject::connect( this, &ChannelAPI::indexInDeviceSetChanged, @@ -79,7 +83,12 @@ SSBDemod::SSBDemod(DeviceAPI *deviceAPI) : SSBDemod::~SSBDemod() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &SSBDemod::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); m_deviceAPI->removeChannelSink(this); @@ -728,18 +737,6 @@ void SSBDemod::networkManagerFinished(QNetworkReply *reply) reply->deleteLater(); } -void SSBDemod::handleChannelMessages() -{ - Message* message; - - while ((message = m_channelMessageQueue.pop()) != nullptr) - { - if (handleMessage(*message)) { - delete message; - } - } -} - void SSBDemod::handleIndexInDeviceSetChanged(int index) { if (index < 0) { diff --git a/plugins/channelrx/demodssb/ssbdemod.h b/plugins/channelrx/demodssb/ssbdemod.h index 8927d9bd3..440f17a25 100644 --- a/plugins/channelrx/demodssb/ssbdemod.h +++ b/plugins/channelrx/demodssb/ssbdemod.h @@ -163,7 +163,6 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); - void handleChannelMessages(); void handleIndexInDeviceSetChanged(int index); }; diff --git a/plugins/channelrx/demodvor/vordemod.cpp b/plugins/channelrx/demodvor/vordemod.cpp index 02417e0b3..e81f613c7 100644 --- a/plugins/channelrx/demodvor/vordemod.cpp +++ b/plugins/channelrx/demodvor/vordemod.cpp @@ -62,7 +62,12 @@ VORDemod::VORDemod(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSinkAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &VORDemod::networkManagerFinished + ); QObject::connect( this, &ChannelAPI::indexInDeviceSetChanged, @@ -74,7 +79,12 @@ VORDemod::VORDemod(DeviceAPI *deviceAPI) : VORDemod::~VORDemod() { qDebug("VORDemod::~VORDemod"); - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &VORDemod::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); m_deviceAPI->removeChannelSink(this); diff --git a/plugins/channelrx/demodvorsc/vordemodsc.cpp b/plugins/channelrx/demodvorsc/vordemodsc.cpp index 92fac34be..a373394ba 100644 --- a/plugins/channelrx/demodvorsc/vordemodsc.cpp +++ b/plugins/channelrx/demodvorsc/vordemodsc.cpp @@ -64,7 +64,12 @@ VORDemodSC::VORDemodSC(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSinkAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &VORDemodSC::networkManagerFinished + ); QObject::connect( this, &ChannelAPI::indexInDeviceSetChanged, @@ -76,7 +81,12 @@ VORDemodSC::VORDemodSC(DeviceAPI *deviceAPI) : VORDemodSC::~VORDemodSC() { qDebug("VORDemodSC::~VORDemodSC"); - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &VORDemodSC::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); m_deviceAPI->removeChannelSink(this); diff --git a/plugins/channelrx/demodwfm/wfmdemod.cpp b/plugins/channelrx/demodwfm/wfmdemod.cpp index d92cb739c..c6c824f49 100644 --- a/plugins/channelrx/demodwfm/wfmdemod.cpp +++ b/plugins/channelrx/demodwfm/wfmdemod.cpp @@ -69,8 +69,12 @@ WFMDemod::WFMDemod(DeviceAPI* deviceAPI) : m_deviceAPI->addChannelSinkAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); - connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages())); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &WFMDemod::networkManagerFinished + ); QObject::connect( this, &ChannelAPI::indexInDeviceSetChanged, @@ -81,7 +85,12 @@ WFMDemod::WFMDemod(DeviceAPI* deviceAPI) : WFMDemod::~WFMDemod() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &WFMDemod::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); @@ -608,18 +617,6 @@ void WFMDemod::networkManagerFinished(QNetworkReply *reply) reply->deleteLater(); } -void WFMDemod::handleChannelMessages() -{ - Message* message; - - while ((message = m_channelMessageQueue.pop()) != nullptr) - { - if (handleMessage(*message)) { - delete message; - } - } -} - void WFMDemod::handleIndexInDeviceSetChanged(int index) { if (index < 0) { diff --git a/plugins/channelrx/demodwfm/wfmdemod.h b/plugins/channelrx/demodwfm/wfmdemod.h index f79792516..a14f56efa 100644 --- a/plugins/channelrx/demodwfm/wfmdemod.h +++ b/plugins/channelrx/demodwfm/wfmdemod.h @@ -155,7 +155,6 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); - void handleChannelMessages(); void handleIndexInDeviceSetChanged(int index); }; diff --git a/plugins/channelrx/filesink/filesink.cpp b/plugins/channelrx/filesink/filesink.cpp index e91e2f7b3..cc7c17a23 100644 --- a/plugins/channelrx/filesink/filesink.cpp +++ b/plugins/channelrx/filesink/filesink.cpp @@ -68,7 +68,12 @@ FileSink::FileSink(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSinkAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &FileSink::networkManagerFinished + ); QObject::connect( this, &ChannelAPI::indexInDeviceSetChanged, @@ -79,7 +84,12 @@ FileSink::FileSink(DeviceAPI *deviceAPI) : FileSink::~FileSink() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &FileSink::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); m_deviceAPI->removeChannelSink(this); diff --git a/plugins/channelrx/freqtracker/freqtracker.cpp b/plugins/channelrx/freqtracker/freqtracker.cpp index c9f10a543..d885a4c29 100644 --- a/plugins/channelrx/freqtracker/freqtracker.cpp +++ b/plugins/channelrx/freqtracker/freqtracker.cpp @@ -71,7 +71,12 @@ FreqTracker::FreqTracker(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSinkAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &FreqTracker::networkManagerFinished + ); QObject::connect( this, &ChannelAPI::indexInDeviceSetChanged, @@ -82,7 +87,12 @@ FreqTracker::FreqTracker(DeviceAPI *deviceAPI) : FreqTracker::~FreqTracker() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &FreqTracker::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); diff --git a/plugins/channelrx/localsink/localsink.cpp b/plugins/channelrx/localsink/localsink.cpp index 766d8ba9a..dd0db8cba 100644 --- a/plugins/channelrx/localsink/localsink.cpp +++ b/plugins/channelrx/localsink/localsink.cpp @@ -65,7 +65,12 @@ LocalSink::LocalSink(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSinkAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &LocalSink::networkManagerFinished + ); QObject::connect( this, &ChannelAPI::indexInDeviceSetChanged, @@ -76,7 +81,12 @@ LocalSink::LocalSink(DeviceAPI *deviceAPI) : LocalSink::~LocalSink() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &LocalSink::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); m_deviceAPI->removeChannelSink(this); diff --git a/plugins/channelrx/noisefigure/noisefigure.cpp b/plugins/channelrx/noisefigure/noisefigure.cpp index a00e0edef..4c6851bf0 100644 --- a/plugins/channelrx/noisefigure/noisefigure.cpp +++ b/plugins/channelrx/noisefigure/noisefigure.cpp @@ -76,7 +76,12 @@ NoiseFigure::NoiseFigure(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSinkAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &NoiseFigure::networkManagerFinished + ); QObject::connect( this, &ChannelAPI::indexInDeviceSetChanged, @@ -88,7 +93,12 @@ NoiseFigure::NoiseFigure(DeviceAPI *deviceAPI) : NoiseFigure::~NoiseFigure() { qDebug("NoiseFigure::~NoiseFigure"); - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &NoiseFigure::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); m_deviceAPI->removeChannelSink(this); diff --git a/plugins/channelrx/radioastronomy/radioastronomy.cpp b/plugins/channelrx/radioastronomy/radioastronomy.cpp index 1e2146c92..a530e3e71 100644 --- a/plugins/channelrx/radioastronomy/radioastronomy.cpp +++ b/plugins/channelrx/radioastronomy/radioastronomy.cpp @@ -89,8 +89,12 @@ RadioAstronomy::RadioAstronomy(DeviceAPI *deviceAPI) : m_updatePipesTimer.start(1000); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); - connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages())); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &RadioAstronomy::networkManagerFinished + ); QObject::connect( this, &ChannelAPI::indexInDeviceSetChanged, @@ -104,7 +108,12 @@ RadioAstronomy::RadioAstronomy(DeviceAPI *deviceAPI) : RadioAstronomy::~RadioAstronomy() { qDebug("RadioAstronomy::~RadioAstronomy"); - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &RadioAstronomy::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); m_deviceAPI->removeChannelSink(this); @@ -1179,18 +1188,6 @@ void RadioAstronomy::networkManagerFinished(QNetworkReply *reply) reply->deleteLater(); } -void RadioAstronomy::handleChannelMessages() -{ - Message* message; - - while ((message = m_channelMessageQueue.pop()) != nullptr) - { - if (handleMessage(*message)) { - delete message; - } - } -} - void RadioAstronomy::handleIndexInDeviceSetChanged(int index) { if (index < 0) { diff --git a/plugins/channelrx/radioastronomy/radioastronomy.h b/plugins/channelrx/radioastronomy/radioastronomy.h index 5f3d0f9f6..1a2df4064 100644 --- a/plugins/channelrx/radioastronomy/radioastronomy.h +++ b/plugins/channelrx/radioastronomy/radioastronomy.h @@ -425,7 +425,6 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); void updatePipes(); - void handleChannelMessages(); void startMeasurement(); void sweepStartMeasurement(); void sweep1(); diff --git a/plugins/channelrx/radioastronomy/radioastronomygui.cpp b/plugins/channelrx/radioastronomy/radioastronomygui.cpp index 862c17774..72f3d3c1f 100644 --- a/plugins/channelrx/radioastronomy/radioastronomygui.cpp +++ b/plugins/channelrx/radioastronomy/radioastronomygui.cpp @@ -2059,7 +2059,12 @@ RadioAstronomyGUI::RadioAstronomyGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUI connect(&MainCore::instance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick())); // 50 ms m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &RadioAstronomyGUI::networkManagerFinished + ); connect(&m_dlm, &HttpDownloadManager::downloadComplete, this, &RadioAstronomyGUI::downloadFinished); ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03))); diff --git a/plugins/channelrx/radioclock/radioclock.cpp b/plugins/channelrx/radioclock/radioclock.cpp index b29cd1f55..f4c56359d 100644 --- a/plugins/channelrx/radioclock/radioclock.cpp +++ b/plugins/channelrx/radioclock/radioclock.cpp @@ -65,7 +65,12 @@ RadioClock::RadioClock(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSinkAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &RadioClock::networkManagerFinished + ); QObject::connect( this, &ChannelAPI::indexInDeviceSetChanged, @@ -77,7 +82,12 @@ RadioClock::RadioClock(DeviceAPI *deviceAPI) : RadioClock::~RadioClock() { qDebug("RadioClock::~RadioClock"); - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &RadioClock::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); m_deviceAPI->removeChannelSink(this); diff --git a/plugins/channelrx/remotesink/remotesink.cpp b/plugins/channelrx/remotesink/remotesink.cpp index 575b291ff..232b35a0f 100644 --- a/plugins/channelrx/remotesink/remotesink.cpp +++ b/plugins/channelrx/remotesink/remotesink.cpp @@ -66,7 +66,12 @@ RemoteSink::RemoteSink(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSinkAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &RemoteSink::networkManagerFinished + ); QObject::connect( this, &ChannelAPI::indexInDeviceSetChanged, @@ -77,7 +82,12 @@ RemoteSink::RemoteSink(DeviceAPI *deviceAPI) : RemoteSink::~RemoteSink() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &RemoteSink::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); m_deviceAPI->removeChannelSink(this); diff --git a/plugins/channelrx/sigmffilesink/sigmffilesink.cpp b/plugins/channelrx/sigmffilesink/sigmffilesink.cpp index 41c884b5b..5f1bb3828 100644 --- a/plugins/channelrx/sigmffilesink/sigmffilesink.cpp +++ b/plugins/channelrx/sigmffilesink/sigmffilesink.cpp @@ -68,7 +68,12 @@ SigMFFileSink::SigMFFileSink(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSinkAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &SigMFFileSink::networkManagerFinished + ); QObject::connect( this, &ChannelAPI::indexInDeviceSetChanged, @@ -79,7 +84,12 @@ SigMFFileSink::SigMFFileSink(DeviceAPI *deviceAPI) : SigMFFileSink::~SigMFFileSink() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &SigMFFileSink::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); m_deviceAPI->removeChannelSink(this); diff --git a/plugins/channelrx/udpsink/udpsink.cpp b/plugins/channelrx/udpsink/udpsink.cpp index ddd882127..223e9b6e4 100644 --- a/plugins/channelrx/udpsink/udpsink.cpp +++ b/plugins/channelrx/udpsink/udpsink.cpp @@ -63,7 +63,12 @@ UDPSink::UDPSink(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSinkAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &UDPSink::networkManagerFinished + ); QObject::connect( this, &ChannelAPI::indexInDeviceSetChanged, @@ -74,7 +79,12 @@ UDPSink::UDPSink(DeviceAPI *deviceAPI) : UDPSink::~UDPSink() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &UDPSink::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSinkAPI(this); m_deviceAPI->removeChannelSink(this); diff --git a/plugins/channeltx/filesource/filesource.cpp b/plugins/channeltx/filesource/filesource.cpp index 95ea9c8d8..c2035b8e7 100644 --- a/plugins/channeltx/filesource/filesource.cpp +++ b/plugins/channeltx/filesource/filesource.cpp @@ -70,12 +70,22 @@ FileSource::FileSource(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSourceAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &FileSource::networkManagerFinished + ); } FileSource::~FileSource() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &FileSource::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSourceAPI(this); m_deviceAPI->removeChannelSource(this); diff --git a/plugins/channeltx/localsource/localsource.cpp b/plugins/channeltx/localsource/localsource.cpp index c61458fd4..99898a739 100644 --- a/plugins/channeltx/localsource/localsource.cpp +++ b/plugins/channeltx/localsource/localsource.cpp @@ -62,12 +62,22 @@ LocalSource::LocalSource(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSourceAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &LocalSource::networkManagerFinished + ); } LocalSource::~LocalSource() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &LocalSource::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSourceAPI(this); m_deviceAPI->removeChannelSource(this); diff --git a/plugins/channeltx/mod802.15.4/ieee_802_15_4_mod.cpp b/plugins/channeltx/mod802.15.4/ieee_802_15_4_mod.cpp index f18fe5da7..8138c9078 100644 --- a/plugins/channeltx/mod802.15.4/ieee_802_15_4_mod.cpp +++ b/plugins/channeltx/mod802.15.4/ieee_802_15_4_mod.cpp @@ -73,13 +73,23 @@ IEEE_802_15_4_Mod::IEEE_802_15_4_Mod(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSourceAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &IEEE_802_15_4_Mod::networkManagerFinished + ); } IEEE_802_15_4_Mod::~IEEE_802_15_4_Mod() { // closeUDP(); - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &IEEE_802_15_4_Mod::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSourceAPI(this); m_deviceAPI->removeChannelSource(this); diff --git a/plugins/channeltx/modais/aismod.cpp b/plugins/channeltx/modais/aismod.cpp index 705dd204d..22f71d38f 100644 --- a/plugins/channeltx/modais/aismod.cpp +++ b/plugins/channeltx/modais/aismod.cpp @@ -75,14 +75,23 @@ AISMod::AISMod(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSourceAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); - connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages())); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &AISMod::networkManagerFinished + ); } AISMod::~AISMod() { closeUDP(); - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &AISMod::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSourceAPI(this); m_deviceAPI->removeChannelSource(this); @@ -1063,15 +1072,3 @@ void AISMod::udpRx() m_basebandSource->getInputMessageQueue()->push(msg); } } - -void AISMod::handleChannelMessages() -{ - Message* message; - - while ((message = m_channelMessageQueue.pop()) != nullptr) - { - if (handleMessage(*message)) { - delete message; - } - } -} diff --git a/plugins/channeltx/modais/aismod.h b/plugins/channeltx/modais/aismod.h index 91b426469..76b0b644a 100644 --- a/plugins/channeltx/modais/aismod.h +++ b/plugins/channeltx/modais/aismod.h @@ -253,7 +253,6 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); void udpRx(); - void handleChannelMessages(); }; diff --git a/plugins/channeltx/modam/ammod.cpp b/plugins/channeltx/modam/ammod.cpp index b8002f5af..d1f80abfd 100644 --- a/plugins/channeltx/modam/ammod.cpp +++ b/plugins/channeltx/modam/ammod.cpp @@ -74,13 +74,22 @@ AMMod::AMMod(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSourceAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); - connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages())); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &AMMod::networkManagerFinished + ); } AMMod::~AMMod() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &AMMod::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSourceAPI(this); m_deviceAPI->removeChannelSource(this); @@ -786,15 +795,3 @@ int AMMod::getFeedbackAudioSampleRate() const { return m_basebandSource->getFeedbackAudioSampleRate(); } - -void AMMod::handleChannelMessages() -{ - Message* message; - - while ((message = m_channelMessageQueue.pop()) != nullptr) - { - if (handleMessage(*message)) { - delete message; - } - } -} diff --git a/plugins/channeltx/modam/ammod.h b/plugins/channeltx/modam/ammod.h index 24bfd6966..0d66a771c 100644 --- a/plugins/channeltx/modam/ammod.h +++ b/plugins/channeltx/modam/ammod.h @@ -278,7 +278,6 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); - void handleChannelMessages(); }; diff --git a/plugins/channeltx/modatv/atvmod.cpp b/plugins/channeltx/modatv/atvmod.cpp index fe92abaaa..5377e20a6 100644 --- a/plugins/channeltx/modatv/atvmod.cpp +++ b/plugins/channeltx/modatv/atvmod.cpp @@ -71,12 +71,22 @@ ATVMod::ATVMod(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSourceAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &ATVMod::networkManagerFinished + ); } ATVMod::~ATVMod() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &ATVMod::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSourceAPI(this); m_deviceAPI->removeChannelSource(this); diff --git a/plugins/channeltx/modchirpchat/chirpchatmod.cpp b/plugins/channeltx/modchirpchat/chirpchatmod.cpp index e699d18af..dc849b71b 100644 --- a/plugins/channeltx/modchirpchat/chirpchatmod.cpp +++ b/plugins/channeltx/modchirpchat/chirpchatmod.cpp @@ -70,12 +70,22 @@ ChirpChatMod::ChirpChatMod(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSourceAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &ChirpChatMod::networkManagerFinished + ); } ChirpChatMod::~ChirpChatMod() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &ChirpChatMod::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSourceAPI(this); m_deviceAPI->removeChannelSource(this); diff --git a/plugins/channeltx/moddatv/datvmod.cpp b/plugins/channeltx/moddatv/datvmod.cpp index f23bf1790..2cbe26e06 100644 --- a/plugins/channeltx/moddatv/datvmod.cpp +++ b/plugins/channeltx/moddatv/datvmod.cpp @@ -74,12 +74,22 @@ DATVMod::DATVMod(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSourceAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &DATVMod::networkManagerFinished + ); } DATVMod::~DATVMod() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &DATVMod::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSourceAPI(this); m_deviceAPI->removeChannelSource(this); diff --git a/plugins/channeltx/modfreedv/freedvmod.cpp b/plugins/channeltx/modfreedv/freedvmod.cpp index ad7debf29..dd3d4a004 100644 --- a/plugins/channeltx/modfreedv/freedvmod.cpp +++ b/plugins/channeltx/modfreedv/freedvmod.cpp @@ -74,12 +74,22 @@ FreeDVMod::FreeDVMod(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSourceAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &FreeDVMod::networkManagerFinished + ); } FreeDVMod::~FreeDVMod() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &FreeDVMod::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSourceAPI(this); m_deviceAPI->removeChannelSource(this); diff --git a/plugins/channeltx/modnfm/nfmmod.cpp b/plugins/channeltx/modnfm/nfmmod.cpp index e9cf3d701..70ddfbe57 100644 --- a/plugins/channeltx/modnfm/nfmmod.cpp +++ b/plugins/channeltx/modnfm/nfmmod.cpp @@ -75,13 +75,22 @@ NFMMod::NFMMod(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSourceAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); - connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages())); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &NFMMod::networkManagerFinished + ); } NFMMod::~NFMMod() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &NFMMod::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSourceAPI(this); m_deviceAPI->removeChannelSource(this); @@ -877,15 +886,3 @@ int NFMMod::getFeedbackAudioSampleRate() const { return m_basebandSource->getFeedbackAudioSampleRate(); } - -void NFMMod::handleChannelMessages() -{ - Message* message; - - while ((message = m_channelMessageQueue.pop()) != nullptr) - { - if (handleMessage(*message)) { - delete message; - } - } -} diff --git a/plugins/channeltx/modnfm/nfmmod.h b/plugins/channeltx/modnfm/nfmmod.h index bf5999b6f..29eed39da 100644 --- a/plugins/channeltx/modnfm/nfmmod.h +++ b/plugins/channeltx/modnfm/nfmmod.h @@ -278,7 +278,6 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); - void handleChannelMessages(); }; diff --git a/plugins/channeltx/modpacket/packetmod.cpp b/plugins/channeltx/modpacket/packetmod.cpp index 47ef4caf4..73c1e2dc3 100644 --- a/plugins/channeltx/modpacket/packetmod.cpp +++ b/plugins/channeltx/modpacket/packetmod.cpp @@ -79,14 +79,23 @@ PacketMod::PacketMod(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSourceAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); - connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages())); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &PacketMod::networkManagerFinished + ); } PacketMod::~PacketMod() { closeUDP(); - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &PacketMod::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSourceAPI(this); m_deviceAPI->removeChannelSource(this); @@ -1143,15 +1152,3 @@ void PacketMod::udpRx() m_basebandSource->getInputMessageQueue()->push(msg); } } - -void PacketMod::handleChannelMessages() -{ - Message* message; - - while ((message = m_channelMessageQueue.pop()) != nullptr) - { - if (handleMessage(*message)) { - delete message; - } - } -} diff --git a/plugins/channeltx/modpacket/packetmod.h b/plugins/channeltx/modpacket/packetmod.h index a4a667641..3ad3a6d9f 100644 --- a/plugins/channeltx/modpacket/packetmod.h +++ b/plugins/channeltx/modpacket/packetmod.h @@ -248,7 +248,6 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); void udpRx(); - void handleChannelMessages(); }; diff --git a/plugins/channeltx/modssb/ssbmod.cpp b/plugins/channeltx/modssb/ssbmod.cpp index e2d2db27d..b833c0562 100644 --- a/plugins/channeltx/modssb/ssbmod.cpp +++ b/plugins/channeltx/modssb/ssbmod.cpp @@ -76,13 +76,22 @@ SSBMod::SSBMod(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSourceAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); - connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages())); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &SSBMod::networkManagerFinished + ); } SSBMod::~SSBMod() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &SSBMod::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSourceAPI(this); m_deviceAPI->removeChannelSource(this); @@ -895,15 +904,3 @@ uint32_t SSBMod::getNumberOfDeviceStreams() const { return m_deviceAPI->getNbSinkStreams(); } - -void SSBMod::handleChannelMessages() -{ - Message* message; - - while ((message = m_channelMessageQueue.pop()) != nullptr) - { - if (handleMessage(*message)) { - delete message; - } - } -} diff --git a/plugins/channeltx/modssb/ssbmod.h b/plugins/channeltx/modssb/ssbmod.h index 87dc19793..2df917278 100644 --- a/plugins/channeltx/modssb/ssbmod.h +++ b/plugins/channeltx/modssb/ssbmod.h @@ -282,7 +282,6 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); - void handleChannelMessages(); }; diff --git a/plugins/channeltx/modwfm/wfmmod.cpp b/plugins/channeltx/modwfm/wfmmod.cpp index 1c3e21bdc..2aceef3e2 100644 --- a/plugins/channeltx/modwfm/wfmmod.cpp +++ b/plugins/channeltx/modwfm/wfmmod.cpp @@ -73,13 +73,22 @@ WFMMod::WFMMod(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSourceAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); - connect(&m_channelMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleChannelMessages())); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &WFMMod::networkManagerFinished + ); } WFMMod::~WFMMod() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &WFMMod::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSourceAPI(this); m_deviceAPI->removeChannelSource(this); @@ -781,15 +790,3 @@ int WFMMod::getFeedbackAudioSampleRate() const { return m_basebandSource->getFeedbackAudioSampleRate(); } - -void WFMMod::handleChannelMessages() -{ - Message* message; - - while ((message = m_channelMessageQueue.pop()) != nullptr) - { - if (handleMessage(*message)) { - delete message; - } - } -} diff --git a/plugins/channeltx/modwfm/wfmmod.h b/plugins/channeltx/modwfm/wfmmod.h index 8677a331a..6c3c1a171 100644 --- a/plugins/channeltx/modwfm/wfmmod.h +++ b/plugins/channeltx/modwfm/wfmmod.h @@ -290,7 +290,6 @@ private: private slots: void networkManagerFinished(QNetworkReply *reply); - void handleChannelMessages(); }; diff --git a/plugins/channeltx/remotesource/remotesource.cpp b/plugins/channeltx/remotesource/remotesource.cpp index 7df012e1f..3512b7c35 100644 --- a/plugins/channeltx/remotesource/remotesource.cpp +++ b/plugins/channeltx/remotesource/remotesource.cpp @@ -66,12 +66,22 @@ RemoteSource::RemoteSource(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSourceAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &RemoteSource::networkManagerFinished + ); } RemoteSource::~RemoteSource() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &RemoteSource::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSourceAPI(this); m_deviceAPI->removeChannelSource(this); diff --git a/plugins/channeltx/udpsource/udpsource.cpp b/plugins/channeltx/udpsource/udpsource.cpp index 60b3a48ef..f455801c4 100644 --- a/plugins/channeltx/udpsource/udpsource.cpp +++ b/plugins/channeltx/udpsource/udpsource.cpp @@ -59,12 +59,22 @@ UDPSource::UDPSource(DeviceAPI *deviceAPI) : m_deviceAPI->addChannelSourceAPI(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &UDPSource::networkManagerFinished + ); } UDPSource::~UDPSource() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &UDPSource::networkManagerFinished + ); delete m_networkManager; m_deviceAPI->removeChannelSourceAPI(this); m_deviceAPI->removeChannelSource(this); diff --git a/plugins/feature/afc/afc.cpp b/plugins/feature/afc/afc.cpp index b66d1bc02..89090def0 100644 --- a/plugins/feature/afc/afc.cpp +++ b/plugins/feature/afc/afc.cpp @@ -59,12 +59,22 @@ AFC::AFC(WebAPIAdapterInterface *webAPIAdapterInterface) : m_state = StIdle; m_errorMessage = "AFC error"; m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &AFC::networkManagerFinished + ); } AFC::~AFC() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &AFC::networkManagerFinished + ); delete m_networkManager; if (m_worker->isRunning()) { stop(); diff --git a/plugins/feature/ais/ais.cpp b/plugins/feature/ais/ais.cpp index 80a10328e..066324f47 100644 --- a/plugins/feature/ais/ais.cpp +++ b/plugins/feature/ais/ais.cpp @@ -51,12 +51,22 @@ AIS::AIS(WebAPIAdapterInterface *webAPIAdapterInterface) : connect(&m_updatePipesTimer, SIGNAL(timeout()), this, SLOT(updatePipes())); m_updatePipesTimer.start(1000); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &AIS::networkManagerFinished + ); } AIS::~AIS() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &AIS::networkManagerFinished + ); delete m_networkManager; } diff --git a/plugins/feature/antennatools/antennatools.cpp b/plugins/feature/antennatools/antennatools.cpp index 7afb18d11..36ae5538e 100644 --- a/plugins/feature/antennatools/antennatools.cpp +++ b/plugins/feature/antennatools/antennatools.cpp @@ -46,12 +46,22 @@ AntennaTools::AntennaTools(WebAPIAdapterInterface *webAPIAdapterInterface) : m_state = StIdle; m_errorMessage = "AntennaTools error"; m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &AntennaTools::networkManagerFinished + ); } AntennaTools::~AntennaTools() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &AntennaTools::networkManagerFinished + ); delete m_networkManager; } diff --git a/plugins/feature/aprs/aprs.cpp b/plugins/feature/aprs/aprs.cpp index 70ede6caf..331df95b9 100644 --- a/plugins/feature/aprs/aprs.cpp +++ b/plugins/feature/aprs/aprs.cpp @@ -53,12 +53,22 @@ APRS::APRS(WebAPIAdapterInterface *webAPIAdapterInterface) : connect(&m_updatePipesTimer, SIGNAL(timeout()), this, SLOT(updatePipes())); m_updatePipesTimer.start(1000); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &APRS::networkManagerFinished + ); } APRS::~APRS() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &APRS::networkManagerFinished + ); delete m_networkManager; if (m_worker->isRunning()) { stop(); diff --git a/plugins/feature/demodanalyzer/demodanalyzer.cpp b/plugins/feature/demodanalyzer/demodanalyzer.cpp index 65e897cf6..2aefe0d87 100644 --- a/plugins/feature/demodanalyzer/demodanalyzer.cpp +++ b/plugins/feature/demodanalyzer/demodanalyzer.cpp @@ -60,12 +60,22 @@ DemodAnalyzer::DemodAnalyzer(WebAPIAdapterInterface *webAPIAdapterInterface) : m_state = StIdle; m_errorMessage = "DemodAnalyzer error"; m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &DemodAnalyzer::networkManagerFinished + ); } DemodAnalyzer::~DemodAnalyzer() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &DemodAnalyzer::networkManagerFinished + ); delete m_networkManager; if (m_worker->isRunning()) { stop(); diff --git a/plugins/feature/gs232controller/gs232controller.cpp b/plugins/feature/gs232controller/gs232controller.cpp index 05002a1d4..3247fbe4e 100644 --- a/plugins/feature/gs232controller/gs232controller.cpp +++ b/plugins/feature/gs232controller/gs232controller.cpp @@ -60,12 +60,22 @@ GS232Controller::GS232Controller(WebAPIAdapterInterface *webAPIAdapterInterface) connect(&m_updatePipesTimer, SIGNAL(timeout()), this, SLOT(updatePipes())); m_updatePipesTimer.start(1000); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &GS232Controller::networkManagerFinished + ); } GS232Controller::~GS232Controller() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &GS232Controller::networkManagerFinished + ); delete m_networkManager; if (m_worker->isRunning()) { stop(); diff --git a/plugins/feature/jogdialcontroller/jogdialcontroller.cpp b/plugins/feature/jogdialcontroller/jogdialcontroller.cpp index ae989a8eb..bcee34f0e 100644 --- a/plugins/feature/jogdialcontroller/jogdialcontroller.cpp +++ b/plugins/feature/jogdialcontroller/jogdialcontroller.cpp @@ -62,13 +62,23 @@ JogdialController::JogdialController(WebAPIAdapterInterface *webAPIAdapterInterf m_state = StIdle; m_errorMessage = "JogdialController error"; m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &JogdialController::networkManagerFinished + ); connect(&m_repeatTimer, SIGNAL(timeout()), this, SLOT(handleRepeat())); } JogdialController::~JogdialController() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &JogdialController::networkManagerFinished + ); delete m_networkManager; } diff --git a/plugins/feature/map/map.cpp b/plugins/feature/map/map.cpp index 1e2dea20b..d760d5c2f 100644 --- a/plugins/feature/map/map.cpp +++ b/plugins/feature/map/map.cpp @@ -54,12 +54,22 @@ Map::Map(WebAPIAdapterInterface *webAPIAdapterInterface) : connect(&m_updatePipesTimer, SIGNAL(timeout()), this, SLOT(updatePipes())); m_updatePipesTimer.start(1000); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &Map::networkManagerFinished + ); } Map::~Map() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &Map::networkManagerFinished + ); delete m_networkManager; } diff --git a/plugins/feature/pertester/pertester.cpp b/plugins/feature/pertester/pertester.cpp index 9c53bfa16..7b81b3689 100644 --- a/plugins/feature/pertester/pertester.cpp +++ b/plugins/feature/pertester/pertester.cpp @@ -57,12 +57,22 @@ PERTester::PERTester(WebAPIAdapterInterface *webAPIAdapterInterface) : m_state = StIdle; m_errorMessage = "PERTester error"; m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &PERTester::networkManagerFinished + ); } PERTester::~PERTester() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &PERTester::networkManagerFinished + ); delete m_networkManager; if (m_worker->isRunning()) { stop(); diff --git a/plugins/feature/radiosonde/radiosonde.cpp b/plugins/feature/radiosonde/radiosonde.cpp index b16f9ecb0..7216cb039 100644 --- a/plugins/feature/radiosonde/radiosonde.cpp +++ b/plugins/feature/radiosonde/radiosonde.cpp @@ -51,12 +51,22 @@ Radiosonde::Radiosonde(WebAPIAdapterInterface *webAPIAdapterInterface) : connect(&m_updatePipesTimer, SIGNAL(timeout()), this, SLOT(updatePipes())); m_updatePipesTimer.start(1000); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &Radiosonde::networkManagerFinished + ); } Radiosonde::~Radiosonde() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &Radiosonde::networkManagerFinished + ); delete m_networkManager; } @@ -194,7 +204,7 @@ int Radiosonde::webapiSettingsPutPatch( } webapiFormatFeatureSettings(response, settings); - + return 200; } diff --git a/plugins/feature/rigctlserver/rigctlserver.cpp b/plugins/feature/rigctlserver/rigctlserver.cpp index be599bd9b..b3c6d6fee 100644 --- a/plugins/feature/rigctlserver/rigctlserver.cpp +++ b/plugins/feature/rigctlserver/rigctlserver.cpp @@ -48,12 +48,22 @@ RigCtlServer::RigCtlServer(WebAPIAdapterInterface *webAPIAdapterInterface) : m_state = StIdle; m_errorMessage = "RigCtlServer error"; m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &RigCtlServer::networkManagerFinished + ); } RigCtlServer::~RigCtlServer() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &RigCtlServer::networkManagerFinished + ); delete m_networkManager; if (m_worker->isRunning()) { stop(); diff --git a/plugins/feature/satellitetracker/satelliteselectiondialog.cpp b/plugins/feature/satellitetracker/satelliteselectiondialog.cpp index 69acbf644..3e2e07868 100644 --- a/plugins/feature/satellitetracker/satelliteselectiondialog.cpp +++ b/plugins/feature/satellitetracker/satelliteselectiondialog.cpp @@ -37,7 +37,12 @@ SatelliteSelectionDialog::SatelliteSelectionDialog(SatelliteTrackerSettings *set { ui->setupUi(this); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &SatelliteSelectionDialog::networkManagerFinished + ); QHashIterator itr(satellites); while (itr.hasNext()) diff --git a/plugins/feature/satellitetracker/satellitetracker.cpp b/plugins/feature/satellitetracker/satellitetracker.cpp index cc39e4723..e37800ae2 100644 --- a/plugins/feature/satellitetracker/satellitetracker.cpp +++ b/plugins/feature/satellitetracker/satellitetracker.cpp @@ -59,7 +59,12 @@ SatelliteTracker::SatelliteTracker(WebAPIAdapterInterface *webAPIAdapterInterfac m_state = StIdle; m_errorMessage = "SatelliteTracker error"; m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &SatelliteTracker::networkManagerFinished + ); connect(&m_dlm, &HttpDownloadManager::downloadComplete, this, &SatelliteTracker::downloadFinished); if (!readSatData()) diff --git a/plugins/feature/simpleptt/simpleptt.cpp b/plugins/feature/simpleptt/simpleptt.cpp index e798bc06a..e08f8b111 100644 --- a/plugins/feature/simpleptt/simpleptt.cpp +++ b/plugins/feature/simpleptt/simpleptt.cpp @@ -49,12 +49,22 @@ SimplePTT::SimplePTT(WebAPIAdapterInterface *webAPIAdapterInterface) : m_state = StIdle; m_errorMessage = "SimplePTT error"; m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &SimplePTT::networkManagerFinished + ); } SimplePTT::~SimplePTT() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &SimplePTT::networkManagerFinished + ); delete m_networkManager; if (m_worker->isRunning()) { stop(); diff --git a/plugins/feature/startracker/startracker.cpp b/plugins/feature/startracker/startracker.cpp index bed59ab1e..e0ee6c6cb 100644 --- a/plugins/feature/startracker/startracker.cpp +++ b/plugins/feature/startracker/startracker.cpp @@ -56,7 +56,12 @@ StarTracker::StarTracker(WebAPIAdapterInterface *webAPIAdapterInterface) : connect(&m_updatePipesTimer, SIGNAL(timeout()), this, SLOT(updatePipes())); m_updatePipesTimer.start(1000); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &StarTracker::networkManagerFinished + ); m_weather = nullptr; m_solarFlux = 0.0f; // Unfortunately, can't seem to access resources in static global constructor @@ -68,7 +73,12 @@ StarTracker::StarTracker(WebAPIAdapterInterface *webAPIAdapterInterface) : StarTracker::~StarTracker() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &StarTracker::networkManagerFinished + ); delete m_networkManager; if (m_worker->isRunning()) { stop(); diff --git a/plugins/feature/startracker/startrackergui.cpp b/plugins/feature/startracker/startrackergui.cpp index dd7b37874..4fde5482c 100644 --- a/plugins/feature/startracker/startrackergui.cpp +++ b/plugins/feature/startracker/startrackergui.cpp @@ -355,7 +355,12 @@ StarTrackerGUI::StarTrackerGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, */ m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &StarTrackerGUI::networkManagerFinished + ); readSolarFlux(); connect(&m_solarFluxTimer, SIGNAL(timeout()), this, SLOT(autoUpdateSolarFlux())); @@ -368,7 +373,12 @@ StarTrackerGUI::StarTrackerGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, StarTrackerGUI::~StarTrackerGUI() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &StarTrackerGUI::networkManagerFinished + ); delete m_networkManager; delete ui; } diff --git a/plugins/feature/vorlocalizer/vorlocalizer.cpp b/plugins/feature/vorlocalizer/vorlocalizer.cpp index 6edef127a..9b1d29029 100644 --- a/plugins/feature/vorlocalizer/vorlocalizer.cpp +++ b/plugins/feature/vorlocalizer/vorlocalizer.cpp @@ -57,14 +57,24 @@ VORLocalizer::VORLocalizer(WebAPIAdapterInterface *webAPIAdapterInterface) : m_state = StIdle; m_errorMessage = "VORLocalizer error"; m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &VORLocalizer::networkManagerFinished + ); connect(MainCore::instance(), SIGNAL(channelAdded(int, ChannelAPI*)), this, SLOT(handleChannelAdded(int, ChannelAPI*))); } VORLocalizer::~VORLocalizer() { disconnect(MainCore::instance(), SIGNAL(channelAdded(int, ChannelAPI*)), this, SLOT(handleChannelAdded(int, ChannelAPI*))); - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &VORLocalizer::networkManagerFinished + ); delete m_networkManager; if (m_worker->isRunning()) { stop(); diff --git a/plugins/samplemimo/bladerf2mimo/bladerf2mimo.cpp b/plugins/samplemimo/bladerf2mimo/bladerf2mimo.cpp index c6fb40cb5..61d4b28c5 100644 --- a/plugins/samplemimo/bladerf2mimo/bladerf2mimo.cpp +++ b/plugins/samplemimo/bladerf2mimo/bladerf2mimo.cpp @@ -75,12 +75,22 @@ BladeRF2MIMO::BladeRF2MIMO(DeviceAPI *deviceAPI) : m_deviceAPI->setNbSourceStreams(2); m_deviceAPI->setNbSinkStreams(2); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &BladeRF2MIMO::networkManagerFinished + ); } BladeRF2MIMO::~BladeRF2MIMO() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &BladeRF2MIMO::networkManagerFinished + ); delete m_networkManager; closeDevice(); } diff --git a/plugins/samplemimo/limesdrmimo/limesdrmimo.cpp b/plugins/samplemimo/limesdrmimo/limesdrmimo.cpp index 8b1d9e1a5..bf86067cd 100644 --- a/plugins/samplemimo/limesdrmimo/limesdrmimo.cpp +++ b/plugins/samplemimo/limesdrmimo/limesdrmimo.cpp @@ -74,12 +74,22 @@ LimeSDRMIMO::LimeSDRMIMO(DeviceAPI *deviceAPI) : m_deviceAPI->setNbSourceStreams(m_deviceParams->m_nbRxChannels); m_deviceAPI->setNbSinkStreams(m_deviceParams->m_nbTxChannels); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &LimeSDRMIMO::networkManagerFinished + ); } LimeSDRMIMO::~LimeSDRMIMO() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &LimeSDRMIMO::networkManagerFinished + ); delete m_networkManager; closeDevice(); } diff --git a/plugins/samplemimo/metismiso/metismiso.cpp b/plugins/samplemimo/metismiso/metismiso.cpp index d0fe006b6..9cc99dfd3 100644 --- a/plugins/samplemimo/metismiso/metismiso.cpp +++ b/plugins/samplemimo/metismiso/metismiso.cpp @@ -59,12 +59,22 @@ MetisMISO::MetisMISO(DeviceAPI *deviceAPI) : const DeviceMetisScan::DeviceScan *deviceScan = DeviceMetis::instance().getDeviceScanAt(deviceSequence); m_udpHandler.setMetisAddress(deviceScan->m_address, deviceScan->m_port); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &MetisMISO::networkManagerFinished + ); } MetisMISO::~MetisMISO() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &MetisMISO::networkManagerFinished + ); delete m_networkManager; if (m_running) { diff --git a/plugins/samplemimo/plutosdrmimo/plutosdrmimo.cpp b/plugins/samplemimo/plutosdrmimo/plutosdrmimo.cpp index 7a9e2ba74..24279c70c 100644 --- a/plugins/samplemimo/plutosdrmimo/plutosdrmimo.cpp +++ b/plugins/samplemimo/plutosdrmimo/plutosdrmimo.cpp @@ -58,7 +58,12 @@ PlutoSDRMIMO::PlutoSDRMIMO(DeviceAPI *deviceAPI) : m_sampleMIFifo.init(2, 16 * PlutoSDRMIMOSettings::m_plutoSDRBlockSizeSamples); m_sampleMOFifo.init(2, 16 * PlutoSDRMIMOSettings::m_plutoSDRBlockSizeSamples); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &PlutoSDRMIMO::networkManagerFinished + ); m_open = openDevice(); @@ -74,7 +79,12 @@ PlutoSDRMIMO::PlutoSDRMIMO(DeviceAPI *deviceAPI) : PlutoSDRMIMO::~PlutoSDRMIMO() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &PlutoSDRMIMO::networkManagerFinished + ); delete m_networkManager; closeDevice(); } diff --git a/plugins/samplemimo/testmi/testmi.cpp b/plugins/samplemimo/testmi/testmi.cpp index 2e0adcfb9..38daa771c 100644 --- a/plugins/samplemimo/testmi/testmi.cpp +++ b/plugins/samplemimo/testmi/testmi.cpp @@ -51,12 +51,22 @@ TestMI::TestMI(DeviceAPI *deviceAPI) : m_sampleMIFifo.init(2, 96000 * 4); m_deviceAPI->setNbSourceStreams(2); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &TestMI::networkManagerFinished + ); } TestMI::~TestMI() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &TestMI::networkManagerFinished + ); delete m_networkManager; if (m_running) { diff --git a/plugins/samplemimo/xtrxmimo/xtrxmimo.cpp b/plugins/samplemimo/xtrxmimo/xtrxmimo.cpp index 9f6314e21..cc22717ce 100644 --- a/plugins/samplemimo/xtrxmimo/xtrxmimo.cpp +++ b/plugins/samplemimo/xtrxmimo/xtrxmimo.cpp @@ -65,12 +65,22 @@ XTRXMIMO::XTRXMIMO(DeviceAPI *deviceAPI) : m_deviceAPI->setNbSourceStreams(2); m_deviceAPI->setNbSinkStreams(2); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &XTRXMIMO::networkManagerFinished + ); } XTRXMIMO::~XTRXMIMO() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &XTRXMIMO::networkManagerFinished + ); delete m_networkManager; closeDevice(); } diff --git a/plugins/samplesink/bladerf1output/bladerf1output.cpp b/plugins/samplesink/bladerf1output/bladerf1output.cpp index 54b39cec6..4a86fd63c 100644 --- a/plugins/samplesink/bladerf1output/bladerf1output.cpp +++ b/plugins/samplesink/bladerf1output/bladerf1output.cpp @@ -51,12 +51,22 @@ Bladerf1Output::Bladerf1Output(DeviceAPI *deviceAPI) : m_deviceAPI->setNbSinkStreams(1); m_deviceAPI->setBuddySharedPtr(&m_sharedParams); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &Bladerf1Output::networkManagerFinished + ); } Bladerf1Output::~Bladerf1Output() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &Bladerf1Output::networkManagerFinished + ); delete m_networkManager; if (m_running) { @@ -344,7 +354,7 @@ bool Bladerf1Output::applySettings(const BladeRF1OutputSettings& settings, bool #if defined(_MSC_VER) unsigned int fifoRate = (unsigned int) settings.m_devSampleRate / (1<setNbSinkStreams(1); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &BladeRF2Output::networkManagerFinished + ); } BladeRF2Output::~BladeRF2Output() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &BladeRF2Output::networkManagerFinished + ); delete m_networkManager; if (m_running) { diff --git a/plugins/samplesink/hackrfoutput/hackrfoutput.cpp b/plugins/samplesink/hackrfoutput/hackrfoutput.cpp index f227659a3..8390930d8 100644 --- a/plugins/samplesink/hackrfoutput/hackrfoutput.cpp +++ b/plugins/samplesink/hackrfoutput/hackrfoutput.cpp @@ -49,12 +49,22 @@ HackRFOutput::HackRFOutput(DeviceAPI *deviceAPI) : m_deviceAPI->setNbSinkStreams(1); m_deviceAPI->setBuddySharedPtr(&m_sharedParams); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &HackRFOutput::networkManagerFinished + ); } HackRFOutput::~HackRFOutput() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &HackRFOutput::networkManagerFinished + ); delete m_networkManager; if (m_running) { diff --git a/plugins/samplesink/limesdroutput/limesdroutput.cpp b/plugins/samplesink/limesdroutput/limesdroutput.cpp index adfa7a07e..6c9695380 100644 --- a/plugins/samplesink/limesdroutput/limesdroutput.cpp +++ b/plugins/samplesink/limesdroutput/limesdroutput.cpp @@ -63,12 +63,22 @@ LimeSDROutput::LimeSDROutput(DeviceAPI *deviceAPI) : resumeTxBuddies(); resumeRxBuddies(); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &LimeSDROutput::networkManagerFinished + ); } LimeSDROutput::~LimeSDROutput() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &LimeSDROutput::networkManagerFinished + ); delete m_networkManager; if (m_running) { diff --git a/plugins/samplesink/localoutput/localoutput.cpp b/plugins/samplesink/localoutput/localoutput.cpp index 291c8b5ce..12cc25fee 100644 --- a/plugins/samplesink/localoutput/localoutput.cpp +++ b/plugins/samplesink/localoutput/localoutput.cpp @@ -48,12 +48,22 @@ LocalOutput::LocalOutput(DeviceAPI *deviceAPI) : m_sampleSourceFifo.resize(SampleSourceFifo::getSizePolicy(m_sampleRate)); m_deviceAPI->setNbSinkStreams(1); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &LocalOutput::networkManagerFinished + ); } LocalOutput::~LocalOutput() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &LocalOutput::networkManagerFinished + ); delete m_networkManager; stop(); } diff --git a/plugins/samplesink/localoutput/localoutputgui.cpp b/plugins/samplesink/localoutput/localoutputgui.cpp index 6f75dc0a3..70619e7c4 100644 --- a/plugins/samplesink/localoutput/localoutputgui.cpp +++ b/plugins/samplesink/localoutput/localoutputgui.cpp @@ -77,17 +77,12 @@ LocalOutputGui::LocalOutputGui(DeviceUISet *deviceUISet, QWidget* parent) : connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection); m_sampleSink->setMessageQueueToGUI(&m_inputMessageQueue); - m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); - m_forceSettings = true; sendSettings(); } LocalOutputGui::~LocalOutputGui() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); - delete m_networkManager; delete ui; } diff --git a/plugins/samplesink/localoutput/localoutputgui.h b/plugins/samplesink/localoutput/localoutputgui.h index a5335b34b..f9d27e8f4 100644 --- a/plugins/samplesink/localoutput/localoutputgui.h +++ b/plugins/samplesink/localoutput/localoutputgui.h @@ -20,7 +20,6 @@ #include #include -#include #include "device/devicegui.h" #include "util/messagequeue.h" @@ -28,7 +27,6 @@ #include "localoutput.h" class DeviceUISet; -class QNetworkAccessManager; class QNetworkReply; class QJsonObject; @@ -72,9 +70,6 @@ private: QPalette m_paletteGreenText; QPalette m_paletteWhiteText; - QNetworkAccessManager *m_networkManager; - QNetworkRequest m_networkRequest; - void blockApplySettings(bool block); void displaySettings(); void sendSettings(); diff --git a/plugins/samplesink/plutosdroutput/plutosdroutput.cpp b/plugins/samplesink/plutosdroutput/plutosdroutput.cpp index 98dd20b10..4e09d02ee 100644 --- a/plugins/samplesink/plutosdroutput/plutosdroutput.cpp +++ b/plugins/samplesink/plutosdroutput/plutosdroutput.cpp @@ -64,12 +64,22 @@ PlutoSDROutput::PlutoSDROutput(DeviceAPI *deviceAPI) : resumeBuddies(); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &PlutoSDROutput::networkManagerFinished + ); } PlutoSDROutput::~PlutoSDROutput() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &PlutoSDROutput::networkManagerFinished + ); delete m_networkManager; suspendBuddies(); diff --git a/plugins/samplesink/remoteoutput/remoteoutput.cpp b/plugins/samplesink/remoteoutput/remoteoutput.cpp index b13201d30..967fb1e87 100644 --- a/plugins/samplesink/remoteoutput/remoteoutput.cpp +++ b/plugins/samplesink/remoteoutput/remoteoutput.cpp @@ -65,7 +65,12 @@ RemoteOutput::RemoteOutput(DeviceAPI *deviceAPI) : { m_deviceAPI->setNbSinkStreams(1); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &RemoteOutput::networkManagerFinished + ); connect(&m_masterTimer, SIGNAL(timeout()), this, SLOT(tick())); applyCenterFrequency(); applySampleRate(); @@ -73,7 +78,12 @@ RemoteOutput::RemoteOutput(DeviceAPI *deviceAPI) : RemoteOutput::~RemoteOutput() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &RemoteOutput::networkManagerFinished + ); stop(); delete m_networkManager; } diff --git a/plugins/samplesink/soapysdroutput/soapysdroutput.cpp b/plugins/samplesink/soapysdroutput/soapysdroutput.cpp index 9e2267215..fc2dae9ad 100644 --- a/plugins/samplesink/soapysdroutput/soapysdroutput.cpp +++ b/plugins/samplesink/soapysdroutput/soapysdroutput.cpp @@ -52,12 +52,22 @@ SoapySDROutput::SoapySDROutput(DeviceAPI *deviceAPI) : initDeviceArgSettings(m_settings); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &SoapySDROutput::networkManagerFinished + ); } SoapySDROutput::~SoapySDROutput() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &SoapySDROutput::networkManagerFinished + ); delete m_networkManager; if (m_running) { diff --git a/plugins/samplesink/usrpoutput/usrpoutput.cpp b/plugins/samplesink/usrpoutput/usrpoutput.cpp index 79ac8da31..ac5a8260e 100644 --- a/plugins/samplesink/usrpoutput/usrpoutput.cpp +++ b/plugins/samplesink/usrpoutput/usrpoutput.cpp @@ -65,12 +65,22 @@ USRPOutput::USRPOutput(DeviceAPI *deviceAPI) : resumeTxBuddies(); resumeRxBuddies(); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &USRPOutput::networkManagerFinished + ); } USRPOutput::~USRPOutput() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &USRPOutput::networkManagerFinished + ); delete m_networkManager; if (m_running) { diff --git a/plugins/samplesink/xtrxoutput/xtrxoutput.cpp b/plugins/samplesink/xtrxoutput/xtrxoutput.cpp index 6f5cb7428..ba239af06 100644 --- a/plugins/samplesink/xtrxoutput/xtrxoutput.cpp +++ b/plugins/samplesink/xtrxoutput/xtrxoutput.cpp @@ -55,12 +55,22 @@ XTRXOutput::XTRXOutput(DeviceAPI *deviceAPI) : openDevice(); m_deviceAPI->setNbSinkStreams(1); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &XTRXOutput::networkManagerFinished + ); } XTRXOutput::~XTRXOutput() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &XTRXOutput::networkManagerFinished + ); delete m_networkManager; if (m_running) { diff --git a/plugins/samplesource/airspy/airspyinput.cpp b/plugins/samplesource/airspy/airspyinput.cpp index 996f42ba9..a3b3ca3b0 100644 --- a/plugins/samplesource/airspy/airspyinput.cpp +++ b/plugins/samplesource/airspy/airspyinput.cpp @@ -56,12 +56,22 @@ AirspyInput::AirspyInput(DeviceAPI *deviceAPI) : m_deviceAPI->setNbSourceStreams(1); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &AirspyInput::networkManagerFinished + ); } AirspyInput::~AirspyInput() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &AirspyInput::networkManagerFinished + ); delete m_networkManager; if (m_running) { diff --git a/plugins/samplesource/airspyhf/airspyhfinput.cpp b/plugins/samplesource/airspyhf/airspyhfinput.cpp index efeef6ab9..6704350be 100644 --- a/plugins/samplesource/airspyhf/airspyhfinput.cpp +++ b/plugins/samplesource/airspyhf/airspyhfinput.cpp @@ -57,12 +57,22 @@ AirspyHFInput::AirspyHFInput(DeviceAPI *deviceAPI) : openDevice(); m_deviceAPI->setNbSourceStreams(1); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &AirspyHFInput::networkManagerFinished + ); } AirspyHFInput::~AirspyHFInput() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &AirspyHFInput::networkManagerFinished + ); delete m_networkManager; if (m_running) { diff --git a/plugins/samplesource/audioinput/audioinput.cpp b/plugins/samplesource/audioinput/audioinput.cpp index 959e2d955..331756388 100644 --- a/plugins/samplesource/audioinput/audioinput.cpp +++ b/plugins/samplesource/audioinput/audioinput.cpp @@ -49,12 +49,22 @@ AudioInput::AudioInput(DeviceAPI *deviceAPI) : openDevice(); m_deviceAPI->setNbSourceStreams(1); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &AudioInput::networkManagerFinished + ); } AudioInput::~AudioInput() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &AudioInput::networkManagerFinished + ); delete m_networkManager; if (m_running) { diff --git a/plugins/samplesource/bladerf1input/bladerf1input.cpp b/plugins/samplesource/bladerf1input/bladerf1input.cpp index dd6f9c5fa..22131c23c 100644 --- a/plugins/samplesource/bladerf1input/bladerf1input.cpp +++ b/plugins/samplesource/bladerf1input/bladerf1input.cpp @@ -52,12 +52,22 @@ Bladerf1Input::Bladerf1Input(DeviceAPI *deviceAPI) : m_deviceAPI->setBuddySharedPtr(&m_sharedParams); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &Bladerf1Input::networkManagerFinished + ); } Bladerf1Input::~Bladerf1Input() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &Bladerf1Input::networkManagerFinished + ); delete m_networkManager; if (m_running) { diff --git a/plugins/samplesource/bladerf2input/bladerf2input.cpp b/plugins/samplesource/bladerf2input/bladerf2input.cpp index 60a2b9f12..b334f28f9 100644 --- a/plugins/samplesource/bladerf2input/bladerf2input.cpp +++ b/plugins/samplesource/bladerf2input/bladerf2input.cpp @@ -66,12 +66,22 @@ BladeRF2Input::BladeRF2Input(DeviceAPI *deviceAPI) : m_deviceAPI->setNbSourceStreams(1); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &BladeRF2Input::networkManagerFinished + ); } BladeRF2Input::~BladeRF2Input() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &BladeRF2Input::networkManagerFinished + ); delete m_networkManager; if (m_running) { diff --git a/plugins/samplesource/fcdpro/fcdproinput.cpp b/plugins/samplesource/fcdpro/fcdproinput.cpp index c12c80d57..de7be3e72 100644 --- a/plugins/samplesource/fcdpro/fcdproinput.cpp +++ b/plugins/samplesource/fcdpro/fcdproinput.cpp @@ -50,12 +50,22 @@ FCDProInput::FCDProInput(DeviceAPI *deviceAPI) : openDevice(); m_deviceAPI->setNbSourceStreams(1); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &FCDProInput::networkManagerFinished + ); } FCDProInput::~FCDProInput() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &FCDProInput::networkManagerFinished + ); delete m_networkManager; if (m_running) { diff --git a/plugins/samplesource/fcdproplus/fcdproplusinput.cpp b/plugins/samplesource/fcdproplus/fcdproplusinput.cpp index 4690c32e9..de4d80fd4 100644 --- a/plugins/samplesource/fcdproplus/fcdproplusinput.cpp +++ b/plugins/samplesource/fcdproplus/fcdproplusinput.cpp @@ -50,12 +50,22 @@ FCDProPlusInput::FCDProPlusInput(DeviceAPI *deviceAPI) : openDevice(); m_deviceAPI->setNbSourceStreams(1); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &FCDProPlusInput::networkManagerFinished + ); } FCDProPlusInput::~FCDProPlusInput() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &FCDProPlusInput::networkManagerFinished + ); delete m_networkManager; if (m_running) { diff --git a/plugins/samplesource/fileinput/fileinput.cpp b/plugins/samplesource/fileinput/fileinput.cpp index fc2f8a55c..f35adf17a 100644 --- a/plugins/samplesource/fileinput/fileinput.cpp +++ b/plugins/samplesource/fileinput/fileinput.cpp @@ -67,7 +67,12 @@ FileInput::FileInput(DeviceAPI *deviceAPI) : qDebug("FileInput::FileInput: device source engine message queue: %p", m_deviceAPI->getDeviceEngineInputMessageQueue()); qDebug("FileInput::FileInput: device source: %p", m_deviceAPI->getDeviceSourceEngine()->getSource()); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &FileInput::networkManagerFinished + ); m_masterTimer.setTimerType(Qt::PreciseTimer); m_masterTimer.start(50); } @@ -75,7 +80,12 @@ FileInput::FileInput(DeviceAPI *deviceAPI) : FileInput::~FileInput() { m_masterTimer.stop(); - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &FileInput::networkManagerFinished + ); delete m_networkManager; stop(); diff --git a/plugins/samplesource/hackrfinput/hackrfinput.cpp b/plugins/samplesource/hackrfinput/hackrfinput.cpp index 0fd20e913..9f7b4bcd9 100644 --- a/plugins/samplesource/hackrfinput/hackrfinput.cpp +++ b/plugins/samplesource/hackrfinput/hackrfinput.cpp @@ -54,12 +54,22 @@ HackRFInput::HackRFInput(DeviceAPI *deviceAPI) : m_deviceAPI->setBuddySharedPtr(&m_sharedParams); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &HackRFInput::networkManagerFinished + ); } HackRFInput::~HackRFInput() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &HackRFInput::networkManagerFinished + ); delete m_networkManager; if (m_running) { diff --git a/plugins/samplesource/kiwisdr/kiwisdrinput.cpp b/plugins/samplesource/kiwisdr/kiwisdrinput.cpp index b9ef1b840..a935e4f48 100644 --- a/plugins/samplesource/kiwisdr/kiwisdrinput.cpp +++ b/plugins/samplesource/kiwisdr/kiwisdrinput.cpp @@ -58,12 +58,22 @@ KiwiSDRInput::KiwiSDRInput(DeviceAPI *deviceAPI) : } m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &KiwiSDRInput::networkManagerFinished + ); } KiwiSDRInput::~KiwiSDRInput() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &KiwiSDRInput::networkManagerFinished + ); delete m_networkManager; if (m_running) { diff --git a/plugins/samplesource/limesdrinput/limesdrinput.cpp b/plugins/samplesource/limesdrinput/limesdrinput.cpp index a6cc25026..01c62ec1d 100644 --- a/plugins/samplesource/limesdrinput/limesdrinput.cpp +++ b/plugins/samplesource/limesdrinput/limesdrinput.cpp @@ -65,12 +65,22 @@ LimeSDRInput::LimeSDRInput(DeviceAPI *deviceAPI) : m_deviceAPI->setNbSourceStreams(1); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &LimeSDRInput::networkManagerFinished + ); } LimeSDRInput::~LimeSDRInput() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &LimeSDRInput::networkManagerFinished + ); delete m_networkManager; if (m_running) { diff --git a/plugins/samplesource/localinput/localinput.cpp b/plugins/samplesource/localinput/localinput.cpp index 656c0921e..90d724021 100644 --- a/plugins/samplesource/localinput/localinput.cpp +++ b/plugins/samplesource/localinput/localinput.cpp @@ -50,12 +50,22 @@ LocalInput::LocalInput(DeviceAPI *deviceAPI) : m_deviceAPI->setNbSourceStreams(1); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &LocalInput::networkManagerFinished + ); } LocalInput::~LocalInput() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &LocalInput::networkManagerFinished + ); delete m_networkManager; stop(); } diff --git a/plugins/samplesource/localinput/localinputgui.cpp b/plugins/samplesource/localinput/localinputgui.cpp index 6b40eb63b..3221a3de9 100644 --- a/plugins/samplesource/localinput/localinputgui.cpp +++ b/plugins/samplesource/localinput/localinputgui.cpp @@ -90,17 +90,12 @@ LocalInputGui::LocalInputGui(DeviceUISet *deviceUISet, QWidget* parent) : connect(&m_inputMessageQueue, SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()), Qt::QueuedConnection); m_sampleSource->setMessageQueueToGUI(&m_inputMessageQueue); - m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); - m_forceSettings = true; sendSettings(); } LocalInputGui::~LocalInputGui() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); - delete m_networkManager; delete ui; } diff --git a/plugins/samplesource/localinput/localinputgui.h b/plugins/samplesource/localinput/localinputgui.h index b0f035498..0f5472d3e 100644 --- a/plugins/samplesource/localinput/localinputgui.h +++ b/plugins/samplesource/localinput/localinputgui.h @@ -20,7 +20,6 @@ #include #include -#include #include "device/devicegui.h" #include "util/messagequeue.h" @@ -28,7 +27,6 @@ #include "localinput.h" class DeviceUISet; -class QNetworkAccessManager; class QNetworkReply; class QJsonObject; @@ -96,9 +94,6 @@ private: QPalette m_paletteGreenText; QPalette m_paletteWhiteText; - QNetworkAccessManager *m_networkManager; - QNetworkRequest m_networkRequest; - void blockApplySettings(bool block); void displaySettings(); void displayTime(); diff --git a/plugins/samplesource/perseus/perseusinput.cpp b/plugins/samplesource/perseus/perseusinput.cpp index ac513c609..d3d2b3e0b 100644 --- a/plugins/samplesource/perseus/perseusinput.cpp +++ b/plugins/samplesource/perseus/perseusinput.cpp @@ -47,12 +47,22 @@ PerseusInput::PerseusInput(DeviceAPI *deviceAPI) : m_deviceAPI->setNbSourceStreams(1); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &PerseusInput::networkManagerFinished + ); } PerseusInput::~PerseusInput() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &PerseusInput::networkManagerFinished + ); delete m_networkManager; } diff --git a/plugins/samplesource/plutosdrinput/plutosdrinput.cpp b/plugins/samplesource/plutosdrinput/plutosdrinput.cpp index fab22183b..6f80db9d8 100644 --- a/plugins/samplesource/plutosdrinput/plutosdrinput.cpp +++ b/plugins/samplesource/plutosdrinput/plutosdrinput.cpp @@ -65,12 +65,22 @@ PlutoSDRInput::PlutoSDRInput(DeviceAPI *deviceAPI) : m_deviceAPI->setNbSourceStreams(1); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &PlutoSDRInput::networkManagerFinished + ); } PlutoSDRInput::~PlutoSDRInput() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &PlutoSDRInput::networkManagerFinished + ); delete m_networkManager; suspendBuddies(); closeDevice(); diff --git a/plugins/samplesource/remoteinput/remoteinput.cpp b/plugins/samplesource/remoteinput/remoteinput.cpp index 8dcf47bef..3328e248d 100644 --- a/plugins/samplesource/remoteinput/remoteinput.cpp +++ b/plugins/samplesource/remoteinput/remoteinput.cpp @@ -65,12 +65,22 @@ RemoteInput::RemoteInput(DeviceAPI *deviceAPI) : m_deviceAPI->setNbSourceStreams(1); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &RemoteInput::networkManagerFinished + ); } RemoteInput::~RemoteInput() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &RemoteInput::networkManagerFinished + ); delete m_networkManager; stop(); delete m_remoteInputUDPHandler; diff --git a/plugins/samplesource/rtlsdr/rtlsdrinput.cpp b/plugins/samplesource/rtlsdr/rtlsdrinput.cpp index 90bfd392c..64b7a1dd7 100644 --- a/plugins/samplesource/rtlsdr/rtlsdrinput.cpp +++ b/plugins/samplesource/rtlsdr/rtlsdrinput.cpp @@ -62,12 +62,22 @@ RTLSDRInput::RTLSDRInput(DeviceAPI *deviceAPI) : m_deviceAPI->setNbSourceStreams(1); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &RTLSDRInput::networkManagerFinished + ); } RTLSDRInput::~RTLSDRInput() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &RTLSDRInput::networkManagerFinished + ); delete m_networkManager; if (m_running) { diff --git a/plugins/samplesource/sdrplay/sdrplayinput.cpp b/plugins/samplesource/sdrplay/sdrplayinput.cpp index 74f347507..7b0599d72 100644 --- a/plugins/samplesource/sdrplay/sdrplayinput.cpp +++ b/plugins/samplesource/sdrplay/sdrplayinput.cpp @@ -55,12 +55,22 @@ SDRPlayInput::SDRPlayInput(DeviceAPI *deviceAPI) : m_deviceAPI->setNbSourceStreams(1); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &SDRPlayInput::networkManagerFinished + ); } SDRPlayInput::~SDRPlayInput() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &SDRPlayInput::networkManagerFinished + ); delete m_networkManager; if (m_running) { diff --git a/plugins/samplesource/sdrplayv3/sdrplayv3input.cpp b/plugins/samplesource/sdrplayv3/sdrplayv3input.cpp index 9397875b8..df8265b7c 100644 --- a/plugins/samplesource/sdrplayv3/sdrplayv3input.cpp +++ b/plugins/samplesource/sdrplayv3/sdrplayv3input.cpp @@ -55,12 +55,22 @@ SDRPlayV3Input::SDRPlayV3Input(DeviceAPI *deviceAPI) : m_deviceAPI->setNbSourceStreams(1); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &SDRPlayV3Input::networkManagerFinished + ); } SDRPlayV3Input::~SDRPlayV3Input() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &SDRPlayV3Input::networkManagerFinished + ); delete m_networkManager; if (m_running) { diff --git a/plugins/samplesource/sigmffileinput/sigmffileinput.cpp b/plugins/samplesource/sigmffileinput/sigmffileinput.cpp index 9f38aeb05..63f8af446 100644 --- a/plugins/samplesource/sigmffileinput/sigmffileinput.cpp +++ b/plugins/samplesource/sigmffileinput/sigmffileinput.cpp @@ -83,7 +83,12 @@ SigMFFileInput::SigMFFileInput(DeviceAPI *deviceAPI) : qDebug("SigMFFileInput::SigMFFileInput: device source engine message queue: %p", m_deviceAPI->getDeviceEngineInputMessageQueue()); qDebug("SigMFFileInput::SigMFFileInput: device source: %p", m_deviceAPI->getDeviceSourceEngine()->getSource()); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &SigMFFileInput::networkManagerFinished + ); m_masterTimer.setTimerType(Qt::PreciseTimer); m_masterTimer.start(50); } @@ -91,7 +96,12 @@ SigMFFileInput::SigMFFileInput(DeviceAPI *deviceAPI) : SigMFFileInput::~SigMFFileInput() { m_masterTimer.stop(); - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &SigMFFileInput::networkManagerFinished + ); delete m_networkManager; stop(); diff --git a/plugins/samplesource/soapysdrinput/soapysdrinput.cpp b/plugins/samplesource/soapysdrinput/soapysdrinput.cpp index 83d68637c..3eaa5dc37 100644 --- a/plugins/samplesource/soapysdrinput/soapysdrinput.cpp +++ b/plugins/samplesource/soapysdrinput/soapysdrinput.cpp @@ -56,12 +56,22 @@ SoapySDRInput::SoapySDRInput(DeviceAPI *deviceAPI) : m_deviceAPI->setNbSourceStreams(1); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &SoapySDRInput::networkManagerFinished + ); } SoapySDRInput::~SoapySDRInput() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &SoapySDRInput::networkManagerFinished + ); delete m_networkManager; if (m_running) { diff --git a/plugins/samplesource/testsource/testsourceinput.cpp b/plugins/samplesource/testsource/testsourceinput.cpp index 6b861d7b3..ec035d365 100644 --- a/plugins/samplesource/testsource/testsourceinput.cpp +++ b/plugins/samplesource/testsource/testsourceinput.cpp @@ -55,12 +55,22 @@ TestSourceInput::TestSourceInput(DeviceAPI *deviceAPI) : m_testSourceWorker->moveToThread(&m_testSourceWorkerThread); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &TestSourceInput::networkManagerFinished + ); } TestSourceInput::~TestSourceInput() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &TestSourceInput::networkManagerFinished + ); delete m_networkManager; if (m_running) { diff --git a/plugins/samplesource/usrpinput/usrpinput.cpp b/plugins/samplesource/usrpinput/usrpinput.cpp index 0767e0528..2407a786e 100644 --- a/plugins/samplesource/usrpinput/usrpinput.cpp +++ b/plugins/samplesource/usrpinput/usrpinput.cpp @@ -68,12 +68,22 @@ USRPInput::USRPInput(DeviceAPI *deviceAPI) : m_deviceAPI->setNbSourceStreams(1); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &USRPInput::networkManagerFinished + ); } USRPInput::~USRPInput() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &USRPInput::networkManagerFinished + ); delete m_networkManager; if (m_running) { diff --git a/plugins/samplesource/xtrxinput/xtrxinput.cpp b/plugins/samplesource/xtrxinput/xtrxinput.cpp index c226015ed..7f472c03f 100644 --- a/plugins/samplesource/xtrxinput/xtrxinput.cpp +++ b/plugins/samplesource/xtrxinput/xtrxinput.cpp @@ -57,12 +57,22 @@ XTRXInput::XTRXInput(DeviceAPI *deviceAPI) : m_deviceAPI->setNbSourceStreams(1); m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &XTRXInput::networkManagerFinished + ); } XTRXInput::~XTRXInput() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &XTRXInput::networkManagerFinished + ); delete m_networkManager; if (m_running) { diff --git a/sdrbase/channel/channelapi.h b/sdrbase/channel/channelapi.h index b341d41c5..8a2b0e8e5 100644 --- a/sdrbase/channel/channelapi.h +++ b/sdrbase/channel/channelapi.h @@ -144,14 +144,13 @@ public: Message* message; while ((message = messageQueue->pop()) != nullptr) { - m_channelMessageQueue.push(message); + m_inputMessageQueue.push(message); } } protected: virtual bool handleMessage(const Message& cmd) = 0; //!< Processing of a message. Returns true if message has actually been processed MessageQueue *m_guiMessageQueue; //!< Input message queue to the GUI - MessageQueue m_channelMessageQueue; //!< Input message queue for inter plugin communication MessageQueue m_inputMessageQueue; //!< Queue for asynchronous inbound communication protected slots: diff --git a/sdrbase/util/flightinformation.cpp b/sdrbase/util/flightinformation.cpp index 34470097e..6bc3df40b 100644 --- a/sdrbase/util/flightinformation.cpp +++ b/sdrbase/util/flightinformation.cpp @@ -54,12 +54,22 @@ AviationStack::AviationStack(const QString& apiKey) : m_apiKey(apiKey) { m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(handleReply(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &AviationStack::handleReply + ); } AviationStack::~AviationStack() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(handleReply(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &AviationStack::handleReply + ); delete m_networkManager; } diff --git a/sdrbase/util/planespotters.cpp b/sdrbase/util/planespotters.cpp index 6e5401ffc..b9aa24467 100644 --- a/sdrbase/util/planespotters.cpp +++ b/sdrbase/util/planespotters.cpp @@ -28,12 +28,22 @@ PlaneSpotters::PlaneSpotters() { m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(handleReply(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &PlaneSpotters::handleReply + ); } PlaneSpotters::~PlaneSpotters() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(handleReply(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &PlaneSpotters::handleReply + ); delete m_networkManager; } diff --git a/sdrbase/util/weather.cpp b/sdrbase/util/weather.cpp index d92f6d281..ca1482a55 100644 --- a/sdrbase/util/weather.cpp +++ b/sdrbase/util/weather.cpp @@ -68,12 +68,22 @@ OpenWeatherMap::OpenWeatherMap(const QString& apiKey) : m_apiKey(apiKey) { m_networkManager = new QNetworkAccessManager(); - connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(handleReply(QNetworkReply*))); + QObject::connect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &OpenWeatherMap::handleReply + ); } OpenWeatherMap::~OpenWeatherMap() { - disconnect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(handleReply(QNetworkReply*))); + QObject::disconnect( + m_networkManager, + &QNetworkAccessManager::finished, + this, + &OpenWeatherMap::handleReply + ); delete m_networkManager; }