mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-04 10:19:33 +02:00
naming/access rights cleanup
This commit is contained in:
parent
fb557d2de0
commit
d8bb1ad585
7 changed files with 11 additions and 11 deletions
|
@ -51,7 +51,7 @@ public final class SQLiteBooksDatabase extends BooksDatabase {
|
|||
migrate(context);
|
||||
}
|
||||
|
||||
public /*protected*/ void executeAsATransaction(Runnable actions) {
|
||||
protected void executeAsTransaction(Runnable actions) {
|
||||
boolean transactionStarted = false;
|
||||
try {
|
||||
myDatabase.beginTransaction();
|
||||
|
@ -681,7 +681,7 @@ public final class SQLiteBooksDatabase extends BooksDatabase {
|
|||
"INSERT OR IGNORE INTO RecentBooks (book_id) VALUES (?)"
|
||||
);
|
||||
}
|
||||
executeAsATransaction(new Runnable() {
|
||||
executeAsTransaction(new Runnable() {
|
||||
public void run() {
|
||||
myDatabase.delete("RecentBooks", null, null);
|
||||
for (long id : ids) {
|
||||
|
|
|
@ -73,7 +73,7 @@ class SQLiteNetworkDatabase extends NetworkDatabase {
|
|||
myDatabase.setVersion(currentCodeVersion);
|
||||
}
|
||||
|
||||
protected void executeAsATransaction(Runnable actions) {
|
||||
protected void executeAsTransaction(Runnable actions) {
|
||||
myDatabase.beginTransaction();
|
||||
try {
|
||||
actions.run();
|
||||
|
@ -131,7 +131,7 @@ class SQLiteNetworkDatabase extends NetworkDatabase {
|
|||
private SQLiteStatement myUpdateCustomLinkUrlStatement;
|
||||
@Override
|
||||
protected synchronized void saveLink(final INetworkLink link) {
|
||||
executeAsATransaction(new Runnable() {
|
||||
executeAsTransaction(new Runnable() {
|
||||
public void run() {
|
||||
final SQLiteStatement statement;
|
||||
if (link.getId() == INetworkLink.INVALID_ID) {
|
||||
|
@ -232,7 +232,7 @@ class SQLiteNetworkDatabase extends NetworkDatabase {
|
|||
if (link.getId() == INetworkLink.INVALID_ID) {
|
||||
return;
|
||||
}
|
||||
executeAsATransaction(new Runnable() {
|
||||
executeAsTransaction(new Runnable() {
|
||||
public void run() {
|
||||
final String stringLinkId = String.valueOf(link.getId());
|
||||
myDatabase.delete("Links", "link_id = ?", new String[] { stringLinkId });
|
||||
|
@ -258,7 +258,7 @@ class SQLiteNetworkDatabase extends NetworkDatabase {
|
|||
|
||||
@Override
|
||||
protected synchronized void setLinkExtras(final INetworkLink link, final Map<String,String> extras) {
|
||||
executeAsATransaction(new Runnable() {
|
||||
executeAsTransaction(new Runnable() {
|
||||
public void run() {
|
||||
if (link.getId() == INetworkLink.INVALID_ID) {
|
||||
return;
|
||||
|
|
|
@ -426,7 +426,7 @@ public class Book {
|
|||
return false;
|
||||
}
|
||||
|
||||
database.executeAsATransaction(new Runnable() {
|
||||
database.executeAsTransaction(new Runnable() {
|
||||
public void run() {
|
||||
if (myId >= 0) {
|
||||
final FileInfoSet fileInfos = new FileInfoSet(database, File);
|
||||
|
|
|
@ -593,7 +593,7 @@ public class BookCollection extends AbstractBookCollection {
|
|||
// Step 4: save changes into database
|
||||
fileInfos.save();
|
||||
|
||||
myDatabase.executeAsATransaction(new Runnable() {
|
||||
myDatabase.executeAsTransaction(new Runnable() {
|
||||
public void run() {
|
||||
for (Book book : newBooks) {
|
||||
saveBook(book, false);
|
||||
|
|
|
@ -53,7 +53,7 @@ public abstract class BooksDatabase {
|
|||
book.setSeriesInfoWithNoCheck(series, index);
|
||||
}
|
||||
|
||||
public /*protected*/ abstract void executeAsATransaction(Runnable actions);
|
||||
protected abstract void executeAsTransaction(Runnable actions);
|
||||
|
||||
// returns map fileId -> book
|
||||
protected abstract Map<Long,Book> loadBooks(FileInfoSet infos, boolean existing);
|
||||
|
|
|
@ -85,7 +85,7 @@ public final class FileInfoSet {
|
|||
}
|
||||
|
||||
public void save() {
|
||||
myDatabase.executeAsATransaction(new Runnable() {
|
||||
myDatabase.executeAsTransaction(new Runnable() {
|
||||
public void run() {
|
||||
for (FileInfo info : myInfosToRemove) {
|
||||
myDatabase.removeFileInfo(info.Id);
|
||||
|
|
|
@ -37,7 +37,7 @@ public abstract class NetworkDatabase {
|
|||
ourInstance = this;
|
||||
}
|
||||
|
||||
protected abstract void executeAsATransaction(Runnable actions);
|
||||
protected abstract void executeAsTransaction(Runnable actions);
|
||||
|
||||
protected INetworkLink createLink(int id, INetworkLink.Type type, String predefinedId, String siteName, String title, String summary, String language, UrlInfoCollection<UrlInfoWithDate> infos) {
|
||||
if (siteName == null || title == null || infos.getInfo(UrlInfo.Type.Catalog) == null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue