mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-09 22:00:39 +01:00
don't return from getSummary without succeeding, even if must wait on
lock. Fixes problem with blank entries in game list after returning from config screen.
This commit is contained in:
parent
60a799ef1f
commit
1ad0a899f0
3 changed files with 6 additions and 13 deletions
|
@ -77,18 +77,12 @@ public class DBUtils {
|
||||||
boolean sourceLocal;
|
boolean sourceLocal;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static GameSummary getSummary( Context context, long rowid,
|
public static GameSummary getSummary( Context context, long rowid )
|
||||||
boolean wait )
|
|
||||||
{
|
{
|
||||||
GameSummary result = null;
|
GameSummary result = null;
|
||||||
GameUtils.GameLock lock = new GameUtils.GameLock( rowid, false );
|
GameUtils.GameLock lock = new GameUtils.GameLock( rowid, false );
|
||||||
if ( wait ) {
|
result = getSummary( context, lock.lock() );
|
||||||
result = getSummary( context, lock.lock() );
|
lock.unlock();
|
||||||
lock.unlock();
|
|
||||||
} else if ( lock.tryLock() ) {
|
|
||||||
result = getSummary( context, lock );
|
|
||||||
lock.unlock();
|
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -119,7 +119,7 @@ public class GameListAdapter extends XWListAdapter {
|
||||||
// DbgUtils.logf( "doInBackground(id=%d)", m_id );
|
// DbgUtils.logf( "doInBackground(id=%d)", m_id );
|
||||||
View layout = m_factory.inflate( R.layout.game_list_item, null );
|
View layout = m_factory.inflate( R.layout.game_list_item, null );
|
||||||
boolean hideTitle = false;//CommonPrefs.getHideTitleBar(m_context);
|
boolean hideTitle = false;//CommonPrefs.getHideTitleBar(m_context);
|
||||||
GameSummary summary = DBUtils.getSummary( m_context, m_rowid, false );
|
GameSummary summary = DBUtils.getSummary( m_context, m_rowid );
|
||||||
if ( null == summary ) {
|
if ( null == summary ) {
|
||||||
m_rowid = -1;
|
m_rowid = -1;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -472,7 +472,7 @@ public class GamesList extends XWListActivity
|
||||||
// We need a way to let the user get back to the basic-config
|
// We need a way to let the user get back to the basic-config
|
||||||
// dialog in case it was dismissed. That way it to check for
|
// dialog in case it was dismissed. That way it to check for
|
||||||
// an empty room name.
|
// an empty room name.
|
||||||
GameSummary summary = DBUtils.getSummary( this, rowid, true );
|
GameSummary summary = DBUtils.getSummary( this, rowid );
|
||||||
if ( summary.conType == CommsAddrRec.CommsConnType.COMMS_CONN_RELAY
|
if ( summary.conType == CommsAddrRec.CommsConnType.COMMS_CONN_RELAY
|
||||||
&& summary.roomName.length() == 0 ) {
|
&& summary.roomName.length() == 0 ) {
|
||||||
// If it's unconfigured and of the type RelayGameActivity
|
// If it's unconfigured and of the type RelayGameActivity
|
||||||
|
@ -612,8 +612,7 @@ public class GamesList extends XWListActivity
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.list_item_copy:
|
case R.id.list_item_copy:
|
||||||
GameSummary summary = DBUtils.getSummary( this,
|
GameSummary summary = DBUtils.getSummary( this, m_rowid );
|
||||||
m_rowid, true );
|
|
||||||
if ( summary.inNetworkGame() ) {
|
if ( summary.inNetworkGame() ) {
|
||||||
showOKOnlyDialog( R.string.no_copy_network );
|
showOKOnlyDialog( R.string.no_copy_network );
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue