1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-05 19:42:17 +02:00

deleted unused methods

This commit is contained in:
Nikolay Pultsin 2013-01-14 05:19:23 +04:00
parent 64911efecf
commit cf6927246d
5 changed files with 0 additions and 50 deletions

View file

@ -862,42 +862,6 @@ public final class SQLiteBooksDatabase extends BooksDatabase {
myStorePositionStatement.execute();
}
private SQLiteStatement myInsertIntoBookListStatement;
protected boolean insertIntoBookList(long bookId) {
if (myInsertIntoBookListStatement == null) {
myInsertIntoBookListStatement = myDatabase.compileStatement(
"INSERT OR IGNORE INTO BookList(book_id) VALUES (?)"
);
}
myInsertIntoBookListStatement.bindLong(1, bookId);
myInsertIntoBookListStatement.execute();
return true;
}
private SQLiteStatement myDeleteFromBookListStatement;
protected boolean deleteFromBookList(long bookId) {
if (myDeleteFromBookListStatement == null) {
myDeleteFromBookListStatement = myDatabase.compileStatement(
"DELETE FROM BookList WHERE book_id = ?"
);
}
myDeleteFromBookListStatement.bindLong(1, bookId);
myDeleteFromBookListStatement.execute();
deleteVisitedHyperlinks(bookId);
return true;
}
private SQLiteStatement myCheckBookListStatement;
protected boolean checkBookList(long bookId) {
if (myCheckBookListStatement == null) {
myCheckBookListStatement = myDatabase.compileStatement(
"SELECT COUNT(*) FROM BookList WHERE book_id = ?"
);
}
myCheckBookListStatement.bindLong(1, bookId);
return myCheckBookListStatement.simpleQueryForLong() > 0;
}
private SQLiteStatement myDeleteVisitedHyperlinksStatement;
private void deleteVisitedHyperlinks(long bookId) {
if (myDeleteVisitedHyperlinksStatement == null) {

View file

@ -337,14 +337,12 @@ public final class FBReaderApp extends ZLApplication {
}
Book book = Book.getByFile(file);
if (book != null) {
book.insertIntoBookList();
return book;
}
if (file.isArchive()) {
for (ZLFile child : file.children()) {
book = Book.getByFile(child);
if (book != null) {
book.insertIntoBookList();
return book;
}
}

View file

@ -478,12 +478,6 @@ public class Book {
}
}
public void insertIntoBookList() {
if (myId != -1) {
BooksDatabase.Instance().insertIntoBookList(myId);
}
}
public String getContentHashCode() {
InputStream stream = null;

View file

@ -104,10 +104,6 @@ public abstract class BooksDatabase {
protected abstract ZLTextPosition getStoredPosition(long bookId);
protected abstract void storePosition(long bookId, ZLTextPosition position);
protected abstract boolean insertIntoBookList(long bookId);
protected abstract boolean deleteFromBookList(long bookId);
protected abstract boolean checkBookList(long bookId);
protected abstract Collection<String> loadVisitedHyperlinks(long bookId);
protected abstract void addVisitedHyperlink(long bookId, String hyperlinkId);
}

View file

@ -396,7 +396,6 @@ public final class Library {
physicalFiles.add(file);
}
if (file != book.File && file != null && file.getPath().endsWith(".epub")) {
myDatabase.deleteFromBookList(book.getId());
continue;
}
if (book.File.exists()) {
@ -633,7 +632,6 @@ public final class Library {
getFirstLevelTree(ROOT_FAVORITES).removeBook(book, false);
myRootTree.removeBook(book, true);
myDatabase.deleteFromBookList(book.getId());
if ((removeMode & REMOVE_FROM_DISK) != 0) {
book.File.getPhysicalFile().delete();
}