| 459 | } |
| 460 | |
| 461 | void CoreProcess::checkLogLine(const QString &line) |
| 462 | { |
| 463 | using enum ConnectionState; |
| 464 | |
| 465 | if (line.contains("connected to server") || line.contains("has connected")) { |
| 466 | m_connections++; |
| 467 | setConnectionState(Connected); |
| 468 | } else if (line.contains("started server")) { |
| 469 | m_connections = 0; |
| 470 | setConnectionState(Listening); |
| 471 | } else if (line.contains("disconnected from server") || line.contains("process exited")) { |
| 472 | m_connections = 0; |
| 473 | setConnectionState(Disconnected); |
| 474 | } else if (line.contains("connecting to")) { |
| 475 | setConnectionState(Connecting); |
| 476 | } else if (line.contains("has disconnected")) { |
| 477 | m_connections--; |
| 478 | if (m_connections < 1) { |
| 479 | setConnectionState(Listening); |
| 480 | } |
| 481 | } |
| 482 | |
| 483 | checkSecureSocket(line); |
| 484 | |
| 485 | // server and client processes are not allowed to show notifications. |
| 486 | // process the log from it and show notification from deskflow instead. |
| 487 | #ifdef Q_OS_MACOS |
| 488 | checkOSXNotification(line); |
| 489 | #endif |
| 490 | } |
| 491 | |
| 492 | bool CoreProcess::checkSecureSocket(const QString &line) |
| 493 | { |