Skip to content

Commit

Permalink
Fixed #199 - FLDIGI cannot connect QLog
Browse files Browse the repository at this point in the history
It seems that XML that is generated by FLDIGI
contains Processing Instruction (clientid)
without mandatory space.

QLog adds this extra space when it is missing.
  • Loading branch information
foldynl committed May 2, 2023
1 parent 3b00032 commit d27ec78
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changelog
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ TBC - 0.22.0
- Fixed ADIF import (issue #196)
- Fixed Operator field is incorrectly used (issue #197)
- Fixed Crash if an unknown POTA & SOTA/WWFF Setting is entered (issue #198)
- Fixed FLDIGI cannot connect QLog (issue #199)
- Fixed if ADIF record is missing band info, add this from freq field (thx DJ5CW)

2023/04/16 - 0.21.0
Expand Down
9 changes: 8 additions & 1 deletion core/Fldigi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ void Fldigi::readClient() {
int split = data.indexOf("\r\n\r\n", 0);
data.remove(0, split+4);

/* WORKAROUND - FLDIGI has probably an issue. It seems that XML
* that is generated by FLDIGI contains Processing Instruction (clientid)
* without mandatory space */
data.replace("<?clientid=", "<?clientid =");

QXmlStreamReader xml(data);
processMethodCall(sock, xml);

Expand All @@ -63,23 +68,25 @@ void Fldigi::processMethodCall(QTcpSocket* sock, QXmlStreamReader& xml) {

while (!xml.atEnd() && !xml.hasError()) {
xml.readNextStartElement();

if (xml.name() == QString("methodCall"))
{
qCDebug(runtime) << "method call";
}

if (xml.name() == QString("methodName"))
{
qCDebug(runtime) << "methodName";
QString method = xml.readElementText();

if (method == "log.add_record") {
qCDebug(runtime) << "log.add_record";
QString param = parseParam(xml);
if (!param.isEmpty()) {
response = addRecord(param);
}
}
else if (method == "system.listMethods") {
qCDebug(runtime) << "system.listMethods";
response = listMethods();
}
}
Expand Down

0 comments on commit d27ec78

Please sign in to comment.