MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / browsePipePath

Method browsePipePath

app/src/IO/Drivers/Process.cpp:411–430  ·  view source on GitHub ↗

* @brief Opens a file dialog to select the named pipe / FIFO path. */

Source from the content-addressed store, hash-verified

409 * @brief Opens a file dialog to select the named pipe / FIFO path.
410 */
411void IO::Drivers::Process::browsePipePath()
412{
413 const auto start = m_pipePath.isEmpty()
414 ? QStandardPaths::writableLocation(QStandardPaths::HomeLocation)
415 : QFileInfo(m_pipePath).absolutePath();
416
417 auto* dialog = new QFileDialog(qApp->activeWindow(), tr("Select Named Pipe / FIFO"), start);
418
419 dialog->setFileMode(QFileDialog::ExistingFile);
420 dialog->setAttribute(Qt::WA_DeleteOnClose);
421
422 connect(dialog, &QFileDialog::fileSelected, this, [this](const QString& path) {
423 if (path.isEmpty())
424 return;
425
426 QMetaObject::invokeMethod(this, [this, path]() { setPipePath(path); }, Qt::QueuedConnection);
427 });
428
429 dialog->open();
430}
431
432/**
433 * @brief Enumerates running processes and updates the runningProcesses list.

Callers

nothing calls this directly

Calls 3

isEmptyMethod · 0.80
activeWindowMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected