From 6c6233029422b5d0d438424013b839a06a66bbec Mon Sep 17 00:00:00 2001 From: Stefan Appelhoff Date: Thu, 26 Mar 2026 12:43:37 +0100 Subject: [PATCH] fix: error on empty Study Root to prevent silent recording failure --- src/mainwindow.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index aec937f..7f9bb19 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -181,7 +181,7 @@ void MainWindow::load_config(QString filename) { // StorageLocation QString studyRoot; legacyTemplate.clear(); - + if (pt.contains("StorageLocation")) { if (pt.contains("StudyRoot")) throw std::runtime_error("StorageLocation cannot be used if StudyRoot is also specified."); @@ -400,6 +400,12 @@ void MainWindow::startRecording() { QMessageBox::critical(this, "Filename empty", "Can not record without a file name"); return; } + if (ui->rootEdit->text().trimmed().isEmpty()) { + QMessageBox::critical(this, "Study Root empty", + "Can not record without a Study Root folder. " + "Please set a Study Root before recording."); + return; + } recFilename.prepend(QDir::cleanPath(ui->rootEdit->text()) + '/'); QFileInfo recFileInfo(recFilename); @@ -431,7 +437,7 @@ void MainWindow::startRecording() { ". Please check your permissions."); return; } - + std::vector watchfor; for (const QString &missing : std::as_const(missingStreams)) { std::string query;