(cpn) Labels - Various fixes

Don't allow duplicate
Partial labels of others also selected
Paste doesn't update labels list
This commit is contained in:
dlktdr
2022-09-06 21:04:10 +10:00
committed by Peter Feerick
parent 32a6f792b9
commit d462e24862
5 changed files with 39 additions and 29 deletions
+7 -10
View File
@@ -283,20 +283,17 @@ bool LabelsStorageFormat::loadYaml(RadioData & radioData)
radioData.generalSettings.currModelIndex = modelIdx;
}
if (hasLabels) {
QStringList labels = QString(model.labels).split(',',QString::SkipEmptyParts);
foreach(QString label, labels) {
radioData.addLabel(label);
}
}
model.used = true;
modelIdx++;
}
// If no labels, add a Favorites
if(hasLabels && !radioData.labels.size()) {
radioData.labels.append(tr("Favorites"));
// Add the labels in the models
if (hasLabels) {
radioData.addLabelsFromModels();
// If no labels, add a Favorites
if(!radioData.labels.size())
radioData.labels.append(tr("Favorites"));
}
return true;