Merge branch 'android_branch' into android_bt

This commit is contained in:
Eric House 2012-02-06 18:13:57 -08:00
commit 796baffa6d
3 changed files with 15 additions and 34 deletions

View file

@ -1105,7 +1105,7 @@ Java_org_eehouse_android_xw4_jni_XwJNI_game_1summarize
XP_UCHAR buf[128]; XP_UCHAR buf[128];
XP_U16 len = VSIZE(buf); XP_U16 len = VSIZE(buf);
if ( comms_getRelayID( comms, buf, &len ) ) { if ( comms_getRelayID( comms, buf, &len ) ) {
buf[len] = '\0'; XP_ASSERT( '\0' == buf[len] );
setString( env, jsummary, "relayID", buf ); setString( env, jsummary, "relayID", buf );
} }
setString( env, jsummary, "roomName", addr.u.ip_relay.invite ); setString( env, jsummary, "roomName", addr.u.ip_relay.invite );

View file

@ -458,17 +458,9 @@ public class DBUtils {
Cursor cursor = db.query( DBHelper.TABLE_NAME_SUM, columns, Cursor cursor = db.query( DBHelper.TABLE_NAME_SUM, columns,
selection, null, null, null, null ); selection, null, null, null, null );
if ( 0 < cursor.getCount() ) { while ( cursor.moveToNext() ) {
cursor.moveToFirst(); ids.add( cursor.getString( cursor.
for ( ; ; ) {
ids.add( cursor.
getString( cursor.
getColumnIndex(DBHelper.RELAYID)) ); getColumnIndex(DBHelper.RELAYID)) );
if ( cursor.isLast() ) {
break;
}
cursor.moveToNext();
}
} }
cursor.close(); cursor.close();
db.close(); db.close();
@ -513,17 +505,12 @@ public class DBUtils {
Cursor cursor = db.query( DBHelper.TABLE_NAME_OBITS, columns, Cursor cursor = db.query( DBHelper.TABLE_NAME_OBITS, columns,
null, null, null, null, null ); null, null, null, null, null );
if ( 0 < cursor.getCount() ) { if ( 0 < cursor.getCount() ) {
cursor.moveToFirst(); int idIndex = cursor.getColumnIndex( DBHelper.RELAYID );
for ( ; ; ) { int seedIndex = cursor.getColumnIndex( DBHelper.SEED );
int index = cursor.getColumnIndex( DBHelper.RELAYID ); while ( cursor.moveToNext() ) {
String relayID = cursor.getString( index ); String relayID = cursor.getString( idIndex );
index = cursor.getColumnIndex( DBHelper.SEED ); int seed = cursor.getInt( seedIndex );
int seed = cursor.getInt( index );
al.add( new Obit( relayID, seed ) ); al.add( new Obit( relayID, seed ) );
if ( cursor.isLast() ) {
break;
}
cursor.moveToNext();
} }
} }
cursor.close(); cursor.close();
@ -678,17 +665,9 @@ public class DBUtils {
null, null, null, null, orderBy ); null, null, null, null, orderBy );
int count = cursor.getCount(); int count = cursor.getCount();
result = new long[count]; result = new long[count];
if ( 0 < count ) {
int index = cursor.getColumnIndex( ROW_ID ); int index = cursor.getColumnIndex( ROW_ID );
cursor.moveToFirst(); for ( int ii = 0; cursor.moveToNext(); ++ii ) {
for ( int ii = 0; ; ++ii ) {
result[ii] = cursor.getLong( index ); result[ii] = cursor.getLong( index );
if ( cursor.isLast() ) {
break;
}
cursor.moveToNext();
}
} }
cursor.close(); cursor.close();
db.close(); db.close();

View file

@ -84,6 +84,7 @@ $cols = array( new Column("dead", "D", "identity", false ),
new Column("room", "Room", "identity", false ), new Column("room", "Room", "identity", false ),
new Column("lang", "Lang", "int_to_lang", false ), new Column("lang", "Lang", "int_to_lang", false ),
new Column("ntotal", "Tot", "identity", false ), new Column("ntotal", "Tot", "identity", false ),
new Column("clntVers", "CV", "identity", true ),
new Column("nperdevice", "NP", "identity", true ), new Column("nperdevice", "NP", "identity", true ),
new Column("ack", "A", "identity", true ), new Column("ack", "A", "identity", true ),
new Column("nsent", "Sent", "identity", false ), new Column("nsent", "Sent", "identity", false ),
@ -137,7 +138,8 @@ while ( $row = pg_fetch_array($result) ) {
for ( $devIndex = 0; $devIndex < $nrows; ++$devIndex ) { for ( $devIndex = 0; $devIndex < $nrows; ++$devIndex ) {
echo "<tr class=\"" . ((0 == ($count % 2)) ? "even" : "odd") . "\">"; echo "<tr class=\"" . ((0 == ($count % 2)) ? "even" : "odd") . "\">";
if ( 0 == $devIndex ) { if ( 0 == $devIndex ) {
echo "<td rowspan=$nrows>$count</td>"; $visCount = $count + 1;
echo "<td rowspan=$nrows>$visCount</td>";
} }
foreach ( $cols as $index => $col ) { foreach ( $cols as $index => $col ) {
$col->printTD( $devIndex, $nrows, $row[$index] ); $col->printTD( $devIndex, $nrows, $row[$index] );