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

Minor bugfixes: external books from archives in the Library

git-svn-id: https://only.mawhrin.net/repos/FBReaderJ/trunk@1743 6a642e6f-84f6-412e-ac94-c4a38d5a04b0
This commit is contained in:
Vasiliy Bout 2010-09-14 10:46:45 +00:00
parent c7d01a1e0a
commit e7738a2a5c
3 changed files with 12 additions and 1 deletions

View file

@ -1,3 +1,7 @@
===== 0.7.2 (??? ??, 2010) =====
* Minor bugfixes
===== 0.7.1 (Sep 13, 2010) ===== ===== 0.7.1 (Sep 13, 2010) =====
* Support for reading books from any folders (e.g. opening books via file-manager) * Support for reading books from any folders (e.g. opening books via file-manager)

View file

@ -58,7 +58,7 @@ final class SQLiteBooksDatabase extends BooksDatabase {
private void migrate() { private void migrate() {
final int version = myDatabase.getVersion(); final int version = myDatabase.getVersion();
final int currentVersion = 9; final int currentVersion = 10;
if (version >= currentVersion) { if (version >= currentVersion) {
return; return;
} }
@ -85,6 +85,8 @@ final class SQLiteBooksDatabase extends BooksDatabase {
updateTables7(); updateTables7();
case 8: case 8:
updateTables8(); updateTables8();
case 9:
updateTables9();
} }
myDatabase.setTransactionSuccessful(); myDatabase.setTransactionSuccessful();
myDatabase.endTransaction(); myDatabase.endTransaction();
@ -1059,4 +1061,8 @@ final class SQLiteBooksDatabase extends BooksDatabase {
"CREATE TABLE IF NOT EXISTS BookList ( " + "CREATE TABLE IF NOT EXISTS BookList ( " +
"book_id INTEGER UNIQUE NOT NULL REFERENCES Books (book_id))"); "book_id INTEGER UNIQUE NOT NULL REFERENCES Books (book_id))");
} }
private void updateTables9() {
myDatabase.execSQL("CREATE INDEX BookList_BookIndex ON BookList (book_id)");
}
} }

View file

@ -241,6 +241,7 @@ public final class FBReader extends ZLApplication {
for (ZLFile child : file.children()) { for (ZLFile child : file.children()) {
book = Book.getByFile(child); book = Book.getByFile(child);
if (book != null) { if (book != null) {
book.insertIntoBookList();
return book; return book;
} }
} }