diff --git a/src/org/geometerplus/fbreader/library/FileFirstLevelTree.java b/src/org/geometerplus/fbreader/library/FileFirstLevelTree.java index 7290b442f..608c899cd 100644 --- a/src/org/geometerplus/fbreader/library/FileFirstLevelTree.java +++ b/src/org/geometerplus/fbreader/library/FileFirstLevelTree.java @@ -23,10 +23,14 @@ import org.geometerplus.zlibrary.core.resources.ZLResource; import org.geometerplus.zlibrary.core.filesystem.ZLFile; import org.geometerplus.fbreader.Paths; +import org.geometerplus.fbreader.book.IBookCollection; public class FileFirstLevelTree extends FirstLevelTree { - FileFirstLevelTree(RootTree root, String id) { + private final IBookCollection myCollection; + + FileFirstLevelTree(IBookCollection collection, RootTree root, String id) { super(root, id); + myCollection = collection; addChild(Paths.BooksDirectoryOption().getValue(), "fileTreeLibrary"); addChild("/", "fileTreeRoot"); addChild(Paths.cardDirectory(), "fileTreeCard"); @@ -38,6 +42,7 @@ public class FileFirstLevelTree extends FirstLevelTree { final ZLResource resource = Library.resource().getResource(resourceKey); new FileTree( this, + myCollection, file, resource.getValue(), resource.getResource("summary").getValue() diff --git a/src/org/geometerplus/fbreader/library/FileTree.java b/src/org/geometerplus/fbreader/library/FileTree.java index f7c070347..44d3fdd0b 100644 --- a/src/org/geometerplus/fbreader/library/FileTree.java +++ b/src/org/geometerplus/fbreader/library/FileTree.java @@ -24,17 +24,20 @@ import java.util.*; import org.geometerplus.zlibrary.core.filesystem.ZLFile; import org.geometerplus.zlibrary.core.image.ZLImage; +import org.geometerplus.fbreader.book.*; import org.geometerplus.fbreader.formats.PluginCollection; import org.geometerplus.fbreader.tree.FBTree; public class FileTree extends LibraryTree { + private final IBookCollection myCollection; private final ZLFile myFile; private final String myName; private final String mySummary; private final boolean myIsSelectable; - FileTree(LibraryTree parent, ZLFile file, String name, String summary) { + FileTree(LibraryTree parent, IBookCollection collection, ZLFile file, String name, String summary) { super(parent); + myCollection = collection; myFile = file; myName = name; mySummary = summary; @@ -43,6 +46,7 @@ public class FileTree extends LibraryTree { public FileTree(FileTree parent, ZLFile file) { super(parent); + myCollection = parent.myCollection; myFile = file; myName = null; mySummary = null; diff --git a/src/org/geometerplus/fbreader/library/Library.java b/src/org/geometerplus/fbreader/library/Library.java index df9f84511..4abb6a6ae 100644 --- a/src/org/geometerplus/fbreader/library/Library.java +++ b/src/org/geometerplus/fbreader/library/Library.java @@ -87,6 +87,7 @@ public final class Library { } } + public final IBookCollection Collection; private final BooksDatabase myDatabase; private final Map myBooks = @@ -109,6 +110,7 @@ public final class Library { } public Library(BooksDatabase db) { + Collection = null; myDatabase = db; new FavoritesTree(myRootTree, ROOT_FAVORITES); @@ -116,7 +118,7 @@ public final class Library { new FirstLevelTree(myRootTree, ROOT_BY_AUTHOR); new FirstLevelTree(myRootTree, ROOT_BY_TITLE); new FirstLevelTree(myRootTree, ROOT_BY_TAG); - new FileFirstLevelTree(myRootTree, ROOT_FILE_TREE); + new FileFirstLevelTree(Collection, myRootTree, ROOT_FILE_TREE); } public LibraryTree getRootTree() {