mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-04 10:19:33 +02:00
fixed library tree comparison
This commit is contained in:
parent
803126b649
commit
aa4791db4f
3 changed files with 25 additions and 1 deletions
|
@ -21,6 +21,8 @@ package org.geometerplus.fbreader.library;
|
|||
|
||||
import org.geometerplus.zlibrary.core.image.ZLImage;
|
||||
|
||||
import org.geometerplus.fbreader.tree.FBTree;
|
||||
|
||||
public class BookTree extends LibraryTree {
|
||||
public final Book Book;
|
||||
private final boolean myShowAuthors;
|
||||
|
@ -86,6 +88,23 @@ public class BookTree extends LibraryTree {
|
|||
return book != null && book.equals(Book);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getSortKey() {
|
||||
return "BSK:" + super.getSortKey();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(FBTree tree) {
|
||||
final int cmp = super.compareTo(tree);
|
||||
if (cmp == 0 && tree instanceof BookTree) {
|
||||
final Book b = ((BookTree)tree).Book;
|
||||
if (Book != null && b != null) {
|
||||
return Book.File.getPath().compareTo(b.File.getPath());
|
||||
}
|
||||
}
|
||||
return cmp;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object object) {
|
||||
if (object == this) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue