Browse Source

Make history deletion more efficient

master
Anthony Restaino 10 years ago
parent
commit
e92ad4303b
  1. 12
      src/acr/browser/lightning/HistoryDatabaseHandler.java

12
src/acr/browser/lightning/HistoryDatabaseHandler.java

@ -76,11 +76,8 @@ public class HistoryDatabaseHandler extends SQLiteOpenHelper {
* All CRUD(Create, Read, Update, Delete) Operations * All CRUD(Create, Read, Update, Delete) Operations
*/ */
public synchronized void delete(String url) { public synchronized void deleteHistoryItem(String url) {
String n = getHistoryItem(url); mDatabase.delete(TABLE_HISTORY, KEY_URL + " = ?", new String[] { url });
if (n != null) {
deleteHistoryItem(n);
}
} }
public synchronized void visitHistoryItem(String url, String title) { public synchronized void visitHistoryItem(String url, String title) {
@ -193,11 +190,6 @@ public class HistoryDatabaseHandler extends SQLiteOpenHelper {
return n; return n;
} }
// Deleting single item
public synchronized void deleteHistoryItem(String id) {
mDatabase.delete(TABLE_HISTORY, KEY_ID + " = ?", new String[] { String.valueOf(id) });
}
// Getting items Count // Getting items Count
public int getHistoryItemsCount() { public int getHistoryItemsCount() {
String countQuery = "SELECT * FROM " + TABLE_HISTORY; String countQuery = "SELECT * FROM " + TABLE_HISTORY;

Loading…
Cancel
Save