If there is a travel book

This commit is contained in:
Victor Shcherb 2018-04-15 18:31:17 +02:00
parent 9379b96008
commit d16f3ddebe

View file

@ -76,17 +76,27 @@ public class WikivoyageDbHelper {
private List<File> existingTravelBooks = new ArrayList<>();
private Collator collator;
private WikivoyageLocalDataHelper localDataHelper;
private boolean initialized = false;
public WikivoyageDbHelper(OsmandApplication application) {
this.application = application;
collator = OsmAndCollator.primaryCollator();
if(application.getSettings().SELECTED_TRAVEL_BOOK.get() != null) {
initTravelBooks();
}
}
public WikivoyageLocalDataHelper getLocalDataHelper() {
initTravelBooks();
return localDataHelper;
}
public void initTravelBooks() {
if(initialized) {
return;
}
initialized = true;
File[] possibleFiles = application.getAppPath(IndexConstants.WIKIVOYAGE_INDEX_DIR).listFiles();
String travelBook = application.getSettings().SELECTED_TRAVEL_BOOK.get();
existingTravelBooks.clear();