mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-03 23:04:08 +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 );
|
||||
String[] columns = { ROW_ID };
|
||||
String selection = String.format( "%s=%d", DBHelper.GROUPID, groupID );
|
||||
String orderBy = String.format( "%s,%s DESC,%s", DBHelper.GAME_OVER,
|
||||
DBHelper.TURN_LOCAL, DBHelper.LASTMOVE );
|
||||
// Sort unconnected games at top (turn==-1), games that are finished
|
||||
// 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 ) {
|
||||
Cursor cursor = s_db.query( DBHelper.TABLE_NAME_SUM, columns,
|
||||
selection, // selection
|
||||
|
|
Loading…
Reference in a new issue