MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / clientConnectionStatusMessage

Function clientConnectionStatusMessage

src/gui/MainWindowHelpers.cpp:462–486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

460}
461
462QString clientConnectionStatusMessage(quint32 handle,
463 const QString& source,
464 const QString& station,
465 const QString& program)
466{
467 QString from = cleanClientDisplayText(source);
468 const QString stationText = cleanClientDisplayText(station);
469 const QString programText = cleanClientDisplayText(program);
470 QString detail = stationText;
471
472 if (detail.isEmpty() || detail.compare(QStringLiteral("Unknown"), Qt::CaseInsensitive) == 0)
473 detail = programText;
474 if (detail.compare(QStringLiteral("Unknown"), Qt::CaseInsensitive) == 0)
475 detail.clear();
476
477 if (from.isEmpty())
478 from = detail;
479 if (from.isEmpty())
480 from = QStringLiteral("client 0x%1").arg(handle, 8, 16, QChar('0')).toUpper();
481
482 if (!detail.isEmpty() && detail.compare(from, Qt::CaseInsensitive) != 0)
483 return QObject::tr("New client connection from %1 (%2)").arg(from, detail);
484
485 return QObject::tr("New client connection from %1").arg(from);
486}
487
488} // namespace AetherSDR

Callers 1

MainWindowMethod · 0.85

Calls 3

cleanClientDisplayTextFunction · 0.85
isEmptyMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected