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 { @@ -76,11 +76,8 @@ public class HistoryDatabaseHandler extends SQLiteOpenHelper {
* All CRUD(Create, Read, Update, Delete) Operations
*/
public synchronized void delete(String url) {
String n = getHistoryItem(url);
if (n != null) {
deleteHistoryItem(n);
}
public synchronized void deleteHistoryItem(String url) {
mDatabase.delete(TABLE_HISTORY, KEY_URL + " = ?", new String[] { url });
}
public synchronized void visitHistoryItem(String url, String title) {
@ -193,11 +190,6 @@ public class HistoryDatabaseHandler extends SQLiteOpenHelper { @@ -193,11 +190,6 @@ public class HistoryDatabaseHandler extends SQLiteOpenHelper {
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
public int getHistoryItemsCount() {
String countQuery = "SELECT * FROM " + TABLE_HISTORY;

Loading…
Cancel
Save