mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-13 20:48:02 +01:00
don't write DB column that's never read, nor pass the value that was
being written.
This commit is contained in:
parent
bb2ebe8128
commit
a1f590642a
3 changed files with 8 additions and 25 deletions
|
@ -70,7 +70,8 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||||
public static final String CONTYPE = "CONTYPE";
|
public static final String CONTYPE = "CONTYPE";
|
||||||
public static final String SERVERROLE = "SERVERROLE";
|
public static final String SERVERROLE = "SERVERROLE";
|
||||||
public static final String ROOMNAME = "ROOMNAME";
|
public static final String ROOMNAME = "ROOMNAME";
|
||||||
public static final String INVITEID = "INVITEID";
|
// written but never read; can go away
|
||||||
|
// public static final String INVITEID = "INVITEID";
|
||||||
public static final String RELAYID = "RELAYID";
|
public static final String RELAYID = "RELAYID";
|
||||||
public static final String SEED = "SEED";
|
public static final String SEED = "SEED";
|
||||||
public static final String SMSPHONE = "SMSPHONE"; // unused -- so far
|
public static final String SMSPHONE = "SMSPHONE"; // unused -- so far
|
||||||
|
@ -126,7 +127,6 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||||
,{ SERVERROLE, "INTEGER" }
|
,{ SERVERROLE, "INTEGER" }
|
||||||
,{ CONTYPE, "INTEGER" }
|
,{ CONTYPE, "INTEGER" }
|
||||||
,{ ROOMNAME, "TEXT" }
|
,{ ROOMNAME, "TEXT" }
|
||||||
,{ INVITEID, "TEXT" }
|
|
||||||
,{ RELAYID, "TEXT" }
|
,{ RELAYID, "TEXT" }
|
||||||
,{ SEED, "INTEGER" }
|
,{ SEED, "INTEGER" }
|
||||||
,{ DICTLANG, "INTEGER" }
|
,{ DICTLANG, "INTEGER" }
|
||||||
|
@ -254,7 +254,6 @@ public class DBHelper extends SQLiteOpenHelper {
|
||||||
case 9:
|
case 9:
|
||||||
addSumColumn( db, DICTLIST );
|
addSumColumn( db, DICTLIST );
|
||||||
case 10:
|
case 10:
|
||||||
addSumColumn( db, INVITEID );
|
|
||||||
case 11:
|
case 11:
|
||||||
addSumColumn( db, REMOTEDEVS );
|
addSumColumn( db, REMOTEDEVS );
|
||||||
case 12:
|
case 12:
|
||||||
|
|
|
@ -271,12 +271,6 @@ public class DBUtils {
|
||||||
|
|
||||||
public static void saveSummary( Context context, GameLock lock,
|
public static void saveSummary( Context context, GameLock lock,
|
||||||
GameSummary summary )
|
GameSummary summary )
|
||||||
{
|
|
||||||
saveSummary( context, lock, summary, null );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void saveSummary( Context context, GameLock lock,
|
|
||||||
GameSummary summary, String inviteID )
|
|
||||||
{
|
{
|
||||||
boolean needsTimer = false;
|
boolean needsTimer = false;
|
||||||
Assert.assertTrue( lock.canWrite() );
|
Assert.assertTrue( lock.canWrite() );
|
||||||
|
@ -305,9 +299,6 @@ public class DBUtils {
|
||||||
values.put( DBHelper.NEXTNAG, nextNag );
|
values.put( DBHelper.NEXTNAG, nextNag );
|
||||||
|
|
||||||
values.put( DBHelper.DICTLIST, summary.dictNames(DICTS_SEP) );
|
values.put( DBHelper.DICTLIST, summary.dictNames(DICTS_SEP) );
|
||||||
if ( null != inviteID ) {
|
|
||||||
values.put( DBHelper.INVITEID, inviteID );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( null != summary.scores ) {
|
if ( null != summary.scores ) {
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
|
|
|
@ -543,7 +543,7 @@ public class GameUtils {
|
||||||
|
|
||||||
if ( DBUtils.ROWID_NOTFOUND != rowid ) {
|
if ( DBUtils.ROWID_NOTFOUND != rowid ) {
|
||||||
GameLock lock = new GameLock( rowid, true ).lock();
|
GameLock lock = new GameLock( rowid, true ).lock();
|
||||||
applyChanges( context, sink, gi, util, addr, inviteID, lock, false );
|
applyChanges( context, sink, gi, util, addr, lock, false );
|
||||||
lock.unlock();
|
lock.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -988,22 +988,15 @@ public class GameUtils {
|
||||||
public static void applyChanges( Context context, CurGameInfo gi,
|
public static void applyChanges( Context context, CurGameInfo gi,
|
||||||
CommsAddrRec car, GameLock lock,
|
CommsAddrRec car, GameLock lock,
|
||||||
boolean forceNew )
|
boolean forceNew )
|
||||||
{
|
|
||||||
applyChanges( context, gi, car, null, lock, forceNew );
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void applyChanges( Context context, CurGameInfo gi,
|
|
||||||
CommsAddrRec car, String inviteID,
|
|
||||||
GameLock lock, boolean forceNew )
|
|
||||||
{
|
{
|
||||||
applyChanges( context, (MultiMsgSink)null, gi, (UtilCtxt)null, car,
|
applyChanges( context, (MultiMsgSink)null, gi, (UtilCtxt)null, car,
|
||||||
inviteID, lock, forceNew );
|
lock, forceNew );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void applyChanges( Context context, MultiMsgSink sink,
|
public static void applyChanges( Context context, MultiMsgSink sink,
|
||||||
CurGameInfo gi, UtilCtxt util,
|
CurGameInfo gi, UtilCtxt util,
|
||||||
CommsAddrRec car, String inviteID,
|
CommsAddrRec car, GameLock lock,
|
||||||
GameLock lock, boolean forceNew )
|
boolean forceNew )
|
||||||
{
|
{
|
||||||
// This should be a separate function, commitChanges() or
|
// This should be a separate function, commitChanges() or
|
||||||
// somesuch. But: do we have a way to save changes to a gi
|
// somesuch. But: do we have a way to save changes to a gi
|
||||||
|
@ -1049,7 +1042,7 @@ public class GameUtils {
|
||||||
|
|
||||||
GameSummary summary = new GameSummary( context, gi );
|
GameSummary summary = new GameSummary( context, gi );
|
||||||
XwJNI.game_summarize( gamePtr, summary );
|
XwJNI.game_summarize( gamePtr, summary );
|
||||||
DBUtils.saveSummary( context, lock, summary, inviteID );
|
DBUtils.saveSummary( context, lock, summary );
|
||||||
|
|
||||||
XwJNI.game_dispose( gamePtr );
|
XwJNI.game_dispose( gamePtr );
|
||||||
} // applyChanges
|
} // applyChanges
|
||||||
|
|
Loading…
Add table
Reference in a new issue