diff --git a/source/window.cpp b/source/window.cpp index 2800a1d..a514f77 100644 --- a/source/window.cpp +++ b/source/window.cpp @@ -557,16 +557,21 @@ void Window::watch(const QString& str) chosenDir.setNameFilters(filters); QStringList dirFiles = chosenDir.entryList(); - // persistent storage of filenames for status bar - displayNames = dirFiles; + if (dirFiles.length() == 0) { + qDebug() << "No .omf or .ovf files were found in the specified directory. Waiting for input."; + ui->statusbar->showMessage("No .omf or .ovf files were found in the specified directory. Waiting for input."); + } else { + // persistent storage of filenames for status bar + displayNames = dirFiles; + filenames.clear(); + foreach (QString file, dirFiles) { + filenames.push_back(dirString + file); + } - foreach (QString file, dirFiles) { - filenames.push_back(dirString + file); + processFilenames(); + gotoBackOfCache(); } - processFilenames(); - gotoBackOfCache(); - connect(watcher, SIGNAL(directoryChanged(QString)), this, SLOT(updateWatchedFiles())); }