mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
qmapwidgethelper: add centerOnDiveSiteUUID()
centerOnDiveSiteUUID() is a helper to center the map on a dive_site UUID instead of a dive_site pointer. Make it call centerOnDiveSite(). Make both this function and reloadMapLocations() Q_INVOKABLE as these are going to be called from QML. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
eb8772d967
commit
8fa2295a61
2 changed files with 10 additions and 1 deletions
|
@ -23,6 +23,14 @@ MapWidgetHelper::MapWidgetHelper(QObject *parent) : QObject(parent)
|
|||
this, SLOT(selectedLocationChanged(MapLocation *)));
|
||||
}
|
||||
|
||||
void MapWidgetHelper::centerOnDiveSiteUUID(QVariant dive_site_uuid)
|
||||
{
|
||||
const uint32_t uuid = qvariant_cast<uint32_t>(dive_site_uuid);
|
||||
struct dive_site *ds = get_dive_site_by_uuid(uuid);
|
||||
if (ds)
|
||||
centerOnDiveSite(ds);
|
||||
}
|
||||
|
||||
void MapWidgetHelper::centerOnDiveSite(struct dive_site *ds)
|
||||
{
|
||||
int idx;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue