From 0c69f6acebc8d80a7c340e3c40d706102c76cd3a Mon Sep 17 00:00:00 2001 From: sonora Date: Fri, 16 Jan 2015 09:05:26 +0100 Subject: [PATCH] remove some obsolete code --- .../src/net/osmand/plus/OsmandSettings.java | 14 ++++++------- .../search/SearchAddressFragment.java | 21 +++++-------------- .../search/SearchBuildingByNameActivity.java | 2 -- .../search/SearchCityByNameActivity.java | 11 +++------- .../search/SearchRegionByNameActivity.java | 6 ------ .../search/SearchStreet2ByNameActivity.java | 3 --- .../search/SearchStreetByNameActivity.java | 5 +---- 7 files changed, 16 insertions(+), 46 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index b3f975f0a9..2eb93f9ec7 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -1507,7 +1507,7 @@ public class OsmandSettings { public static final String LAST_SEARCHED_REGION = "last_searched_region"; //$NON-NLS-1$ public static final String LAST_SEARCHED_CITY = "last_searched_city"; //$NON-NLS-1$ public static final String LAST_SEARCHED_CITY_NAME = "last_searched_city_name"; //$NON-NLS-1$ - public static final String lAST_SEARCHED_POSTCODE= "last_searched_postcode"; //$NON-NLS-1$ + public static final String LAST_SEARCHED_POSTCODE= "last_searched_postcode"; //$NON-NLS-1$ public static final String LAST_SEARCHED_STREET = "last_searched_street"; //$NON-NLS-1$ public static final String LAST_SEARCHED_BUILDING = "last_searched_building"; //$NON-NLS-1$ public static final String LAST_SEARCHED_INTERSECTED_STREET = "last_searched_intersected_street"; //$NON-NLS-1$ @@ -1541,7 +1541,7 @@ public class OsmandSettings { public boolean setLastSearchedRegion(String region, LatLon l) { SettingsEditor edit = settingsAPI.edit(globalPreferences).putString(LAST_SEARCHED_REGION, region).putLong(LAST_SEARCHED_CITY, -1). - putString(LAST_SEARCHED_CITY_NAME, "").putString(lAST_SEARCHED_POSTCODE, ""). + putString(LAST_SEARCHED_CITY_NAME, "").putString(LAST_SEARCHED_POSTCODE, ""). putString(LAST_SEARCHED_STREET,"").putString(LAST_SEARCHED_BUILDING, ""); //$NON-NLS-1$ //$NON-NLS-2$ if (settingsAPI.contains(globalPreferences,LAST_SEARCHED_INTERSECTED_STREET)) { edit.putString(LAST_SEARCHED_INTERSECTED_STREET, ""); //$NON-NLS-1$ @@ -1552,12 +1552,12 @@ public class OsmandSettings { } public String getLastSearchedPostcode(){ - return settingsAPI.getString(globalPreferences, lAST_SEARCHED_POSTCODE, null); + return settingsAPI.getString(globalPreferences, LAST_SEARCHED_POSTCODE, null); } public boolean setLastSearchedPostcode(String postcode, LatLon point){ - SettingsEditor edit = settingsAPI.edit(globalPreferences).putLong(LAST_SEARCHED_CITY, -1).putString(LAST_SEARCHED_STREET, "").putString( //$NON-NLS-1$ - LAST_SEARCHED_BUILDING, "").putString(lAST_SEARCHED_POSTCODE, postcode); //$NON-NLS-1$ + SettingsEditor edit = settingsAPI.edit(globalPreferences).putLong(LAST_SEARCHED_CITY, -1).putString(LAST_SEARCHED_STREET, "") //$NON-NLS-1$ + .putString(LAST_SEARCHED_BUILDING, "").putString(LAST_SEARCHED_POSTCODE, postcode); //$NON-NLS-1$ if(settingsAPI.contains(globalPreferences,LAST_SEARCHED_INTERSECTED_STREET)){ edit.putString(LAST_SEARCHED_INTERSECTED_STREET, ""); //$NON-NLS-1$ } @@ -1576,8 +1576,8 @@ public class OsmandSettings { public boolean setLastSearchedCity(Long cityId, String name, LatLon point) { SettingsEditor edit = settingsAPI.edit(globalPreferences).putLong(LAST_SEARCHED_CITY, cityId).putString(LAST_SEARCHED_CITY_NAME, name). - putString(LAST_SEARCHED_STREET, "").putString(LAST_SEARCHED_BUILDING, ""); //$NON-NLS-1$ - edit.remove(lAST_SEARCHED_POSTCODE); + putString(LAST_SEARCHED_STREET, "").putString(LAST_SEARCHED_BUILDING, "").putString(LAST_SEARCHED_POSTCODE, ""); //$NON-NLS-1$ + //edit.remove(LAST_SEARCHED_POSTCODE); if(settingsAPI.contains(globalPreferences,LAST_SEARCHED_INTERSECTED_STREET)){ edit.putString(LAST_SEARCHED_INTERSECTED_STREET, ""); //$NON-NLS-1$ } diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressFragment.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressFragment.java index e9d34261b8..244fb15390 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressFragment.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressFragment.java @@ -211,7 +211,7 @@ public class SearchAddressFragment extends SherlockFragment { building = null; searchPoint = null; osmandSettings.setLastSearchedBuilding("", null); - osmandSettings.setLastSearchedPoint(null); + //also empties Point, REMOVES intersecting street updateUI(); } }); @@ -223,9 +223,7 @@ public class SearchAddressFragment extends SherlockFragment { building = null; searchPoint = null; osmandSettings.setLastSearchedStreet("", null); - osmandSettings.setLastSearchedIntersectedStreet("", null); - osmandSettings.setLastSearchedBuilding("", null); - osmandSettings.setLastSearchedPoint(null); + //also empties Building, (Intersecting Street), Point updateUI(); } }); @@ -238,12 +236,8 @@ public class SearchAddressFragment extends SherlockFragment { street2 = null; building = null; searchPoint = null; - osmandSettings.setLastSearchedPostcode("", null); - osmandSettings.setLastSearchedCity(0L, "", null); - osmandSettings.setLastSearchedStreet("", null); - osmandSettings.setLastSearchedIntersectedStreet("", null); - osmandSettings.setLastSearchedBuilding("", null); - osmandSettings.setLastSearchedPoint(null); + osmandSettings.setLastSearchedCity(-1L, "", null); + //also empties Street, (Intersecting Street), Building, Point, REMOVES Postcode updateUI(); } }); @@ -258,12 +252,7 @@ public class SearchAddressFragment extends SherlockFragment { building = null; searchPoint = null; osmandSettings.setLastSearchedRegion("", null); - osmandSettings.setLastSearchedPostcode("", null); - osmandSettings.setLastSearchedCity(0L, "", null); - osmandSettings.setLastSearchedStreet("", null); - osmandSettings.setLastSearchedIntersectedStreet("", null); - osmandSettings.setLastSearchedBuilding("", null); - osmandSettings.setLastSearchedPoint(null); + // also empties City, Postcode, Street, (Interseting street), Building, Point updateUI(); } }); diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchBuildingByNameActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchBuildingByNameActivity.java index b8f1fff8b3..ad8d25e3e4 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchBuildingByNameActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchBuildingByNameActivity.java @@ -38,9 +38,7 @@ public class SearchBuildingByNameActivity extends SearchByNameAbstractActivity @Override protected void reset() { - searchVillagesMode = -1; - //osmandSettings.setLastSearchedPostcode("", null); - //osmandSettings.setLastSearchedCity(0L, "", null); - //osmandSettings.setLastSearchedStreet("", null); - //osmandSettings.setLastSearchedIntersectedStreet("", null); - //osmandSettings.setLastSearchedBuilding("", null); - //osmandSettings.setLastSearchedPoint(null); + //searchVillagesMode = -1; + //osmandSettings.setLastSearchedCity(-1L, "", null); super.reset(); } @@ -58,7 +53,7 @@ public class SearchCityByNameActivity extends SearchByNameAbstractActivity public void onClick(View v) { searchVillagesMode = 1; research(); - //searchVillages.setVisibility(View.GONE); + searchVillages.setVisibility(View.GONE); } }); getListView().addFooterView(ll); diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchRegionByNameActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchRegionByNameActivity.java index eacd99e376..d6b7f54e8f 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchRegionByNameActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchRegionByNameActivity.java @@ -33,12 +33,6 @@ public class SearchRegionByNameActivity extends SearchByNameAbstractActivity