Merge pull request #10057 from osmandapp/Allow-the-same-name-favorites

Favorites: Allow to share the same name if favorites belong to differ…
This commit is contained in:
Vitaliy 2020-10-25 19:32:53 +02:00 committed by GitHub
commit b4d776df8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -428,7 +428,7 @@ public class FavouritesDbHelper {
while (fl) { while (fl) {
fl = false; fl = false;
for (FavouritePoint fp : fdb.getFavouritePoints()) { for (FavouritePoint fp : fdb.getFavouritePoints()) {
if (fp.getName().equals(name) && p.getLatitude() != fp.getLatitude() && p.getLongitude() != fp.getLongitude()) { if (fp.getName().equals(name) && p.getLatitude() != fp.getLatitude() && p.getLongitude() != fp.getLongitude() && fp.getCategory().equals(p.getCategory())) {
number++; number++;
index = " (" + number + ")"; index = " (" + number + ")";
name = p.getName() + index; name = p.getName() + index;