Merge pull request #4325 from schrod/Fix_Import_Color_Handling
Fix favorite import issues
This commit is contained in:
commit
cc620df157
2 changed files with 24 additions and 1 deletions
|
@ -121,4 +121,26 @@ public class FavouritePoint implements Serializable, LocationPoint {
|
||||||
return "Favourite " + getName(); //$NON-NLS-1$
|
return "Favourite " + getName(); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) return true;
|
||||||
|
|
||||||
|
if (!(o instanceof FavouritePoint)) return false;
|
||||||
|
|
||||||
|
FavouritePoint fp = (FavouritePoint)o;
|
||||||
|
|
||||||
|
return (this.latitude == fp.latitude)
|
||||||
|
&& (this.longitude == fp.longitude)
|
||||||
|
&& (this.name.equals(fp.name));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int hash = (int)latitude*1000 + (int)longitude*1000;
|
||||||
|
hash += (name != null) ? name.hashCode() : 0;
|
||||||
|
return hash;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -565,6 +565,7 @@ public class GpxImportHelper {
|
||||||
if (p.desc != null) {
|
if (p.desc != null) {
|
||||||
fp.setDescription(p.desc);
|
fp.setDescription(p.desc);
|
||||||
}
|
}
|
||||||
|
fp.setColor(p.getColor(0));
|
||||||
favourites.add(fp);
|
favourites.add(fp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue