Fallback to Start with Cycling HR zones for Running

When there is no Running HR zones defined to easy
transition from current config.
Fixes #1958
This commit is contained in:
Alejandro Martinez
2016-05-11 11:26:45 -03:00
parent d65aac3035
commit e9dd189864

View File

@@ -115,6 +115,11 @@ Athlete::Athlete(Context *context, const QDir &homeDir)
} else if (! hrzones_[i]->warningString().isEmpty()) {
QMessageBox::warning(context->mainWindow, tr("Reading HR Zones File %1").arg(hrzones_[i]->fileName()), hrzones_[i]->warningString());
}
} else if (i == 1) { // No running HR zones
// Start with Cycling HR zones for backward compatibilty
QFile hrzonesFile(home->config().canonicalPath() + "/" + hrzones_[0]->fileName());
// Load without error/warning report to avoid repetition
if (hrzonesFile.exists()) hrzones_[i]->read(hrzonesFile);
}
}