1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-25 04:53:27 -04:00

Morse Decoder: adeed scope and set bytes block size appropriately plus minor changes

This commit is contained in:
f4exb
2024-05-19 18:56:18 +02:00
parent 31274b1227
commit 1edaa0d98a
5 changed files with 87 additions and 60 deletions
@@ -270,16 +270,26 @@ QString MorseDecoderSettings::formatText(const QString& text)
{
// Format text
QString showText = text.simplified();
QString spaceFirst;
QString spaceLast;
if (text.size() > 3)
if (text.size() >= 2)
{
if (text.right(1)[0].isSpace()) {
showText.append(text.right(1));
spaceLast = text.right(1);
}
if (text.left(1)[0].isSpace()) {
showText = text.left(1) + showText;
spaceFirst = text.left(1);
}
}
if (spaceFirst.size() != 0) {
showText = spaceFirst + showText;
}
if (spaceLast.size() != 0) {
showText.append(spaceLast);
}
return showText;
}