From cabb7cc4537a3ab2995ff5d23a167f2eb3576f47 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Wed, 2 Aug 2017 23:20:35 +0000 Subject: [PATCH] Add a rule to deal with KG4 calls not in Gitmo The AD1C cty.dat file does not resolve KG4 2x1 and 2x3 calls correctly, any that map to Gitmo are really mainland U.S. and this change does that. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7990 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- displaytext.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/displaytext.cpp b/displaytext.cpp index 6f181b56d..8cd763a56 100644 --- a/displaytext.cpp +++ b/displaytext.cpp @@ -89,7 +89,7 @@ QString DisplayText::_appendDXCCWorkedB4(QString message, QString const& callsig call=call.mid(0,i0); } if(call.length()<3) return message; - if(!call.contains(QRegExp("[0-9]")) or !call.contains(QRegExp("[A-Z]"))) return message; + if(!call.contains(QRegExp("[0-9]|[A-Z]"))) return message; logBook.match(/*in*/call,/*out*/countryName,callWorkedBefore,countryWorkedBefore); int charsAvail = 48; @@ -144,6 +144,17 @@ QString DisplayText::_appendDXCCWorkedB4(QString message, QString const& callsig countryName.replace ("Asiatic", "AS"); countryName.replace ("European", "EU"); countryName.replace ("African", "AF"); + + // + // deal with special rules that cty.dat does not cope with + // + + // KG4 2x1 and 2x3 calls that map to Gitmo are mainland US not Gitmo + if (call.startsWith ("KG4") && call.size () != 5) + { + countryName.replace ("Guantanamo Bay", "U.S.A."); + } + message += countryName; } return message;