If there is a travel book
This commit is contained in:
parent
9379b96008
commit
d16f3ddebe
1 changed files with 10 additions and 0 deletions
|
@ -76,17 +76,27 @@ public class WikivoyageDbHelper {
|
||||||
private List<File> existingTravelBooks = new ArrayList<>();
|
private List<File> existingTravelBooks = new ArrayList<>();
|
||||||
private Collator collator;
|
private Collator collator;
|
||||||
private WikivoyageLocalDataHelper localDataHelper;
|
private WikivoyageLocalDataHelper localDataHelper;
|
||||||
|
private boolean initialized = false;
|
||||||
|
|
||||||
|
|
||||||
public WikivoyageDbHelper(OsmandApplication application) {
|
public WikivoyageDbHelper(OsmandApplication application) {
|
||||||
this.application = application;
|
this.application = application;
|
||||||
collator = OsmAndCollator.primaryCollator();
|
collator = OsmAndCollator.primaryCollator();
|
||||||
|
if(application.getSettings().SELECTED_TRAVEL_BOOK.get() != null) {
|
||||||
|
initTravelBooks();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public WikivoyageLocalDataHelper getLocalDataHelper() {
|
public WikivoyageLocalDataHelper getLocalDataHelper() {
|
||||||
|
initTravelBooks();
|
||||||
return localDataHelper;
|
return localDataHelper;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initTravelBooks() {
|
public void initTravelBooks() {
|
||||||
|
if(initialized) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
initialized = true;
|
||||||
File[] possibleFiles = application.getAppPath(IndexConstants.WIKIVOYAGE_INDEX_DIR).listFiles();
|
File[] possibleFiles = application.getAppPath(IndexConstants.WIKIVOYAGE_INDEX_DIR).listFiles();
|
||||||
String travelBook = application.getSettings().SELECTED_TRAVEL_BOOK.get();
|
String travelBook = application.getSettings().SELECTED_TRAVEL_BOOK.get();
|
||||||
existingTravelBooks.clear();
|
existingTravelBooks.clear();
|
||||||
|
|
Loading…
Reference in a new issue