mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Map: create correct index in updateMapLocationCoordinates()
When updating the coordinates of a dive site, the MapLocationModel is updated. The code created a (col, row) index with col = 0. [The idea of course being col = x, row = y]. Alas, that's not how Qt works - its models want (row, col) indices. The code worked, because the only time when the dive site locations were updated was in dive site edit mode, when only one site is visible, i.e. there is only one row leading to the correct (0, 0) index. Fix this so that we can also change dive site positions if more than one site is displayed. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
bc9a62c0ff
commit
5cd64d42e4
1 changed files with 1 additions and 1 deletions
|
@ -155,7 +155,7 @@ void MapLocationModel::updateMapLocationCoordinates(const struct dive_site *ds,
|
|||
foreach(location, m_mapLocations) {
|
||||
if (ds == location->divesite()) {
|
||||
location->setCoordinateNoEmit(coord);
|
||||
emit dataChanged(createIndex(0, row), createIndex(0, row));
|
||||
emit dataChanged(createIndex(row, 0), createIndex(row, 0));
|
||||
return;
|
||||
}
|
||||
row++;
|
||||
|
|
Loading…
Reference in a new issue