mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-04 10:19:33 +02:00
synchronization with multidir branch ;)
This commit is contained in:
parent
faa64fe9a1
commit
afa523fbff
6 changed files with 7 additions and 16 deletions
|
@ -19,13 +19,10 @@
|
|||
|
||||
package org.geometerplus.android.fbreader.libraryService;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.geometerplus.fbreader.book.Author;
|
||||
import org.geometerplus.fbreader.book.Tag;
|
||||
|
||||
public abstract class Util {
|
||||
abstract class Util {
|
||||
static String authorToString(Author author) {
|
||||
return new StringBuilder(author.DisplayName).append('\000').append(author.SortKey).toString();
|
||||
}
|
||||
|
@ -51,8 +48,4 @@ public abstract class Util {
|
|||
return Tag.NULL;
|
||||
}
|
||||
}
|
||||
|
||||
public static List<String> splitDirectories(String value) {
|
||||
return Arrays.asList(value.split(";"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ import java.util.List;
|
|||
|
||||
import android.os.Environment;
|
||||
|
||||
import org.geometerplus.android.fbreader.libraryService.Util;
|
||||
import org.geometerplus.zlibrary.core.options.ZLStringOption;
|
||||
import org.geometerplus.zlibrary.core.options.ZLStringListOption;
|
||||
|
||||
|
|
|
@ -19,13 +19,10 @@
|
|||
|
||||
package org.geometerplus.fbreader.library;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.geometerplus.zlibrary.core.resources.ZLResource;
|
||||
import org.geometerplus.zlibrary.core.filesystem.ZLFile;
|
||||
|
||||
import org.geometerplus.fbreader.Paths;
|
||||
import org.geometerplus.android.fbreader.libraryService.Util;
|
||||
|
||||
public class FileFirstLevelTree extends FirstLevelTree {
|
||||
FileFirstLevelTree(RootTree root) {
|
||||
|
|
|
@ -100,6 +100,9 @@ public class FileTree extends LibraryTree {
|
|||
public Book getBook() {
|
||||
if (myBook == null) {
|
||||
myBook = Collection.getBookByFile(myFile);
|
||||
if (myBook == null) {
|
||||
myBook = NULL_BOOK;
|
||||
}
|
||||
}
|
||||
return myBook instanceof Book ? (Book)myBook : null;
|
||||
}
|
||||
|
|
|
@ -21,17 +21,17 @@ package org.geometerplus.fbreader.library;
|
|||
|
||||
import org.geometerplus.zlibrary.core.resources.ZLResource;
|
||||
|
||||
class FirstLevelTree extends LibraryTree {
|
||||
abstract class FirstLevelTree extends LibraryTree {
|
||||
private final String myId;
|
||||
private final ZLResource myResource;
|
||||
|
||||
FirstLevelTree(LibraryTree root, int position, String id) {
|
||||
FirstLevelTree(RootTree root, int position, String id) {
|
||||
super(root, position);
|
||||
myId = id;
|
||||
myResource = resource().getResource(myId);
|
||||
}
|
||||
|
||||
FirstLevelTree(LibraryTree root, String id) {
|
||||
FirstLevelTree(RootTree root, String id) {
|
||||
super(root);
|
||||
myId = id;
|
||||
myResource = resource().getResource(myId);
|
||||
|
|
|
@ -41,7 +41,6 @@ public abstract class LibraryTree extends FBTree {
|
|||
static final String ROOT_BY_SERIES = "bySeries";
|
||||
static final String ROOT_BY_TAG = "byTag";
|
||||
static final String ROOT_FILE_TREE = "fileTree";
|
||||
static final String NODE_LIBRARY_DIRECTORY = "fileTreeLibrary";
|
||||
|
||||
protected LibraryTree(IBookCollection collection) {
|
||||
super();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue