[companion] Horus models didn't get their defaults set (thanks @Max)
This commit is contained in:
@@ -472,16 +472,16 @@ void MdiChild::modelAdd()
|
|||||||
}
|
}
|
||||||
|
|
||||||
ModelData model;
|
ModelData model;
|
||||||
model.category = categoryIndex;
|
|
||||||
model.used = true;
|
|
||||||
strcpy(model.filename, radioData.getNextModelFilename().toStdString().c_str());
|
|
||||||
strcpy(model.name, qPrintable(tr("New model")));
|
|
||||||
radioData.models.push_back(model);
|
radioData.models.push_back(model);
|
||||||
|
int row = radioData.models.size() - 1;
|
||||||
|
checkAndInitModel(row);
|
||||||
|
radioData.models[row].category = categoryIndex;
|
||||||
|
strcpy(radioData.models[row].filename, radioData.getNextModelFilename().toStdString().c_str());
|
||||||
|
strcpy(radioData.models[row].name, qPrintable(tr("New model")));
|
||||||
|
|
||||||
// Only set the default model if we just added the first one.
|
// Only set the default model if we just added the first one.
|
||||||
int newModelIndex = radioData.models.size() - 1;
|
if (row == 0) {
|
||||||
if (newModelIndex == 0) {
|
radioData.setCurrentModel(row);
|
||||||
radioData.setCurrentModel(newModelIndex);
|
|
||||||
}
|
}
|
||||||
setModified();
|
setModified();
|
||||||
emit copyAvailable(false); // workaround : nothing is selected after model creation
|
emit copyAvailable(false); // workaround : nothing is selected after model creation
|
||||||
|
|||||||
Reference in New Issue
Block a user