| 2662 | } |
| 2663 | |
| 2664 | void MainWindow::ipcCloseConnected() { |
| 2665 | QString idPath = configPath + "/id/"; |
| 2666 | QDir dir(idPath); |
| 2667 | QStringList clients = dir.entryList(QDir::Filter::Files); |
| 2668 | int delay = 100; |
| 2669 | |
| 2670 | foreach (const QString &id, clients) { |
| 2671 | QFile file(idPath + id); |
| 2672 | if (file.open(QIODevice::ReadOnly)) { |
| 2673 | QTextStream stream(&file); |
| 2674 | QString pid = stream.readLine(); |
| 2675 | if (!isProcRunning(static_cast<pid_t>(pid.toLongLong()))) { |
| 2676 | file.close(); |
| 2677 | file.remove(); |
| 2678 | continue; |
| 2679 | } else { |
| 2680 | if (opts.pidString != pid) { |
| 2681 | QByteArray byteArray; |
| 2682 | QDataStream dataStream(&byteArray, QIODevice::WriteOnly); |
| 2683 | dataStream.setVersion(QDataStream::Qt_5_5); |
| 2684 | unsigned int type = IPC_CLOSE; |
| 2685 | stream << type; |
| 2686 | |
| 2687 | com.clientSetup(pid); |
| 2688 | com.send(byteArray); |
| 2689 | delay += 100; |
| 2690 | } |
| 2691 | } |
| 2692 | } |
| 2693 | file.close(); |
| 2694 | } |
| 2695 | |
| 2696 | // wait for the settings to be written by the other processes |
| 2697 | guiDelay(delay); |
| 2698 | } |
| 2699 | |
| 2700 | void MainWindow::ipcReceived() { |
| 2701 | QByteArray byteArray(com.getData()); |
nothing calls this directly
no test coverage detected