[Companion] Crash fix

This commit is contained in:
Bertrand Songis
2017-01-20 07:22:26 +01:00
parent 324544835a
commit 28ccf7d8ee
4 changed files with 11 additions and 72 deletions
+6 -1
View File
@@ -382,12 +382,17 @@ void MdiChild::categoryDelete()
void MdiChild::onDataChanged(const QModelIndex & index)
{
int modelIndex = modelsListModel->getModelIndex(index);
if (modelIndex >= 0) {
return;
}
int categoryIndex = modelsListModel->getCategoryIndex(index);
if (categoryIndex < 0 || categoryIndex >= (int)radioData.categories.size()) {
return;
}
strcpy(radioData.categories[categoryIndex].name, modelsListModel->data(index, 0).toString().left(sizeof(CategoryData::name)-1).toStdString().c_str());
setModified();
fileChanged = true;
documentWasModified();
}
void MdiChild::modelAdd()