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:
parent
34119928a0
commit
c5f9ea0bd4
5 changed files with 41 additions and 12 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue