From a6771b81c30eabfc63c1e7f144db80fc1e49fdd6 Mon Sep 17 00:00:00 2001 From: Jordan Sherer Date: Fri, 27 Jul 2018 10:57:51 -0400 Subject: [PATCH] Fixed leading whitespace issue for buffered commands --- mainwindow.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mainwindow.cpp b/mainwindow.cpp index b2fe907..2de4e8b 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -258,6 +258,16 @@ namespace } return ""; } + + QString lstrip(const QString& str) { + int len = str.size() - 1; + for (int n = 0; n < len; n++) { + if (!str.at(n).isSpace()) { + return str.mid(n); + } + } + return ""; + } } //--------------------------------------------------- MainWindow constructor @@ -456,6 +466,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, m_previousFreq {0} { ui->setupUi(this); + createStatusBar(); add_child_to_event_filter (this); ui->dxGridEntry->setValidator (new MaidenheadLocatorValidator {this}); @@ -5733,6 +5744,8 @@ QPair MainWindow::buildFT8MessageFrames(QString const& line = line.mid(n); if(Varicode::isCommandBuffered(dirCmd) && !line.isEmpty()){ + // strip leading whitespace after a buffered directed command + line = lstrip(line); // TODO: jsherer - this is how we can add 16-bit checksum to the message, just encode it in the data... qDebug() << "generating checksum for line" << line; line = line + " " + Varicode::checksum16(line);