Merged from trunk:

------------------------------------------------------------------------
r8081 | bsomervi | 2017-09-09 23:59:06 +0100 (Sat, 09 Sep 2017) | 1 line

Add a helpful comment
------------------------------------------------------------------------
r8082 | bsomervi | 2017-09-09 23:59:13 +0100 (Sat, 09 Sep 2017) | 3 lines

Enhance the ADIF parser to accept newlines between fields

ADIF allows any characters between fields to aid readability.
------------------------------------------------------------------------



git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx-1.8@8083 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Bill Somerville 2017-09-09 23:01:26 +00:00
parent 73b80f43f8
commit 61f42e8b01
2 changed files with 22 additions and 9 deletions

View File

@ -58,16 +58,27 @@ void ADIF::load()
QFile inputFile(_filename);
if (inputFile.open(QIODevice::ReadOnly))
{
QTextStream in(&inputFile);
while ( !in.atEnd() )
QTextStream in(&inputFile);
QString record;
// skip header record
while (!in.atEnd () && !record.contains ("<EOH>", Qt::CaseInsensitive))
{
QString line = in.readLine();
QSO q;
q.call = _extractField(line,"CALL:");
q.band = _extractField(line,"BAND:");
q.mode = _extractField(line,"MODE:");
q.date = _extractField(line,"QSO_DATE:");
if (q.call != "")
record += in.readLine ();
}
while ( !in.atEnd() )
{
record.clear ();
while (!in.atEnd () && !record.contains ("<EOR>", Qt::CaseInsensitive))
{
record += in.readLine ();
}
QSO q;
q.call = _extractField(record,"CALL:");
q.band = _extractField(record,"BAND:");
q.mode = _extractField(record,"MODE:");
q.date = _extractField(record,"QSO_DATE:");
if (q.call != "")
_data.insert(q.call,q);
}
inputFile.close();

View File

@ -4158,6 +4158,8 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional)
msgtype(t0 + "R" + rpt, ui->tx3);
}
}
// don't use short codes here as in a sked with a type 2
// prefix we would never send out prefix/suffix
msgtype(t + "73", ui->tx5->lineEdit ());
break;
}