(fw,cpn) Support commas in labels

Remove more cpn unused code
This commit is contained in:
dlktdr
2022-09-06 21:04:10 +10:00
committed by Peter Feerick
parent cd50c0a967
commit 4067c6df07
7 changed files with 196 additions and 211 deletions
+3 -1
View File
@@ -52,7 +52,7 @@ bool LabelsModel::setData(const QModelIndex &index, const QVariant &value, int r
return true;
} else if(role == Qt::EditRole) {
QString replFrom = labels[index.row()].label;
QString replTo = value.toString().replace(',','_'); // Don't allow comma, replace with _
QString replTo = value.toString();
if(radioData->labels.indexOf(replTo) == -1) { // Don't allow duplicates
bool modelsChanged = radioData->renameLabel(replFrom,replTo);
labels[index.row()].label = replTo;
@@ -84,6 +84,8 @@ QVariant LabelsModel::data(const QModelIndex &index, int role) const
if(index.column() == 0 && selectedModel >= 0 &&
selectedModel < (int)radioData->models.size()) {
QStringList modelLabels = QString(radioData->models.at(selectedModel).labels).split(',',QString::SkipEmptyParts);
label.replace("/","//");
label.replace(",","/c");
return modelLabels.indexOf(label)==-1?Qt::Unchecked:Qt::Checked;
} else if (index.column() == 0 && selectedModel == -1) {
return Qt::Unchecked;