Favorites: Allow to share the same name if favorites belong to different groups

This commit is contained in:
androiddevkkotlin 2020-10-21 16:45:00 +03:00
parent 7670733f38
commit 50ff060486

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;