1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-03 01:39:18 +02:00

fixed synchronization

This commit is contained in:
Nikolay Pultsin 2011-07-19 12:32:57 +01:00
parent 70a58af8e7
commit 61f8b19ee4
5 changed files with 30 additions and 29 deletions

View file

@ -1 +0,0 @@
* replace HtmlToString by android.text.Html

View file

@ -1,16 +1,11 @@
0.99:
DONE Reload book info from file
DONE don't run several initialization threads in the same time
DONE lib.ololo.cc
After 0.99:
* returning from footnotes (ask if footnote is in the same model and there was page scrolling)
DONE returning from footnotes (ask if footnote is in the same model and there was page scrolling)
* prevent from sleep if battery is in charging mode
* Open the help file if the current book is deleted from library
* Partial loading from database
DONE Partial loading from database
* Database updating in backgorund
* Watch filesystem after loading
* Show wait message during search
DONE Show wait message during search
* Reload book info for all the files
* garbage in Boris Akunin, Сказки для идиотов

View file

@ -1,5 +1,4 @@
* 'sign out' feature for basic-auth
* SSLCertificate processing
DONE show 'empty basket' message without opening of catalog
* update basket view if basket content is changed
@ -14,14 +13,14 @@ DONE show recommendation item if basket is not empty
* separate search for each catalog (if search URL is presented)
* menu search button should be available for all catalog levels
* float point numbers as series index
* replace AuthenticationCatalog by AuthenticationActivity
DONE float point numbers as series index
DONE replace AuthenticationCatalog by AuthenticationActivity
* 'recently visited catalogs' item
* load search URL for catalogs from these catalogs, not from our generic file
DONE show library name in network book activity
* litres: credit card top up
* litres: terminal (?) top up
DONE litres: credit card top up
* litres: self-service kiosk top up
DONE litres: similar books link
------------------------------

View file

@ -128,9 +128,9 @@ public class LibraryActivity extends BaseActivity implements MenuItem.OnMenuItem
@Override
protected void onActivityResult(int requestCode, int returnCode, Intent intent) {
if (requestCode == BOOK_INFO_REQUEST) {
final String path = intent.getStringExtra(BookInfoActivity.CURRENT_BOOK_PATH_KEY);
final Book book = Book.getByFile(ZLFile.createFileByPath(path));
myLibrary.refreshBookInfo(book);
//final String path = intent.getStringExtra(BookInfoActivity.CURRENT_BOOK_PATH_KEY);
//final Book book = Book.getByFile(ZLFile.createFileByPath(path));
//myLibrary.refreshBookInfo(book);
getListView().invalidateViews();
} else {
super.onActivityResult(requestCode, returnCode, intent);

View file

@ -63,9 +63,11 @@ public class NetworkLibrary {
public List<String> languageCodes() {
final TreeSet<String> languageSet = new TreeSet<String>();
synchronized (myLinks) {
for (INetworkLink link : myLinks) {
languageSet.add(link.getLanguage());
}
}
return new ArrayList<String>(languageSet);
}
@ -112,12 +114,14 @@ public class NetworkLibrary {
private List<INetworkLink> activeLinks() {
final LinkedList<INetworkLink> filteredList = new LinkedList<INetworkLink>();
final Collection<String> codes = activeLanguageCodes();
synchronized (myLinks) {
for (INetworkLink link : myLinks) {
if (link instanceof ICustomNetworkLink ||
codes.contains(link.getLanguage())) {
filteredList.add(link);
}
}
}
return filteredList;
}
@ -158,11 +162,13 @@ public class NetworkLibrary {
private void removeAllLoadedLinks() {
final LinkedList<INetworkLink> toRemove = new LinkedList<INetworkLink>();
synchronized (myLinks) {
for (INetworkLink link : myLinks) {
if (!(link instanceof ICustomNetworkLink)) {
toRemove.add(link);
}
}
}
myLinks.removeAll(toRemove);
}
@ -233,11 +239,13 @@ public class NetworkLibrary {
public String rewriteUrl(String url, boolean externalUrl) {
final String host = ZLNetworkUtil.hostFromUrl(url).toLowerCase();
synchronized (myLinks) {
for (INetworkLink link : myLinks) {
if (host.contains(link.getSiteName())) {
url = link.rewriteUrl(url, externalUrl);
}
}
}
return url;
}