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

Catalog`s visibility code cleanup (2)

git-svn-id: https://only.mawhrin.net/repos/FBReaderJ/trunk@1377 6a642e6f-84f6-412e-ac94-c4a38d5a04b0
This commit is contained in:
Vasiliy Bout 2010-05-12 10:30:45 +00:00
parent 52940ddf81
commit 458b1e33ff
6 changed files with 15 additions and 15 deletions

View file

@ -49,7 +49,7 @@ public class NetworkLibrary {
private final RootTree myRootTree = new RootTree();
private boolean myUpdateChildren = true;
private boolean myUpdateAccountDependents;
private boolean myUpdateVisibility;
private static class LinksComparator implements Comparator<NetworkLink> {
public int compare(NetworkLink link1, NetworkLink link2) {
@ -123,8 +123,8 @@ public class NetworkLibrary {
myUpdateChildren = true;
}
public void invalidateAccountDependents() {
myUpdateAccountDependents = true;
public void invalidateVisibility() {
myUpdateVisibility = true;
}
private void makeUpToDate() {
@ -192,12 +192,12 @@ public class NetworkLibrary {
}
}
private void updateAccountDependents() {
private void updateVisibility() {
for (FBTree tree: myRootTree.subTrees()) {
if (!(tree instanceof NetworkCatalogTree)) {
continue;
}
((NetworkCatalogTree) tree).updateAccountDependents();
((NetworkCatalogTree) tree).updateVisibility();
}
}
@ -206,9 +206,9 @@ public class NetworkLibrary {
myUpdateChildren = false;
makeUpToDate();
}
if (myUpdateAccountDependents) {
myUpdateAccountDependents = false;
updateAccountDependents();
if (myUpdateVisibility) {
myUpdateVisibility = false;
updateVisibility();
}
}