DroidFish: Made it possible to specify a full file path to the book file in preferences.

This commit is contained in:
Peter Osterlund
2014-10-04 12:48:31 +00:00
parent 648a00dc92
commit 31ce064a10

View File

@@ -1219,9 +1219,11 @@ public class DroidFish extends Activity implements GUIInterface {
private final void setBookOptions() {
BookOptions options = new BookOptions(bookOptions);
if (options.filename.length() > 0) {
File extDir = Environment.getExternalStorageDirectory();
String sep = File.separator;
options.filename = extDir.getAbsolutePath() + sep + bookDir + sep + options.filename;
if (!options.filename.startsWith(sep)) {
File extDir = Environment.getExternalStorageDirectory();
options.filename = extDir.getAbsolutePath() + sep + bookDir + sep + options.filename;
}
}
ctrl.setBookOptions(options);
}