| 15 | namespace deskflow::gui { |
| 16 | |
| 17 | void ClientConnection::handleLogLine(const QString &logLine) |
| 18 | { |
| 19 | if (logLine.contains("disconnected from server")) { |
| 20 | m_supressMessage = false; |
| 21 | return; |
| 22 | } |
| 23 | |
| 24 | if (logLine.contains("connected to server")) { |
| 25 | m_supressMessage = true; |
| 26 | return; |
| 27 | } |
| 28 | |
| 29 | if (logLine.contains("failed to connect to server")) { |
| 30 | if (m_supressMessage) { |
| 31 | qDebug("message already shown, skipping"); |
| 32 | return; |
| 33 | } |
| 34 | // ignore the message if it's about the server refusing by name as |
| 35 | // this will trigger the server to show an 'add client' dialog. |
| 36 | if (logLine.contains("server refused client with our name")) { |
| 37 | qDebug("ignoring client name refused message"); |
| 38 | return; |
| 39 | } |
| 40 | showMessage(logLine); |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | void ClientConnection::showMessage(const QString &logLine) |
| 45 | { |