mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-12 08:47:50 +01:00
fix broken deleteGroup()
This commit is contained in:
parent
2491051f65
commit
538fa20ffd
1 changed files with 4 additions and 5 deletions
|
@ -246,7 +246,6 @@ public class DBUtils {
|
||||||
|
|
||||||
if ( null == summary && lock.canWrite() ) {
|
if ( null == summary && lock.canWrite() ) {
|
||||||
summary = GameUtils.summarize( context, lock );
|
summary = GameUtils.summarize( context, lock );
|
||||||
saveSummary( context, lock, summary );
|
|
||||||
}
|
}
|
||||||
return summary;
|
return summary;
|
||||||
} // getSummary
|
} // getSummary
|
||||||
|
@ -1205,17 +1204,17 @@ public class DBUtils {
|
||||||
public static void deleteGroup( Context context, long groupid )
|
public static void deleteGroup( Context context, long groupid )
|
||||||
{
|
{
|
||||||
// Nuke games having this group id
|
// Nuke games having this group id
|
||||||
String selection =
|
String selectionGames =
|
||||||
String.format( "%s=%d", DBHelper.GROUPID, groupid );
|
String.format( "%s=%d", DBHelper.GROUPID, groupid );
|
||||||
|
|
||||||
// And nuke the group record itself
|
// And nuke the group record itself
|
||||||
selection = String.format( ROW_ID_FMT, groupid );
|
String selectionGroups = String.format( ROW_ID_FMT, groupid );
|
||||||
|
|
||||||
initDB( context );
|
initDB( context );
|
||||||
synchronized( s_dbHelper ) {
|
synchronized( s_dbHelper ) {
|
||||||
SQLiteDatabase db = s_dbHelper.getWritableDatabase();
|
SQLiteDatabase db = s_dbHelper.getWritableDatabase();
|
||||||
db.delete( DBHelper.TABLE_NAME_SUM, selection, null );
|
db.delete( DBHelper.TABLE_NAME_SUM, selectionGames, null );
|
||||||
db.delete( DBHelper.TABLE_NAME_GROUPS, selection, null );
|
db.delete( DBHelper.TABLE_NAME_GROUPS, selectionGroups, null );
|
||||||
|
|
||||||
db.close();
|
db.close();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue