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

custom links search; custom links update

This commit is contained in:
Nikolay Pultsin 2011-03-04 22:23:23 +00:00
parent 34119928a0
commit c5f9ea0bd4
5 changed files with 41 additions and 12 deletions

View file

@ -244,6 +244,15 @@ public class NetworkLibrary {
}
}
}
for (INetworkLink link : myLinks) {
if (link instanceof ICustomNetworkLink) {
final ICustomNetworkLink customLink = (ICustomNetworkLink)link;
if (customLink.isObsolete(12 * 60 * 60 * 1000)) { // 12 hours
customLink.reloadInfo(true);
NetworkDatabase.Instance().saveCustomLink(customLink);
}
}
}
}
}
@ -253,12 +262,11 @@ public class NetworkLibrary {
// synchronize() method MUST be called after this method
public void finishBackgroundUpdate() {
synchronized (myBackgroundLock) {
if (myBackgroundLinks == null) {
return;
}
synchronized (myLinks) {
removeAllLoadedLinks();
myLinks.addAll(myBackgroundLinks);
if (myBackgroundLinks != null) {
removeAllLoadedLinks();
myLinks.addAll(myBackgroundLinks);
}
invalidateChildren();
}
}