commit
5a6a32bf1f
1 changed files with 8 additions and 9 deletions
|
@ -376,7 +376,10 @@ public class SearchHistoryHelper {
|
|||
SQLiteConnection db = openConnection(false);
|
||||
if (db != null) {
|
||||
try {
|
||||
removeQuery(e.getSerializedName(), db);
|
||||
db.execSQL("DELETE FROM " + HISTORY_TABLE_NAME + " WHERE " +
|
||||
HISTORY_COL_NAME + " = ? AND " +
|
||||
HISTORY_COL_LAT + " = ? AND " + HISTORY_COL_LON + " = ?",
|
||||
new Object[] {e.getSerializedName(), e.getLat(), e.getLon()});
|
||||
} finally {
|
||||
db.close();
|
||||
}
|
||||
|
@ -385,11 +388,6 @@ public class SearchHistoryHelper {
|
|||
return false;
|
||||
}
|
||||
|
||||
private void removeQuery(String name, SQLiteConnection db) {
|
||||
db.execSQL("DELETE FROM " + HISTORY_TABLE_NAME + " WHERE " + HISTORY_COL_NAME + " = ?",
|
||||
new Object[]{name});
|
||||
}
|
||||
|
||||
public boolean removeAll() {
|
||||
SQLiteConnection db = openConnection(false);
|
||||
if (db != null) {
|
||||
|
@ -411,9 +409,10 @@ public class SearchHistoryHelper {
|
|||
"UPDATE " + HISTORY_TABLE_NAME + " SET " + HISTORY_COL_TIME + "= ? " +
|
||||
", " + HISTORY_COL_FREQ_INTERVALS + " = ? " +
|
||||
", " + HISTORY_COL_FREQ_VALUES + "= ? WHERE " +
|
||||
HISTORY_COL_NAME + " = ?",
|
||||
new Object[]{e.getLastAccessTime(), e.getIntervals(), e.getIntervalsValues(),
|
||||
e.getSerializedName()});
|
||||
HISTORY_COL_NAME + " = ? AND " +
|
||||
HISTORY_COL_LAT + " = ? AND " + HISTORY_COL_LON + " = ?",
|
||||
new Object[] {e.getLastAccessTime(), e.getIntervals(), e.getIntervalsValues(),
|
||||
e.getSerializedName(), e.getLat(), e.getLon()});
|
||||
} finally {
|
||||
db.close();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue