1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-04 18:29:23 +02:00

show correct dirs in file tree, do not show deleted books in recent list

This commit is contained in:
Nikolay Pultsin 2014-01-02 00:39:56 +00:00
parent 9ee9c67180
commit 8bfa52ee4a
2 changed files with 12 additions and 7 deletions

View file

@ -114,7 +114,7 @@ public class BookCollection extends AbstractBookCollection {
}
book = myDatabase.loadBook(id);
if (book == null) {
if (book == null || !book.File.exists()) {
return null;
}
book.loadLists(myDatabase);

View file

@ -19,20 +19,25 @@
package org.geometerplus.fbreader.library;
import org.geometerplus.zlibrary.core.resources.ZLResource;
import org.geometerplus.zlibrary.core.filesystem.ZLFile;
import org.geometerplus.zlibrary.core.options.Config;
import org.geometerplus.zlibrary.core.resources.ZLResource;
import org.geometerplus.fbreader.Paths;
public class FileFirstLevelTree extends FirstLevelTree {
FileFirstLevelTree(RootTree root) {
super(root, ROOT_FILE_TREE);
Config.Instance().runOnStart(new Runnable() {
public void run() {
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, String summary) {
final ZLFile file = ZLFile.createFileByPath(path);