cleaned some code

This commit is contained in:
Chumva 2018-03-23 14:43:54 +02:00
parent fd59313887
commit 9c09cb9c8b

View file

@ -98,7 +98,8 @@ public abstract class QuickSearchListFragment extends OsmAndListFragment {
showResult(sr);
} else {
if ((sr.objectType == ObjectType.CITY || sr.objectType == ObjectType.VILLAGE) && sr.file != null) {
if ((sr.objectType == ObjectType.CITY || sr.objectType == ObjectType.VILLAGE)
&& sr.file != null && sr.object instanceof City) {
City c = (City) sr.object;
if (c.getStreets().isEmpty()) {
try {
@ -108,7 +109,6 @@ public abstract class QuickSearchListFragment extends OsmAndListFragment {
return;
}
} catch (IOException e) {
dialogFragment.completeQueryWithObject(sr);
e.printStackTrace();
}
}
@ -214,18 +214,13 @@ public abstract class QuickSearchListFragment extends OsmAndListFragment {
FavouritePoint fav = (FavouritePoint) object;
pointDescription = fav.getPointDescription();
break;
case VILLAGE:
case CITY:
String cityName = searchResult.localeName;
String typeNameCity = QuickSearchListItem.getTypeName(app, searchResult);
pointDescription = new PointDescription(PointDescription.POINT_TYPE_ADDRESS, typeNameCity, cityName);
pointDescription.setIconName("ic_action_building_number");
break;
case VILLAGE:
String villageName = searchResult.localeName;
String typeNameVillage = QuickSearchListItem.getTypeName(app, searchResult);
pointDescription = new PointDescription(PointDescription.POINT_TYPE_ADDRESS, typeNameVillage, villageName);
pointDescription.setIconName("ic_action_building_number");
break;
case STREET:
String streetName = searchResult.localeName;
String typeNameStreet = QuickSearchListItem.getTypeName(app, searchResult);