feat(cpn): model notes and checklist files packaged with model files (#6578)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user