From 5c8540e0e2ed15b1770299917c4505b73b7745c6 Mon Sep 17 00:00:00 2001 From: Ricky Barrette Date: Sun, 12 Feb 2012 09:49:49 -0500 Subject: [PATCH] Added delete game options to Database.deleteGame() Change-Id: Icb97cddabc44b463066dac5dd10946b5d2803063 Signed-off-by: Ricky Barrette --- .../src/com/TwentyCode/android/ExaltedDice/Database.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ExaltedDice/src/com/TwentyCode/android/ExaltedDice/Database.java b/ExaltedDice/src/com/TwentyCode/android/ExaltedDice/Database.java index 524175e..a19e041 100644 --- a/ExaltedDice/src/com/TwentyCode/android/ExaltedDice/Database.java +++ b/ExaltedDice/src/com/TwentyCode/android/ExaltedDice/Database.java @@ -67,7 +67,7 @@ public class Database { public final static String KEY_ROLL_ID = "roll_id"; public final static String KEY_MOD = "mod"; public static final String KEY_ROLLED = "rolled"; - public static final String KEY_INTENT = "intent"; + public static final String KEY_MODE = "mode"; // public static final String KEY_ = ""; // public static final String KEY_ = ""; // public static final String KEY_ = ""; @@ -335,11 +335,10 @@ public class Database { @Override public void run(){ Looper.prepare(); + String gameName = DatabaseUtils.sqlEscapeString(getGameName(id)); - /* - * get the game name from the id, and then delete all its information from the game history table - */ - Database.this.mDb.delete(GAME_HISTORY_TABLE, KEY_NAME +" = "+ DatabaseUtils.sqlEscapeString(getGameName(id)), null); + Database.this.mDb.delete(GAME_HISTORY_TABLE, KEY_NAME +" = "+ gameName, null); + Database.this.mDb.delete(GAME_OPTIONS_TABLE, KEY_NAME +" = "+ gameName, null); /* * finally delete the game from the game table