Only change dive coordinates on double click

Apparently this only happens on Windows, but there we would change the
dive coordinates on a SINGLE click when editing a dive. With this change
we simply bail if the event isn't a double click.

Fixes #505

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-05-01 21:21:59 -07:00
parent 4243fcb915
commit 7a85b9fb27

View file

@ -289,7 +289,8 @@ void GlobeGPS::changeDiveGeoPosition(qreal lon, qreal lat, GeoDataCoordinates::U
lat = lat * 180 / M_PI;
}
/* change everything on the selection. */
// right now we try to only ever do this with one dive selected,
// but we keep the code here that changes the coordinates for each selected dive
int i;
struct dive *dive;
for_each_dive(i, dive) {
@ -306,6 +307,9 @@ void GlobeGPS::changeDiveGeoPosition(qreal lon, qreal lat, GeoDataCoordinates::U
void GlobeGPS::mousePressEvent(QMouseEvent *event)
{
if (event->type() != QEvent::MouseButtonDblClick)
return;
qreal lat, lon;
bool clickOnGlobe = geoCoordinates(event->pos().x(), event->pos().y(), lon, lat, GeoDataCoordinates::Degree);