(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
-70
View File
@@ -665,76 +665,6 @@ void MdiChild::onFirmwareChanged()
}
}
/*
* Categories CRUD
*/
/*
void MdiChild::categoryAdd()
{
// Translators do NOT use accent for this, this is the default category name on Horus.
CategoryData category(qPrintable(tr("New category")));
radioData.categories.push_back(category);
setModified();
QModelIndex idx = modelsListModel->getIndexForCategory(radioData.categories.size()-1);
if (idx.isValid()) {
ui->modelsList->scrollTo(idx);
ui->modelsList->setCurrentIndex(idx);
ui->modelsList->edit(idx);
}
}
// NOTE: this does not refresh the data/view, need to call setModified() at some point afterwards.
bool MdiChild::deleteCategory(int categoryIndex, QString * error)
{
if (categoryIndex < 0)
categoryIndex = modelsListModel->getCategoryIndex(getCurrentIndex());
if (categoryIndex < 0 || categoryIndex >= (int)radioData.categories.size()) {
if (error)
*error = tr("Category index out of range.");
return false;
}
if (radioData.categories.size() <= 1) {
if (error)
*error = tr("Cannot delete the last category.");
return false;
}
if (countUsedModels(categoryIndex)) {
if (error)
*error = tr("This category is not empty!");
return false;
}
radioData.categories.erase(radioData.categories.begin() + categoryIndex);
for (unsigned i=0; i < radioData.models.size(); ++i) {
ModelData & model = radioData.models.at(i);
if (model.used && model.category > categoryIndex) {
--radioData.models[i].category;
}
}
return true;
}
void MdiChild::deleteSelectedCats()
{
bool modified = false;
QString error;
QVector<int> cats = getSelectedCategories();
std::sort(cats.begin(), cats.end());
std::reverse(cats.begin(), cats.end());
foreach (const int cat, cats) {
error.clear();
if (deleteCategory(cat, &error))
modified = true;
else
showWarning(error);
}
if (modified)
setModified();
}*/
/*
* Models CRUD
*/