From d7bc821433445b1e43050f2d4b185e5f1abe1339 Mon Sep 17 00:00:00 2001 From: Ladislav Foldyna Date: Wed, 29 May 2024 17:38:16 +0200 Subject: [PATCH] Fixed #377 - Callbook query does not work --- core/HamQTH.cpp | 6 ++++-- core/QRZ.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/HamQTH.cpp b/core/HamQTH.cpp index 73a29075..741364df 100644 --- a/core/HamQTH.cpp +++ b/core/HamQTH.cpp @@ -97,8 +97,6 @@ void HamQTH::queryCallsign(const QString &callsign) return; } - queuedCallsign = ""; - QUrlQuery query; query.addQueryItem("id", sessionId); query.addQueryItem("callsign", callsign); @@ -114,6 +112,10 @@ void HamQTH::queryCallsign(const QString &callsign) currentReply = nam->get(QNetworkRequest(url)); currentReply->setProperty("queryCallsign", callsign); + + // Attention, variable callsign and queuedCallsign point to the same object + // queuedCallsign must be cleared after the last use of the callsign variable + queuedCallsign = QString(); } void HamQTH::abortQuery() diff --git a/core/QRZ.cpp b/core/QRZ.cpp index 3ff3edd7..1ae9cb48 100644 --- a/core/QRZ.cpp +++ b/core/QRZ.cpp @@ -57,8 +57,6 @@ void QRZ::queryCallsign(const QString &callsign) return; } - queuedCallsign = ""; - QUrlQuery query; query.addQueryItem("s", sessionId); @@ -86,6 +84,10 @@ void QRZ::queryCallsign(const QString &callsign) currentReply = nam->get(QNetworkRequest(url)); currentReply->setProperty("queryCallsign", QVariant(callsign)); currentReply->setProperty("messageType", QVariant("callsignInfoQuery")); + + // Attention, variable callsign and queuedCallsign point to the same object + // queuedCallsign must be cleared after the last use of the callsign variable + queuedCallsign = QString(); } void QRZ::abortQuery()