mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-04 18:29:23 +02:00
fixed library tree comparison
This commit is contained in:
parent
803126b649
commit
aa4791db4f
3 changed files with 25 additions and 1 deletions
|
@ -46,7 +46,7 @@ public class AuthorTree extends LibraryTree {
|
|||
|
||||
@Override
|
||||
protected String getSortKey() {
|
||||
return Author != null ? Author.SortKey + ":" + Author.DisplayName : null;
|
||||
return Author != null ? "ASK:" + Author.SortKey + ":" + Author.DisplayName : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -61,4 +61,9 @@ public final class SeriesTree extends LibraryTree {
|
|||
final SeriesInfo info = book.getSeriesInfo();
|
||||
return info != null && Series.equals(info.Name);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getSortKey() {
|
||||
return "SSK:" + super.getSortKey();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue