From b097593e7300e8b7e9f5b160738fd3d36edbdeb2 Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Thu, 30 Dec 2021 15:11:13 +0100 Subject: [PATCH] Fix reading models from B&W radio --- companion/src/mainwindow.cpp | 2 +- companion/src/storage/sdcard.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/companion/src/mainwindow.cpp b/companion/src/mainwindow.cpp index 973cc372a..085b1b3fe 100644 --- a/companion/src/mainwindow.cpp +++ b/companion/src/mainwindow.cpp @@ -907,7 +907,7 @@ void MainWindow::readSettings() { Board::Type board = getCurrentBoard(); QString tempFile; - if (IS_FAMILY_HORUS_OR_T16(board)) + if (Boards::getCapability(board, Board::HasSDCard)) tempFile = generateProcessUniqueTempFileName("temp.etx"); else tempFile = generateProcessUniqueTempFileName("temp.bin"); diff --git a/companion/src/storage/sdcard.cpp b/companion/src/storage/sdcard.cpp index 3ac02f1fd..c58c4bf84 100644 --- a/companion/src/storage/sdcard.cpp +++ b/companion/src/storage/sdcard.cpp @@ -60,9 +60,11 @@ bool SdcardFormat::writeFile(const QByteArray & data, const QString & filename) bool SdcardFormat::getFileList(std::list& filelist) { QDir dir(filename); + if (!dir.cd("MODELS")) return false; + QStringList ql = dir.entryList(); for (const auto& str : ql) { - filelist.push_back(str.toStdString()); + filelist.push_back("MODELS/" + str.toStdString()); } return true; }