Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2014-09-04 11:39:35 +02:00
commit 3838c75b02
3 changed files with 16 additions and 2 deletions

View file

@ -178,4 +178,8 @@ public class OsmAndAppCustomization {
public int getWaypointSearchRadius(int searchDeviationRadius, int type) { public int getWaypointSearchRadius(int searchDeviationRadius, int type) {
return searchDeviationRadius; return searchDeviationRadius;
} }
public File getExternalStorageDir() {
return osmandSettings.getExternalStorageDirectory();
}
} }

View file

@ -750,7 +750,8 @@ public class OsmandApplication extends Application {
if(path == null) { if(path == null) {
path = ""; path = "";
} }
return new File(getSettings().getExternalStorageDirectory(), IndexConstants.APP_DIR + path);
return new File(getAppCustomization().getExternalStorageDir(), IndexConstants.APP_DIR + path);
} }
public void applyTheme(Context c) { public void applyTheme(Context c) {

View file

@ -10,6 +10,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.TreeSet; import java.util.TreeSet;
import android.os.Environment;
import android.widget.Toast; import android.widget.Toast;
import net.osmand.IProgress; import net.osmand.IProgress;
import net.osmand.IndexConstants; import net.osmand.IndexConstants;
@ -79,7 +80,7 @@ public class SherpafyCustomization extends OsmAndAppCustomization {
private CommonPreference<String> saveGPXFolder; private CommonPreference<String> saveGPXFolder;
public static final String TOUR_SERVER = "download.osmand.net"; public static final String TOUR_SERVER = "download.osmand.net";
private static final String SAVE_GPX_FOLDER = "save_gpx_folder"; private static final String SAVE_GPX_FOLDER = "save_gpx_folder";
private Object originalGlobal; private Object originalGlobal;
@Override @Override
public void setup(OsmandApplication app) { public void setup(OsmandApplication app) {
@ -92,6 +93,14 @@ public class SherpafyCustomization extends OsmAndAppCustomization {
} }
accessCodePref = osmandSettings.registerStringPreference(ACCESS_CODE, "").makeGlobal(); accessCodePref = osmandSettings.registerStringPreference(ACCESS_CODE, "").makeGlobal();
toursFolder = new File(osmandSettings.getExternalStorageDirectory(), "osmand/tours"); toursFolder = new File(osmandSettings.getExternalStorageDirectory(), "osmand/tours");
}
@Override
public File getExternalStorageDir() {
final String defaultLocation = Environment.getExternalStorageDirectory().getAbsolutePath();
return new File(originalApi.getString(originalGlobal, OsmandSettings.EXTERNAL_STORAGE_DIR,
defaultLocation));
} }
public boolean setAccessCode(String acCode) { public boolean setAccessCode(String acCode) {