Skip to content

Commit 010b54c

Browse files
authored
Merge pull request #140 from sappelhoff/studyroot
fix: error on empty Study Root to prevent silent recording failure
2 parents 6d65fa9 + 6c62330 commit 010b54c

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/mainwindow.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ void MainWindow::load_config(QString filename) {
181181
// StorageLocation
182182
QString studyRoot;
183183
legacyTemplate.clear();
184-
184+
185185
if (pt.contains("StorageLocation")) {
186186
if (pt.contains("StudyRoot"))
187187
throw std::runtime_error("StorageLocation cannot be used if StudyRoot is also specified.");
@@ -400,6 +400,12 @@ void MainWindow::startRecording() {
400400
QMessageBox::critical(this, "Filename empty", "Can not record without a file name");
401401
return;
402402
}
403+
if (ui->rootEdit->text().trimmed().isEmpty()) {
404+
QMessageBox::critical(this, "Study Root empty",
405+
"Can not record without a Study Root folder. "
406+
"Please set a Study Root before recording.");
407+
return;
408+
}
403409
recFilename.prepend(QDir::cleanPath(ui->rootEdit->text()) + '/');
404410

405411
QFileInfo recFileInfo(recFilename);
@@ -431,7 +437,7 @@ void MainWindow::startRecording() {
431437
". Please check your permissions.");
432438
return;
433439
}
434-
440+
435441
std::vector<std::string> watchfor;
436442
for (const QString &missing : std::as_const(missingStreams)) {
437443
std::string query;

0 commit comments

Comments
 (0)