[code] Fixed SelectableTableView selection problem.

If adding a script fails, the selectableTableView should select the "Add
script" line.

Change-Id: I373cdfa0afcc334e4bf306b1cee4bfb817417980
This commit is contained in:
Léa Saviot
2017-11-03 15:31:23 +01:00
committed by Romain Goyet
parent fbb5c70339
commit 45aa526cd6
4 changed files with 15 additions and 16 deletions

View File

@@ -33,6 +33,12 @@ void SelectableTableView::reloadData() {
int col = selectedColumn();
int row = selectedRow();
deselectTable();
/* FIXME: The problem with calling deselectTable is that at this point in time
* the datasource's model is very likely to have changed. Therefore it's
* rather complicated to get a pointer to the currently selected cell (in
* order to deselect it). */
/* As a workaround, datasources can reset the highlighted state in their
* willDisplayCell callback. */
TableView::reloadData();
selectCellAtLocation(col, row);
}