diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 85ff29f53..86a5012d2 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -99,7 +99,11 @@
-
+
+
+
+
+
diff --git a/AndroidManifest.xml.pattern b/AndroidManifest.xml.pattern
index 1251cc6eb..a4e4711dd 100644
--- a/AndroidManifest.xml.pattern
+++ b/AndroidManifest.xml.pattern
@@ -99,7 +99,11 @@
-
+
+
+
+
+
diff --git a/src/org/geometerplus/android/fbreader/library/LibraryActivity.java b/src/org/geometerplus/android/fbreader/library/LibraryActivity.java
index 8486e0902..fcddef4e6 100644
--- a/src/org/geometerplus/android/fbreader/library/LibraryActivity.java
+++ b/src/org/geometerplus/android/fbreader/library/LibraryActivity.java
@@ -149,7 +149,7 @@ public class LibraryActivity extends TreeActivity implements MenuIt
new ZLStringOption("BookSearch", "Pattern", "");
private void openSearchResults() {
- final FBTree tree = myLibrary.getRootTree().getSubTree(Library.ROOT_FOUND);
+ final FBTree tree = myLibrary.getRootTree().getSubTree(LibraryTree.ROOT_FOUND);
if (tree != null) {
openTree(tree);
}
diff --git a/src/org/geometerplus/android/fbreader/library/LibraryTreeAdapter.java b/src/org/geometerplus/android/fbreader/library/LibraryTreeAdapter.java
index 798157a17..f41f44e1e 100644
--- a/src/org/geometerplus/android/fbreader/library/LibraryTreeAdapter.java
+++ b/src/org/geometerplus/android/fbreader/library/LibraryTreeAdapter.java
@@ -77,19 +77,19 @@ class LibraryTreeAdapter extends TreeAdapter {
return R.drawable.ic_list_library_book;
} else if (tree instanceof FirstLevelTree) {
final String id = tree.getUniqueKey().Id;
- if (Library.ROOT_FAVORITES.equals(id)) {
+ if (LibraryTree.ROOT_FAVORITES.equals(id)) {
return R.drawable.ic_list_library_favorites;
- } else if (Library.ROOT_RECENT.equals(id)) {
+ } else if (LibraryTree.ROOT_RECENT.equals(id)) {
return R.drawable.ic_list_library_recent;
- } else if (Library.ROOT_BY_AUTHOR.equals(id)) {
+ } else if (LibraryTree.ROOT_BY_AUTHOR.equals(id)) {
return R.drawable.ic_list_library_authors;
- } else if (Library.ROOT_BY_TITLE.equals(id)) {
+ } else if (LibraryTree.ROOT_BY_TITLE.equals(id)) {
return R.drawable.ic_list_library_books;
- } else if (Library.ROOT_BY_TAG.equals(id)) {
+ } else if (LibraryTree.ROOT_BY_TAG.equals(id)) {
return R.drawable.ic_list_library_tags;
- } else if (Library.ROOT_FILE_TREE.equals(id)) {
+ } else if (LibraryTree.ROOT_FILE_TREE.equals(id)) {
return R.drawable.ic_list_library_folder;
- } else if (Library.ROOT_FOUND.equals(id)) {
+ } else if (LibraryTree.ROOT_FOUND.equals(id)) {
return R.drawable.ic_list_library_search;
}
} else if (tree instanceof FileTree) {
diff --git a/src/org/geometerplus/fbreader/library/AuthorTree.java b/src/org/geometerplus/fbreader/library/AuthorTree.java
index 0d7325093..79dfb135c 100644
--- a/src/org/geometerplus/fbreader/library/AuthorTree.java
+++ b/src/org/geometerplus/fbreader/library/AuthorTree.java
@@ -19,13 +19,13 @@
package org.geometerplus.fbreader.library;
-import org.geometerplus.fbreader.book.Author;
-import org.geometerplus.fbreader.book.Book;
+import org.geometerplus.fbreader.book.*;
public class AuthorTree extends LibraryTree {
public final Author Author;
- AuthorTree(Author author) {
+ AuthorTree(IBookCollection collection, Author author) {
+ super(collection);
Author = author;
}
diff --git a/src/org/geometerplus/fbreader/library/BookInSeriesTree.java b/src/org/geometerplus/fbreader/library/BookInSeriesTree.java
index 4d15af03e..1b613bc8c 100644
--- a/src/org/geometerplus/fbreader/library/BookInSeriesTree.java
+++ b/src/org/geometerplus/fbreader/library/BookInSeriesTree.java
@@ -22,11 +22,12 @@ package org.geometerplus.fbreader.library;
import java.math.BigDecimal;
import org.geometerplus.fbreader.book.Book;
+import org.geometerplus.fbreader.book.IBookCollection;
import org.geometerplus.fbreader.tree.FBTree;
public final class BookInSeriesTree extends BookTree {
- BookInSeriesTree(Book book) {
- super(book, false);
+ BookInSeriesTree(IBookCollection collection, Book book) {
+ super(collection, book, false);
}
BookInSeriesTree(LibraryTree parent, Book book, int position) {
diff --git a/src/org/geometerplus/fbreader/library/BookTree.java b/src/org/geometerplus/fbreader/library/BookTree.java
index 6fb2acfa3..e03083771 100644
--- a/src/org/geometerplus/fbreader/library/BookTree.java
+++ b/src/org/geometerplus/fbreader/library/BookTree.java
@@ -28,7 +28,8 @@ public class BookTree extends LibraryTree {
public final Book Book;
private final boolean myShowAuthors;
- BookTree(Book book, boolean showAuthors) {
+ BookTree(IBookCollection collection, Book book, boolean showAuthors) {
+ super(collection);
Book = book;
myShowAuthors = showAuthors;
}
diff --git a/src/org/geometerplus/fbreader/library/FavoritesTree.java b/src/org/geometerplus/fbreader/library/FavoritesTree.java
index a862bde1d..dc226f02f 100644
--- a/src/org/geometerplus/fbreader/library/FavoritesTree.java
+++ b/src/org/geometerplus/fbreader/library/FavoritesTree.java
@@ -23,11 +23,8 @@ import org.geometerplus.fbreader.book.Book;
import org.geometerplus.fbreader.book.IBookCollection;
public class FavoritesTree extends FirstLevelTree {
- private final IBookCollection myCollection;
-
- FavoritesTree(IBookCollection collection, RootTree root, String id) {
- super(root, id);
- myCollection = collection;
+ FavoritesTree(RootTree root) {
+ super(root, ROOT_FAVORITES);
}
@Override
diff --git a/src/org/geometerplus/fbreader/library/FileFirstLevelTree.java b/src/org/geometerplus/fbreader/library/FileFirstLevelTree.java
index 608c899cd..e427df884 100644
--- a/src/org/geometerplus/fbreader/library/FileFirstLevelTree.java
+++ b/src/org/geometerplus/fbreader/library/FileFirstLevelTree.java
@@ -23,14 +23,10 @@ import org.geometerplus.zlibrary.core.resources.ZLResource;
import org.geometerplus.zlibrary.core.filesystem.ZLFile;
import org.geometerplus.fbreader.Paths;
-import org.geometerplus.fbreader.book.IBookCollection;
public class FileFirstLevelTree extends FirstLevelTree {
- private final IBookCollection myCollection;
-
- FileFirstLevelTree(IBookCollection collection, RootTree root, String id) {
- super(root, id);
- myCollection = collection;
+ FileFirstLevelTree(RootTree root) {
+ super(root, ROOT_FILE_TREE);
addChild(Paths.BooksDirectoryOption().getValue(), "fileTreeLibrary");
addChild("/", "fileTreeRoot");
addChild(Paths.cardDirectory(), "fileTreeCard");
@@ -42,7 +38,6 @@ public class FileFirstLevelTree extends FirstLevelTree {
final ZLResource resource = Library.resource().getResource(resourceKey);
new FileTree(
this,
- myCollection,
file,
resource.getValue(),
resource.getResource("summary").getValue()
diff --git a/src/org/geometerplus/fbreader/library/FileTree.java b/src/org/geometerplus/fbreader/library/FileTree.java
index 21d632173..575cb9ab7 100644
--- a/src/org/geometerplus/fbreader/library/FileTree.java
+++ b/src/org/geometerplus/fbreader/library/FileTree.java
@@ -29,15 +29,13 @@ import org.geometerplus.fbreader.formats.PluginCollection;
import org.geometerplus.fbreader.tree.FBTree;
public class FileTree extends LibraryTree {
- private final IBookCollection myCollection;
private final ZLFile myFile;
private final String myName;
private final String mySummary;
private final boolean myIsSelectable;
- FileTree(LibraryTree parent, IBookCollection collection, ZLFile file, String name, String summary) {
+ FileTree(LibraryTree parent, ZLFile file, String name, String summary) {
super(parent);
- myCollection = collection;
myFile = file;
myName = name;
mySummary = summary;
@@ -46,7 +44,6 @@ public class FileTree extends LibraryTree {
public FileTree(FileTree parent, ZLFile file) {
super(parent);
- myCollection = parent.myCollection;
myFile = file;
myName = null;
mySummary = null;
diff --git a/src/org/geometerplus/fbreader/library/Library.java b/src/org/geometerplus/fbreader/library/Library.java
index 759faa6cc..3e3f08209 100644
--- a/src/org/geometerplus/fbreader/library/Library.java
+++ b/src/org/geometerplus/fbreader/library/Library.java
@@ -35,15 +35,6 @@ public final class Library {
return ZLResource.resource("library");
}
- public static final String ROOT_FOUND = "found";
- public static final String ROOT_FAVORITES = "favorites";
- public static final String ROOT_RECENT = "recent";
- public static final String ROOT_BY_AUTHOR = "byAuthor";
- public static final String ROOT_BY_TITLE = "byTitle";
- public static final String ROOT_BY_SERIES = "bySeries";
- public static final String ROOT_BY_TAG = "byTag";
- public static final String ROOT_FILE_TREE = "fileTree";
-
public static final int REMOVE_DONT_REMOVE = 0x00;
public static final int REMOVE_FROM_LIBRARY = 0x01;
public static final int REMOVE_FROM_DISK = 0x02;
@@ -92,7 +83,7 @@ public final class Library {
private final Map myBooks =
Collections.synchronizedMap(new HashMap());
- private final RootTree myRootTree = new RootTree();
+ private final RootTree myRootTree;
private boolean myDoGroupTitlesByFirstLetter;
private final static int STATUS_LOADING = 1;
@@ -113,12 +104,14 @@ public final class Library {
myDatabase = db;
Collection = new BookCollection(db);
- new FavoritesTree(Collection, myRootTree, ROOT_FAVORITES);
- new RecentBooksTree(Collection, myRootTree, ROOT_RECENT);
- new FirstLevelTree(myRootTree, ROOT_BY_AUTHOR);
- new FirstLevelTree(myRootTree, ROOT_BY_TITLE);
- new FirstLevelTree(myRootTree, ROOT_BY_TAG);
- new FileFirstLevelTree(Collection, myRootTree, ROOT_FILE_TREE);
+ myRootTree = new RootTree(Collection);
+
+ new FavoritesTree(myRootTree);
+ new RecentBooksTree(myRootTree);
+ new FirstLevelTree(myRootTree, LibraryTree.ROOT_BY_AUTHOR);
+ new FirstLevelTree(myRootTree, LibraryTree.ROOT_BY_TITLE);
+ new FirstLevelTree(myRootTree, LibraryTree.ROOT_BY_TAG);
+ new FileFirstLevelTree(myRootTree);
}
public LibraryTree getRootTree() {
@@ -235,7 +228,7 @@ public final class Library {
private LibraryTree getTagTree(Tag tag) {
if (tag == null || tag.Parent == null) {
- return getFirstLevelTree(ROOT_BY_TAG).getTagSubTree(tag);
+ return getFirstLevelTree(LibraryTree.ROOT_BY_TAG).getTagSubTree(tag);
} else {
return getTagTree(tag.Parent).getTagSubTree(tag);
}
@@ -253,7 +246,7 @@ public final class Library {
}
final SeriesInfo seriesInfo = book.getSeriesInfo();
for (Author a : authors) {
- final AuthorTree authorTree = getFirstLevelTree(ROOT_BY_AUTHOR).getAuthorSubTree(a);
+ final AuthorTree authorTree = getFirstLevelTree(LibraryTree.ROOT_BY_AUTHOR).getAuthorSubTree(a);
if (seriesInfo == null) {
authorTree.getBookSubTree(book, false);
} else {
@@ -262,12 +255,12 @@ public final class Library {
}
if (seriesInfo != null) {
- FirstLevelTree seriesRoot = getFirstLevelTree(ROOT_BY_SERIES);
+ FirstLevelTree seriesRoot = getFirstLevelTree(LibraryTree.ROOT_BY_SERIES);
if (seriesRoot == null) {
seriesRoot = new FirstLevelTree(
myRootTree,
- myRootTree.indexOf(getFirstLevelTree(ROOT_BY_TITLE)) + 1,
- ROOT_BY_SERIES
+ myRootTree.indexOf(getFirstLevelTree(LibraryTree.ROOT_BY_TITLE)) + 1,
+ LibraryTree.ROOT_BY_SERIES
);
}
seriesRoot.getSeriesSubTree(seriesInfo.Title).getBookInSeriesSubTree(book);
@@ -277,11 +270,11 @@ public final class Library {
final String letter = TitleTree.firstTitleLetter(book);
if (letter != null) {
final TitleTree tree =
- getFirstLevelTree(ROOT_BY_TITLE).getTitleSubTree(letter);
+ getFirstLevelTree(LibraryTree.ROOT_BY_TITLE).getTitleSubTree(letter);
tree.getBookSubTree(book, true);
}
} else {
- getFirstLevelTree(ROOT_BY_TITLE).getBookSubTree(book, true);
+ getFirstLevelTree(LibraryTree.ROOT_BY_TITLE).getBookSubTree(book, true);
}
List tags = book.tags();
@@ -293,7 +286,7 @@ public final class Library {
}
final SearchResultsTree found =
- (SearchResultsTree)getFirstLevelTree(ROOT_FOUND);
+ (SearchResultsTree)getFirstLevelTree(LibraryTree.ROOT_FOUND);
if (found != null && book.matches(found.getPattern())) {
found.getBookSubTree(book, true);
}
@@ -309,7 +302,7 @@ public final class Library {
private void refreshInTree(String rootId, Book book) {
final FirstLevelTree tree = getFirstLevelTree(rootId);
if (tree != null) {
- int index = tree.indexOf(new BookTree(book, true));
+ int index = tree.indexOf(new BookTree(Collection, book, true));
if (index >= 0) {
tree.removeBook(book, false);
new BookTree(tree, book, true, index);
@@ -323,13 +316,12 @@ public final class Library {
}
myBooks.remove(book.File);
- refreshInTree(ROOT_FAVORITES, book);
- refreshInTree(ROOT_RECENT, book);
- removeFromTree(ROOT_FOUND, book);
- removeFromTree(ROOT_BY_TITLE, book);
- removeFromTree(ROOT_BY_SERIES, book);
- removeFromTree(ROOT_BY_AUTHOR, book);
- removeFromTree(ROOT_BY_TAG, book);
+ refreshInTree(LibraryTree.ROOT_FAVORITES, book);
+ removeFromTree(LibraryTree.ROOT_FOUND, book);
+ removeFromTree(LibraryTree.ROOT_BY_TITLE, book);
+ removeFromTree(LibraryTree.ROOT_BY_SERIES, book);
+ removeFromTree(LibraryTree.ROOT_BY_AUTHOR, book);
+ removeFromTree(LibraryTree.ROOT_BY_TAG, book);
addBookToLibrary(book);
fireModelChangedEvent(ChangeListener.Code.BookAdded);
}
@@ -357,7 +349,7 @@ public final class Library {
}
for (Book book : Collection.favorites()) {
- getFirstLevelTree(ROOT_FAVORITES).getBookSubTree(book, true);
+ getFirstLevelTree(LibraryTree.ROOT_FAVORITES).getBookSubTree(book, true);
}
fireModelChangedEvent(ChangeListener.Code.BookAdded);
@@ -512,7 +504,7 @@ public final class Library {
pattern = pattern.toLowerCase();
- final SearchResultsTree oldSearchResults = (SearchResultsTree)getFirstLevelTree(ROOT_FOUND);
+ final SearchResultsTree oldSearchResults = (SearchResultsTree)getFirstLevelTree(LibraryTree.ROOT_FOUND);
if (oldSearchResults != null && pattern.equals(oldSearchResults.getPattern())) {
fireModelChangedEvent(ChangeListener.Code.Found);
return;
@@ -530,7 +522,7 @@ public final class Library {
if (oldSearchResults != null) {
oldSearchResults.removeSelf();
}
- newSearchResults = new SearchResultsTree(myRootTree, ROOT_FOUND, pattern);
+ newSearchResults = new SearchResultsTree(myRootTree, LibraryTree.ROOT_FOUND, pattern);
fireModelChangedEvent(ChangeListener.Code.Found);
}
newSearchResults.getBookSubTree(book, true);
@@ -551,7 +543,7 @@ public final class Library {
if (book == null) {
return false;
}
- final LibraryTree rootFavorites = getFirstLevelTree(ROOT_FAVORITES);
+ final LibraryTree rootFavorites = getFirstLevelTree(LibraryTree.ROOT_FAVORITES);
for (FBTree tree : rootFavorites.subTrees()) {
if (tree instanceof BookTree && book.equals(((BookTree)tree).Book)) {
return true;
@@ -564,13 +556,13 @@ public final class Library {
if (isBookInFavorites(book)) {
return;
}
- final LibraryTree rootFavorites = getFirstLevelTree(ROOT_FAVORITES);
+ final LibraryTree rootFavorites = getFirstLevelTree(LibraryTree.ROOT_FAVORITES);
rootFavorites.getBookSubTree(book, true);
Collection.setBookFavorite(book, true);
}
public void removeBookFromFavorites(Book book) {
- if (getFirstLevelTree(ROOT_FAVORITES).removeBook(book, false)) {
+ if (getFirstLevelTree(LibraryTree.ROOT_FAVORITES).removeBook(book, false)) {
Collection.setBookFavorite(book, false);
fireModelChangedEvent(ChangeListener.Code.BookRemoved);
}
@@ -595,12 +587,12 @@ public final class Library {
return;
}
myBooks.remove(book.File);
- if (getFirstLevelTree(ROOT_RECENT).removeBook(book, false)) {
+ if (getFirstLevelTree(LibraryTree.ROOT_RECENT).removeBook(book, false)) {
final List ids = myDatabase.loadRecentBookIds();
ids.remove(book.getId());
myDatabase.saveRecentBookIds(ids);
}
- getFirstLevelTree(ROOT_FAVORITES).removeBook(book, false);
+ getFirstLevelTree(LibraryTree.ROOT_FAVORITES).removeBook(book, false);
myRootTree.removeBook(book, true);
if ((removeMode & REMOVE_FROM_DISK) != 0) {
diff --git a/src/org/geometerplus/fbreader/library/LibraryTree.java b/src/org/geometerplus/fbreader/library/LibraryTree.java
index 9d6986045..fc96021e4 100644
--- a/src/org/geometerplus/fbreader/library/LibraryTree.java
+++ b/src/org/geometerplus/fbreader/library/LibraryTree.java
@@ -25,16 +25,30 @@ import org.geometerplus.fbreader.book.*;
import org.geometerplus.fbreader.tree.FBTree;
public abstract class LibraryTree extends FBTree {
- protected LibraryTree() {
+ public static final String ROOT_FOUND = "found";
+ public static final String ROOT_FAVORITES = "favorites";
+ public static final String ROOT_RECENT = "recent";
+ public static final String ROOT_BY_AUTHOR = "byAuthor";
+ public static final String ROOT_BY_TITLE = "byTitle";
+ public static final String ROOT_BY_SERIES = "bySeries";
+ public static final String ROOT_BY_TAG = "byTag";
+ public static final String ROOT_FILE_TREE = "fileTree";
+
+ public final IBookCollection Collection;
+
+ protected LibraryTree(IBookCollection collection) {
super();
+ Collection = collection;
}
protected LibraryTree(LibraryTree parent) {
super(parent);
+ Collection = parent.Collection;
}
protected LibraryTree(LibraryTree parent, int position) {
super(parent, position);
+ Collection = parent.Collection;
}
public Book getBook() {
@@ -50,7 +64,7 @@ public abstract class LibraryTree extends FBTree {
}
TagTree getTagSubTree(Tag tag) {
- final TagTree temp = new TagTree(tag);
+ final TagTree temp = new TagTree(Collection, tag);
int position = Collections.binarySearch(subTrees(), temp);
if (position >= 0) {
return (TagTree)subTrees().get(position);
@@ -60,7 +74,7 @@ public abstract class LibraryTree extends FBTree {
}
TitleTree getTitleSubTree(String title) {
- final TitleTree temp = new TitleTree(title);
+ final TitleTree temp = new TitleTree(Collection, title);
int position = Collections.binarySearch(subTrees(), temp);
if (position >= 0) {
return (TitleTree)subTrees().get(position);
@@ -70,7 +84,7 @@ public abstract class LibraryTree extends FBTree {
}
AuthorTree getAuthorSubTree(Author author) {
- final AuthorTree temp = new AuthorTree(author);
+ final AuthorTree temp = new AuthorTree(Collection, author);
int position = Collections.binarySearch(subTrees(), temp);
if (position >= 0) {
return (AuthorTree)subTrees().get(position);
@@ -80,7 +94,7 @@ public abstract class LibraryTree extends FBTree {
}
BookTree getBookSubTree(Book book, boolean showAuthors) {
- final BookTree temp = new BookTree(book, showAuthors);
+ final BookTree temp = new BookTree(Collection, book, showAuthors);
int position = Collections.binarySearch(subTrees(), temp);
if (position >= 0) {
return (BookTree)subTrees().get(position);
@@ -90,7 +104,7 @@ public abstract class LibraryTree extends FBTree {
}
SeriesTree getSeriesSubTree(String series) {
- final SeriesTree temp = new SeriesTree(series);
+ final SeriesTree temp = new SeriesTree(Collection, series);
int position = Collections.binarySearch(subTrees(), temp);
if (position >= 0) {
return (SeriesTree)subTrees().get(position);
diff --git a/src/org/geometerplus/fbreader/library/RecentBooksTree.java b/src/org/geometerplus/fbreader/library/RecentBooksTree.java
index 13e5bf31f..03d51b822 100644
--- a/src/org/geometerplus/fbreader/library/RecentBooksTree.java
+++ b/src/org/geometerplus/fbreader/library/RecentBooksTree.java
@@ -20,14 +20,10 @@
package org.geometerplus.fbreader.library;
import org.geometerplus.fbreader.book.Book;
-import org.geometerplus.fbreader.book.IBookCollection;
public class RecentBooksTree extends FirstLevelTree {
- private final IBookCollection myCollection;
-
- RecentBooksTree(IBookCollection collection, RootTree root, String id) {
- super(root, id);
- myCollection = collection;
+ RecentBooksTree(RootTree root) {
+ super(root, ROOT_RECENT);
}
@Override
@@ -38,7 +34,7 @@ public class RecentBooksTree extends FirstLevelTree {
@Override
public void waitForOpening() {
clear();
- for (Book book : myCollection.recentBooks()) {
+ for (Book book : Collection.recentBooks()) {
new BookTree(this, book, true);
}
}
diff --git a/src/org/geometerplus/fbreader/library/RootTree.java b/src/org/geometerplus/fbreader/library/RootTree.java
index e4b0164e6..a5387035d 100644
--- a/src/org/geometerplus/fbreader/library/RootTree.java
+++ b/src/org/geometerplus/fbreader/library/RootTree.java
@@ -19,8 +19,11 @@
package org.geometerplus.fbreader.library;
+import org.geometerplus.fbreader.book.IBookCollection;
+
class RootTree extends LibraryTree {
- RootTree() {
+ RootTree(IBookCollection collection) {
+ super(collection);
}
@Override
diff --git a/src/org/geometerplus/fbreader/library/SeriesTree.java b/src/org/geometerplus/fbreader/library/SeriesTree.java
index 1d8c578ea..b2cae1a49 100644
--- a/src/org/geometerplus/fbreader/library/SeriesTree.java
+++ b/src/org/geometerplus/fbreader/library/SeriesTree.java
@@ -21,13 +21,13 @@ package org.geometerplus.fbreader.library;
import java.util.Collections;
-import org.geometerplus.fbreader.book.Book;
-import org.geometerplus.fbreader.book.SeriesInfo;
+import org.geometerplus.fbreader.book.*;
public final class SeriesTree extends LibraryTree {
public final String Series;
- SeriesTree(String series) {
+ SeriesTree(IBookCollection collection, String series) {
+ super(collection);
Series = series;
}
@@ -47,7 +47,7 @@ public final class SeriesTree extends LibraryTree {
}
BookTree getBookInSeriesSubTree(Book book) {
- final BookInSeriesTree temp = new BookInSeriesTree(book);
+ final BookInSeriesTree temp = new BookInSeriesTree(Collection, book);
int position = Collections.binarySearch(subTrees(), temp);
if (position >= 0) {
return (BookInSeriesTree)subTrees().get(position);
diff --git a/src/org/geometerplus/fbreader/library/TagTree.java b/src/org/geometerplus/fbreader/library/TagTree.java
index 1b1748551..792ec39e4 100644
--- a/src/org/geometerplus/fbreader/library/TagTree.java
+++ b/src/org/geometerplus/fbreader/library/TagTree.java
@@ -19,13 +19,13 @@
package org.geometerplus.fbreader.library;
-import org.geometerplus.fbreader.book.Book;
-import org.geometerplus.fbreader.book.Tag;
+import org.geometerplus.fbreader.book.*;
public final class TagTree extends LibraryTree {
public final Tag Tag;
- TagTree(Tag tag) {
+ TagTree(IBookCollection collection, Tag tag) {
+ super(collection);
Tag = tag;
}
diff --git a/src/org/geometerplus/fbreader/library/TitleTree.java b/src/org/geometerplus/fbreader/library/TitleTree.java
index e82fd2805..143ebc511 100644
--- a/src/org/geometerplus/fbreader/library/TitleTree.java
+++ b/src/org/geometerplus/fbreader/library/TitleTree.java
@@ -20,6 +20,7 @@
package org.geometerplus.fbreader.library;
import org.geometerplus.fbreader.book.Book;
+import org.geometerplus.fbreader.book.IBookCollection;
public final class TitleTree extends LibraryTree {
static String firstTitleLetter(Book book) {
@@ -45,7 +46,8 @@ public final class TitleTree extends LibraryTree {
public final String Title;
- TitleTree(String title) {
+ TitleTree(IBookCollection collection, String title) {
+ super(collection);
Title = title;
}