remove some obsolete code

This commit is contained in:
sonora 2015-01-16 09:05:26 +01:00
parent 29f83a6f81
commit 0c69f6aceb
7 changed files with 16 additions and 46 deletions

View file

@ -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_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 = "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_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_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_BUILDING = "last_searched_building"; //$NON-NLS-1$
public static final String LAST_SEARCHED_INTERSECTED_STREET = "last_searched_intersected_street"; //$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) { public boolean setLastSearchedRegion(String region, LatLon l) {
SettingsEditor edit = settingsAPI.edit(globalPreferences).putString(LAST_SEARCHED_REGION, region).putLong(LAST_SEARCHED_CITY, -1). 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$ putString(LAST_SEARCHED_STREET,"").putString(LAST_SEARCHED_BUILDING, ""); //$NON-NLS-1$ //$NON-NLS-2$
if (settingsAPI.contains(globalPreferences,LAST_SEARCHED_INTERSECTED_STREET)) { if (settingsAPI.contains(globalPreferences,LAST_SEARCHED_INTERSECTED_STREET)) {
edit.putString(LAST_SEARCHED_INTERSECTED_STREET, ""); //$NON-NLS-1$ edit.putString(LAST_SEARCHED_INTERSECTED_STREET, ""); //$NON-NLS-1$
@ -1552,12 +1552,12 @@ public class OsmandSettings {
} }
public String getLastSearchedPostcode(){ 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){ 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$ SettingsEditor edit = settingsAPI.edit(globalPreferences).putLong(LAST_SEARCHED_CITY, -1).putString(LAST_SEARCHED_STREET, "") //$NON-NLS-1$
LAST_SEARCHED_BUILDING, "").putString(lAST_SEARCHED_POSTCODE, postcode); //$NON-NLS-1$ .putString(LAST_SEARCHED_BUILDING, "").putString(LAST_SEARCHED_POSTCODE, postcode); //$NON-NLS-1$
if(settingsAPI.contains(globalPreferences,LAST_SEARCHED_INTERSECTED_STREET)){ if(settingsAPI.contains(globalPreferences,LAST_SEARCHED_INTERSECTED_STREET)){
edit.putString(LAST_SEARCHED_INTERSECTED_STREET, ""); //$NON-NLS-1$ 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) { 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). 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$ putString(LAST_SEARCHED_STREET, "").putString(LAST_SEARCHED_BUILDING, "").putString(LAST_SEARCHED_POSTCODE, ""); //$NON-NLS-1$
edit.remove(lAST_SEARCHED_POSTCODE); //edit.remove(LAST_SEARCHED_POSTCODE);
if(settingsAPI.contains(globalPreferences,LAST_SEARCHED_INTERSECTED_STREET)){ if(settingsAPI.contains(globalPreferences,LAST_SEARCHED_INTERSECTED_STREET)){
edit.putString(LAST_SEARCHED_INTERSECTED_STREET, ""); //$NON-NLS-1$ edit.putString(LAST_SEARCHED_INTERSECTED_STREET, ""); //$NON-NLS-1$
} }

View file

@ -211,7 +211,7 @@ public class SearchAddressFragment extends SherlockFragment {
building = null; building = null;
searchPoint = null; searchPoint = null;
osmandSettings.setLastSearchedBuilding("", null); osmandSettings.setLastSearchedBuilding("", null);
osmandSettings.setLastSearchedPoint(null); //also empties Point, REMOVES intersecting street
updateUI(); updateUI();
} }
}); });
@ -223,9 +223,7 @@ public class SearchAddressFragment extends SherlockFragment {
building = null; building = null;
searchPoint = null; searchPoint = null;
osmandSettings.setLastSearchedStreet("", null); osmandSettings.setLastSearchedStreet("", null);
osmandSettings.setLastSearchedIntersectedStreet("", null); //also empties Building, (Intersecting Street), Point
osmandSettings.setLastSearchedBuilding("", null);
osmandSettings.setLastSearchedPoint(null);
updateUI(); updateUI();
} }
}); });
@ -238,12 +236,8 @@ public class SearchAddressFragment extends SherlockFragment {
street2 = null; street2 = null;
building = null; building = null;
searchPoint = null; searchPoint = null;
osmandSettings.setLastSearchedPostcode("", null); osmandSettings.setLastSearchedCity(-1L, "", null);
osmandSettings.setLastSearchedCity(0L, "", null); //also empties Street, (Intersecting Street), Building, Point, REMOVES Postcode
osmandSettings.setLastSearchedStreet("", null);
osmandSettings.setLastSearchedIntersectedStreet("", null);
osmandSettings.setLastSearchedBuilding("", null);
osmandSettings.setLastSearchedPoint(null);
updateUI(); updateUI();
} }
}); });
@ -258,12 +252,7 @@ public class SearchAddressFragment extends SherlockFragment {
building = null; building = null;
searchPoint = null; searchPoint = null;
osmandSettings.setLastSearchedRegion("", null); osmandSettings.setLastSearchedRegion("", null);
osmandSettings.setLastSearchedPostcode("", null); // also empties City, Postcode, Street, (Interseting street), Building, Point
osmandSettings.setLastSearchedCity(0L, "", null);
osmandSettings.setLastSearchedStreet("", null);
osmandSettings.setLastSearchedIntersectedStreet("", null);
osmandSettings.setLastSearchedBuilding("", null);
osmandSettings.setLastSearchedPoint(null);
updateUI(); updateUI();
} }
}); });

