Improved errors displayed with corrupted YAML files
When reading directly from the radio's SD card.
This commit is contained in:
@@ -211,7 +211,11 @@ bool readSettingsSDCard(const QString & filename, ProgressWidget * progress)
|
|||||||
RadioData radioData;
|
RadioData radioData;
|
||||||
Storage inputStorage(radioPath);
|
Storage inputStorage(radioPath);
|
||||||
if (!inputStorage.load(radioData)) {
|
if (!inputStorage.load(radioData)) {
|
||||||
QMessageBox::critical(progress, CPN_STR_TTL_ERROR, QCoreApplication::translate("RadioInterface", "Failed to read Models and Settings from") % radioPath);
|
QString errorMsg = inputStorage.error();
|
||||||
|
if (errorMsg.isEmpty()) {
|
||||||
|
errorMsg = QCoreApplication::translate("RadioInterface", "Failed to read Models and Settings from") % radioPath;
|
||||||
|
}
|
||||||
|
QMessageBox::critical(progress, CPN_STR_TTL_ERROR, errorMsg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Storage outputStorage(filename);
|
Storage outputStorage(filename);
|
||||||
|
|||||||
Reference in New Issue
Block a user