Don't add a dive on the globe twice ( well, actually, different dives with same location )

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
This commit is contained in:
Tomaz Canabrava 2013-05-17 22:56:21 -03:00
parent 7509360173
commit cffc66f45a

View file

@ -52,6 +52,7 @@ void GlobeGPS::reload()
loadedDives = new GeoDataDocument; loadedDives = new GeoDataDocument;
diveLocations.clear();
int idx = 0; int idx = 0;
struct dive *dive; struct dive *dive;
for_each_dive(idx, dive) { for_each_dive(idx, dive) {
@ -60,6 +61,7 @@ void GlobeGPS::reload()
if( diveLocations.contains( QString(dive->location))) if( diveLocations.contains( QString(dive->location)))
continue; continue;
diveLocations.append( QString(dive->location) );
GeoDataPlacemark *place = new GeoDataPlacemark( dive->location ); GeoDataPlacemark *place = new GeoDataPlacemark( dive->location );
place->setCoordinate(dive->longitude.udeg / 1000000.0,dive->latitude.udeg / 1000000.0 , 0, GeoDataCoordinates::Degree ); place->setCoordinate(dive->longitude.udeg / 1000000.0,dive->latitude.udeg / 1000000.0 , 0, GeoDataCoordinates::Degree );
loadedDives->append( place ); loadedDives->append( place );