View file

@ -38,9 +38,7 @@ public class SearchBuildingByNameActivity extends SearchByNameAbstractActivity<B
@Override @Override
protected void reset() { protected void reset() {
//osmandSettings.setLastSearchedIntersectedStreet("", null);
//osmandSettings.setLastSearchedBuilding("", null); //osmandSettings.setLastSearchedBuilding("", null);
//osmandSettings.setLastSearchedPoint(null);
super.reset(); super.reset();
} }

View file

@ -34,13 +34,8 @@ public class SearchCityByNameActivity extends SearchByNameAbstractActivity<City>
@Override @Override
protected void reset() { protected void reset() {
searchVillagesMode = -1; //searchVillagesMode = -1;
//osmandSettings.setLastSearchedPostcode("", null); //osmandSettings.setLastSearchedCity(-1L, "", null);
//osmandSettings.setLastSearchedCity(0L, "", null);
//osmandSettings.setLastSearchedStreet("", null);
//osmandSettings.setLastSearchedIntersectedStreet("", null);
//osmandSettings.setLastSearchedBuilding("", null);
//osmandSettings.setLastSearchedPoint(null);
super.reset(); super.reset();
} }
@ -58,7 +53,7 @@ public class SearchCityByNameActivity extends SearchByNameAbstractActivity<City>
public void onClick(View v) { public void onClick(View v) {
searchVillagesMode = 1; searchVillagesMode = 1;
research(); research();
//searchVillages.setVisibility(View.GONE); searchVillages.setVisibility(View.GONE);
} }
}); });
getListView().addFooterView(ll); getListView().addFooterView(ll);

View file

@ -33,12 +33,6 @@ public class SearchRegionByNameActivity extends SearchByNameAbstractActivity<Reg
@Override @Override
protected void reset() { protected void reset() {
//osmandSettings.setLastSearchedRegion("", null); //osmandSettings.setLastSearchedRegion("", null);
//osmandSettings.setLastSearchedPostcode("", null);
//osmandSettings.setLastSearchedCity(0L, "", null);
//osmandSettings.setLastSearchedStreet("", null);
//osmandSettings.setLastSearchedIntersectedStreet("", null);
//osmandSettings.setLastSearchedBuilding("", null);
//osmandSettings.setLastSearchedPoint(null);
super.reset(); super.reset();
} }

View file

@ -27,10 +27,7 @@ public class SearchStreet2ByNameActivity extends SearchByNameAbstractActivity<St
@Override @Override
protected void reset() { protected void reset() {
//osmandSettings.setLastSearchedStreet("", null);
//osmandSettings.setLastSearchedIntersectedStreet("", null); //osmandSettings.setLastSearchedIntersectedStreet("", null);
//osmandSettings.setLastSearchedBuilding("", null);
//osmandSettings.setLastSearchedPoint(null);
super.reset(); super.reset();
} }

View file

@ -53,11 +53,8 @@ public class SearchStreetByNameActivity extends SearchByNameAbstractActivity<Str
@Override @Override
protected void reset() { protected void reset() {
searchWithCity = -1; //searchWithCity = -1;
//osmandSettings.setLastSearchedStreet("", null); //osmandSettings.setLastSearchedStreet("", null);
//osmandSettings.setLastSearchedIntersectedStreet("", null);
//osmandSettings.setLastSearchedBuilding("", null);
//osmandSettings.setLastSearchedPoint(null);
super.reset(); super.reset();
} }