This commit is contained in:
Victor Shcherb 2018-05-11 01:17:34 +02:00
parent e56847043c
commit d1e219da4a
2 changed files with 10 additions and 15 deletions

View file

@ -604,11 +604,6 @@ public class FavouritesDbHelper {
if (name == null) {
name = "";
}
// old way to store the category, in name.
if ("".equals(categoryName.trim()) && (c = name.lastIndexOf('_')) != -1) {
categoryName = name.substring(c + 1);
name = name.substring(0, c);
}
FavouritePoint fp = new FavouritePoint(p.lat, p.lon, name, categoryName);
fp.setDescription(p.desc);
if (p.comment != null) {

View file

@ -41,19 +41,19 @@ public class FavoritePointEditor extends PointEditor {
}
public void add(LatLon latLon, String title, String originObjectName, String categoryName, int categoryColor, boolean autoFill) {
if (latLon == null) return;
if (latLon == null) {
return;
}
isNew = true;
if (categoryName != null && !categoryName.isEmpty()) {
FavouritesDbHelper.FavoriteGroup category = mapActivity.getMyApplication().getFavorites().getGroup(categoryName);
if (category == null)
FavouritesDbHelper.FavoriteGroup category = mapActivity.getMyApplication().getFavorites()
.getGroup(categoryName);
if (category == null) {
mapActivity.getMyApplication().getFavorites().addEmptyCategory(categoryName, categoryColor);
} else categoryName = "";
}
} else {
categoryName = "";
}
favorite = new FavouritePoint(latLon.getLatitude(), latLon.getLongitude(), title, categoryName);
favorite.setDescription("");