5#include <QtCore/QCoreApplication>
6#include <QtCore/QRegularExpression>
11 return tr(
"No host address");
14 return tr(
"Invalid port");
17 static const QRegularExpression controlChars(QStringLiteral(
"[\\x00-\\x1f\\x7f]"));
18 if (
host.contains(controlChars)) {
19 return tr(
"Invalid host (contains control characters)");
21 if (
host.contains(QLatin1Char(
' '))) {
22 return tr(
"Invalid host (contains spaces)");
25 return tr(
"Invalid mountpoint name (contains control characters)");
27 if (std::ranges::any_of(
mountpoint, [](QChar c) {
return c.isSpace(); })) {
28 return tr(
"Invalid mountpoint name (contains spaces)");
31 if (
username.contains(QLatin1Char(
':'))) {
32 return tr(
"Invalid username (must not contain ':')");
44 return QCoreApplication::translate(
"NTRIPConnectionConfig",
"Select a mountpoint before connecting");
52 url.setScheme(
useTls ? QStringLiteral(
"https") : QStringLiteral(
"http"));
55 url.setPath(QLatin1Char(
'/') + (withMountpoint ?
mountpoint : QString()));
67 "Credentials are being sent without TLS encryption.")
QString streamValidationError() const
bool sendsCredentialsInClear() const
Credentials go to the caster without TLS.
QString credentialsInClearWarning() const
The user-visible warning when credentials go to the caster without TLS; empty otherwise.
QUrl url(bool withMountpoint=true) const
The caster's HTTP(S) URL, with the mountpoint as its path when withMountpoint is set,...
QString validationError() const