1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-03 17:59:33 +02:00

string list as book path (only first element can be set from preferences)

This commit is contained in:
Nikolay Pultsin 2013-10-12 11:16:23 +01:00
parent 56d7de4620
commit 9b5718e104
7 changed files with 82 additions and 15 deletions

View file

@ -27,12 +27,14 @@ import org.geometerplus.fbreader.Paths;
public class FileFirstLevelTree extends FirstLevelTree {
FileFirstLevelTree(RootTree root) {
super(root, ROOT_FILE_TREE);
addChild(Paths.BooksDirectoryOption().getValue(), "fileTreeLibrary");
addChild("/", "fileTreeRoot");
addChild(Paths.cardDirectory(), "fileTreeCard");
for (String dir : Paths.BookPathOption().getValue()) {
addChild(dir, "fileTreeLibrary", dir);
}
addChild("/", "fileTreeRoot", null);
addChild(Paths.cardDirectory(), "fileTreeCard", null);
}
private void addChild(String path, String resourceKey) {
private void addChild(String path, String resourceKey, String summary) {
final ZLFile file = ZLFile.createFileByPath(path);
if (file != null) {
final ZLResource resource = resource().getResource(resourceKey);
@ -40,7 +42,7 @@ public class FileFirstLevelTree extends FirstLevelTree {
this,
file,
resource.getValue(),
resource.getResource("summary").getValue()
summary != null ? summary : resource.getResource("summary").getValue()
);
}
}