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:
parent
6e797b0895
commit
de16772e76
6 changed files with 67 additions and 5 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue