On 06/01/2016 23:08, Bill Somerville wrote:
> // send telemetry to HAB server if required
>       // will send the RX station callsign, grid, frequency and JT9/65 
> string
>       decodedtext.deCallAndGrid(/*out*/dx_call,dx_grid);
>       if (decodedtext.isJT9 ()
>           && m_config.spot_to_snus_reporter ()
>           && stdMsg
>           && !m_diskData) {
>         QString dx_call;
>         QString dx_grid;
>         if (gridChanged(dx_call,dx_grid)) {
>           Frequency frequency = m_dialFreq + 
> decodedtext.frequencyOffset();
>           QUrlQuery q;
>           q.addQueryItem("callsign",  m_config.my_callsign());
>           q.addQueryItem("grid",  m_config.my_grid());
>           q.addQueryItem("frequency", QString::number(frequency));
>           q.addQueryItem("data", decodedtext.string().replace("+", 
> "%2B"));
>           q.addQueryItem("version", version());
>           auto request = QNetworkRequest 
> {{"http://vps.comms.net.au/snus.php"}};
>           request.setHeader (QNetworRequest::ContentTypeHeader, 
> "application/x-www-form-urlencoded");
>           auto * reply = m_network_manager->post (request, 
> post_data.toString (QUrl::FullyEncoded).toUtf8 ());
>           connect (reply, &QNetworkReply::finished, [this, reply] () {
>               if (reply->error ()) {
>                 QMessageBox::warning (this, tr ("Network Error"),
>                                       tr ("failed to send spot to SNUS 
> server:\n%1\n%2")
>                                       .arg (reply->url 
> ().toDisplayString ())
>                                       .arg (reply->errorString ());
>                                       );
>                 reply->deleteLater ();
>               });
>             }
>         }
>       }

Sorry, as usual my email client failed to spot the errors in my code :( 
Better something like:

> // send telemetry to HAB server if required
>       // will send the RX station callsign, grid, frequency and JT9/65 
> string
>       decodedtext.deCallAndGrid(/*out*/dx_call,dx_grid);
>       if (decodedtext.isJT9 ()
>           && m_config.spot_to_snus_reporter ()
>           && stdMsg
>           && !m_diskData) {
>         QString dx_call;
>         QString dx_grid;
>         if (gridChanged(dx_call,dx_grid)) {
>           Frequency frequency = m_dialFreq + 
> decodedtext.frequencyOffset();
>           QUrlQuery q;
>           q.addQueryItem("callsign",  m_config.my_callsign());
>           q.addQueryItem("grid",  m_config.my_grid());
>           q.addQueryItem("frequency", QString::number(frequency));
>           q.addQueryItem("data", decodedtext.string().replace("+", 
> "%2B"));
>           q.addQueryItem("version", version());
>           auto request = QNetworkRequest 
> {{"http://vps.comms.net.au/snus.php"}};
>           request.setHeader (QNetworRequest::ContentTypeHeader, 
> "application/x-www-form-urlencoded");
>           auto * reply = m_network_manager->post (request, 
> post_data.toString (QUrl::FullyEncoded).toUtf8 ());
>           connect (reply, &QNetworkReply::finished, [this, reply] () {
>               if (reply->error ()) {
>                 QMessageBox::warning (this, tr ("Network Error"),
>                                       tr ("failed to send spot to SNUS 
> server:\n%1\n%2")
>                                       .arg (reply->url 
> ().toDisplayString ())
>                                       .arg (reply->errorString ());
>                                       );
>               }
>             reply->deleteLater ();
>            });
>         }
>       }

73
Bill
G4WJS.

------------------------------------------------------------------------------
_______________________________________________
wsjt-devel mailing list
wsjt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wsjt-devel

Reply via email to