More robust handling of imported ADIF records

Some logging  applications export the  BAND ADIF field  with uppercase
characters. This  change makes  sure that  the internal  worked before
lookup indexes use uppercase throughout when fields that can come from
external sources are stored.
This commit is contained in:
Bill Somerville
2018-11-29 00:56:53 +00:00
parent 5741407070
commit 4b4f65eb9f
3 changed files with 31 additions and 30 deletions
+3 -3
View File
@@ -136,12 +136,12 @@ namespace Radio
// the full call if no valid prefix (or prefix as a suffix) is specified
QString effective_prefix (QString callsign)
{
auto prefix = callsign.toUpper ();
auto prefix = callsign;
auto slash_pos = callsign.indexOf ('/');
if (slash_pos >= 0)
{
auto right_size = callsign.size () - slash_pos - 1;
if (right_size >= slash_pos) // naive call is longer than
if (right_size >= slash_pos) // native call is longer than
// prefix/suffix algorithm
{
prefix = callsign.left (slash_pos);
@@ -157,6 +157,6 @@ namespace Radio
}
}
}
return prefix;
return prefix.toUpper ();
}
}