mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-07 05:24:46 +01:00
sort unconnected games to top of list
This commit is contained in:
parent
79b0d38c0c
commit
a6d8708abc
1 changed files with 6 additions and 2 deletions
|
@ -1622,8 +1622,12 @@ public class DBUtils {
|
||||||
initDB( context );
|
initDB( context );
|
||||||
String[] columns = { ROW_ID };
|
String[] columns = { ROW_ID };
|
||||||
String selection = String.format( "%s=%d", DBHelper.GROUPID, groupID );
|
String selection = String.format( "%s=%d", DBHelper.GROUPID, groupID );
|
||||||
String orderBy = String.format( "%s,%s DESC,%s", DBHelper.GAME_OVER,
|
// Sort unconnected games at top (turn==-1), games that are finished
|
||||||
DBHelper.TURN_LOCAL, DBHelper.LASTMOVE );
|
// at the bottom, then games at the top by how long it's been the
|
||||||
|
// device owner's turn.
|
||||||
|
String orderBy = String.format( "%s is -1 DESC,%s,%s DESC,%s", DBHelper.TURN,
|
||||||
|
DBHelper.GAME_OVER, DBHelper.TURN_LOCAL,
|
||||||
|
DBHelper.LASTMOVE );
|
||||||
synchronized( s_dbHelper ) {
|
synchronized( s_dbHelper ) {
|
||||||
Cursor cursor = s_db.query( DBHelper.TABLE_NAME_SUM, columns,
|
Cursor cursor = s_db.query( DBHelper.TABLE_NAME_SUM, columns,
|
||||||
selection, // selection
|
selection, // selection
|
||||||
|
|
Loading…
Reference in a new issue