From 9c09cb9c8b7c6d2c77deaff10ad971c5a2b8cbde Mon Sep 17 00:00:00 2001 From: Chumva Date: Fri, 23 Mar 2018 14:43:54 +0200 Subject: [PATCH] cleaned some code --- .../osmand/plus/search/QuickSearchListFragment.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/search/QuickSearchListFragment.java b/OsmAnd/src/net/osmand/plus/search/QuickSearchListFragment.java index 5da85385d7..82aa807b36 100644 --- a/OsmAnd/src/net/osmand/plus/search/QuickSearchListFragment.java +++ b/OsmAnd/src/net/osmand/plus/search/QuickSearchListFragment.java @@ -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);