| 460 | } |
| 461 | |
| 462 | QString 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 |
no test coverage detected