feat(cpn): model notes and checklist files packaged with model files (#6578)

This commit is contained in:
Neil Horne
2025-10-02 14:47:29 +10:00
committed by GitHub
parent 7e53dd87fd
commit 96400a7aff
17 changed files with 191 additions and 207 deletions
+10 -1
View File
@@ -31,10 +31,19 @@ bool SdcardFormat::write(const RadioData & radioData)
return LabelsStorageFormat::write(radioData);
}
bool SdcardFormat::loadFile(QByteArray & filedata, const QString & filename)
bool SdcardFormat::loadFile(QByteArray & filedata, const QString & filename, bool optional)
{
QString path = this->filename + "/" + filename;
QFile file(path);
if (!file.exists()) {
if (optional) {
//qDebug() << "File not found:" << filename;
return true;
} else {
return false;
}
}
if (!file.open(QFile::ReadOnly)) {
setError(tr("Error opening file %1:\n%2.").arg(path).arg(file.errorString()));
return false;