Commit d792c64f authored by Urs Wolfer's avatar Urs Wolfer

properly handle connection errors with xfreerdp > 1.0

- check all output lines instead of stopping at first empty line (1.2 messages contain empty lines)
- check against new message spelling (tested against 1.2)

CCBUG: 341284
parent 1cd751ac
......@@ -447,10 +447,8 @@ void RdpView::receivedStandardOutput()
{
const QString output(m_process->readAllStandardOutput());
kDebug(5012) << output;
QString line;
int i = 0;
while (!(line = output.section('\n', i, i)).isEmpty()) {
QStringList splittedOutput = output.split('\n');
Q_FOREACH (const QString &line, splittedOutput) {
// full xfreerdp message: "transport_connect: getaddrinfo (Name or service not known)"
if (line.contains(QLatin1String("Name or service not known"))) {
KMessageBox::error(0, i18n("Name or service not known."),
......@@ -467,14 +465,13 @@ void RdpView::receivedStandardOutput()
// looks like some generic xfreerdp error message, handle it if nothing was handled:
// "Error: protocol security negotiation failure"
} else if (line.contains(QLatin1String("Error: protocol security negotiation failure"))) {
} else if (line.contains(QLatin1String("Error: protocol security negotiation failure")) || // xfreerdp 1.0
line.contains(QLatin1String("Error: protocol security negotiation or connection failure"))) { // xfreerdp 1.2
KMessageBox::error(0, i18n("Connection attempt to host failed."),
i18n("Connection Failure"));
connectionError();
return;
}
i++;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment