diff --git a/cmainwindow.cpp b/cmainwindow.cpp index 7774b66..d514ca7 100644 --- a/cmainwindow.cpp +++ b/cmainwindow.cpp @@ -1273,7 +1273,10 @@ void cMainWindow::onActionMovieDelete() void cMainWindow::onActionEdit() { - cSerie* lpSerie = m_lpSeriesListModel->itemFromIndex(ui->m_lpSeriesList1->selectionModel()->selectedRows().at(0))->data(Qt::UserRole).value(); + QModelIndex index = ui->m_lpSeriesList1->selectionModel()->selectedRows().at(0); + +// cSerie* lpSerie = m_lpSeriesListModel->itemFromIndex(ui->m_lpSeriesList1->selectionModel()->selectedRows().at(0))->data(Qt::UserRole).value(); + cSerie* lpSerie = m_lpSeriesListModel->itemFromIndex(index)->data(Qt::UserRole).value(); if(!lpSerie) return; @@ -1292,9 +1295,7 @@ void cMainWindow::onActionEdit() lpSerie->del(m_db); lpSerie->save(m_db); - m_szOldSelected = lpSerie->seriesName(); - loadSeriesDB(); - displaySeries(); + emit m_lpSeriesListModel->layoutChanged(); delete lpDialog; }