mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Map: catch null divesites in map widget selection code
Just to be sure, refuse to add null divesites to the selection. Moreover, refuse to call the setSelected function on a null-divesite. I got an unfriendly Qt-Warning there: "Passing incompatible arguments to C++ functions from JavaScript is dangerous and deprecated." "This will throw a JavaScript TypeError in future releases of Qt!" Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
25b30da244
commit
b3fd824d18
2 changed files with 3 additions and 1 deletions
|
@ -196,6 +196,8 @@ void MapLocationModel::reload(QObject *map)
|
|||
void MapLocationModel::setSelected(struct dive_site *ds, bool fromClick)
|
||||
{
|
||||
m_selectedDs.clear();
|
||||
if (!ds)
|
||||
return;
|
||||
m_selectedDs.append(ds);
|
||||
if (fromClick)
|
||||
emit selectedLocationChanged(getMapLocation(ds));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue