Fixed leading whitespace issue for buffered commands
This commit is contained in:
parent
eca184bac6
commit
a6771b81c3
@ -258,6 +258,16 @@ namespace
|
|||||||
}
|
}
|
||||||
return "";
|
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
|
//--------------------------------------------------- MainWindow constructor
|
||||||
@ -456,6 +466,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple,
|
|||||||
m_previousFreq {0}
|
m_previousFreq {0}
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
createStatusBar();
|
createStatusBar();
|
||||||
add_child_to_event_filter (this);
|
add_child_to_event_filter (this);
|
||||||
ui->dxGridEntry->setValidator (new MaidenheadLocatorValidator {this});
|
ui->dxGridEntry->setValidator (new MaidenheadLocatorValidator {this});
|
||||||
@ -5733,6 +5744,8 @@ QPair<QStringList, QStringList> MainWindow::buildFT8MessageFrames(QString const&
|
|||||||
line = line.mid(n);
|
line = line.mid(n);
|
||||||
|
|
||||||
if(Varicode::isCommandBuffered(dirCmd) && !line.isEmpty()){
|
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...
|
// 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;
|
qDebug() << "generating checksum for line" << line;
|
||||||
line = line + " " + Varicode::checksum16(line);
|
line = line + " " + Varicode::checksum16(line);
|
||||||
|
Loading…
Reference in New Issue
Block a user