1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-05 10:49:24 +02:00

fixed book info reloading

This commit is contained in:
Nikolay Pultsin 2011-07-18 13:25:54 +01:00
parent 6e797b0895
commit de16772e76
6 changed files with 67 additions and 5 deletions

View file

@ -101,14 +101,14 @@ public abstract class LibraryTree extends FBTree {
public boolean removeBook(Book book) {
final LinkedList<FBTree> toRemove = new LinkedList<FBTree>();
for (FBTree tree : this) {
if ((tree instanceof BookTree) && ((BookTree)tree).Book.equals(book)) {
if (tree instanceof BookTree && ((BookTree)tree).Book.equals(book)) {
toRemove.add(tree);
}
}
for (FBTree tree : toRemove) {
tree.removeSelf();
FBTree parent = tree.Parent;
for (; (parent != null) && !parent.hasChildren(); parent = parent.Parent) {
for (; parent != null && !(parent instanceof FirstLevelTree) && !parent.hasChildren(); parent = parent.Parent) {
parent.removeSelf();
}
for (; parent != null; parent = parent.Parent) {