trivial refactor

This commit is contained in:
Eric House 2015-10-29 07:02:18 -07:00
parent 77315b50ba
commit 2f579832b4

View file

@ -717,7 +717,7 @@ public class GamesListDelegate extends ListDelegateBase
String name = m_namer.getName(); String name = m_namer.getName();
DBUtils.setGroupName( m_activity, DBUtils.setGroupName( m_activity,
m_groupid, name ); m_groupid, name );
m_adapter.reloadGame( m_rowid ); reloadGame( m_rowid );
mkListAdapter(); mkListAdapter();
} }
}; };
@ -965,7 +965,7 @@ public class GamesListDelegate extends ListDelegateBase
m_launchedGames.clear(); m_launchedGames.clear();
Assert.assertNotNull( intent ); Assert.assertNotNull( intent );
invalRelayIDs( intent.getStringArrayExtra( RELAYIDS_EXTRA ) ); invalRelayIDs( intent.getStringArrayExtra( RELAYIDS_EXTRA ) );
m_adapter.reloadGame( intent.getLongExtra( ROWID_EXTRA, -1 ) ); reloadGame( intent.getLongExtra( ROWID_EXTRA, -1 ) );
tryStartsFromIntent( intent ); tryStartsFromIntent( intent );
} }
@ -1081,7 +1081,7 @@ public class GamesListDelegate extends ListDelegateBase
if ( DBUtils.ROWIDS_ALL == rowid ) { // all changed if ( DBUtils.ROWIDS_ALL == rowid ) { // all changed
mkListAdapter(); mkListAdapter();
} else { } else {
m_adapter.reloadGame( rowid ); reloadGame( rowid );
} }
break; break;
case GAME_CREATED: case GAME_CREATED:
@ -1210,9 +1210,7 @@ public class GamesListDelegate extends ListDelegateBase
long curID = (Long)params[0]; long curID = (Long)params[0];
long newid = GameUtils.dupeGame( m_activity, curID ); long newid = GameUtils.dupeGame( m_activity, curID );
m_selGames.add( newid ); m_selGames.add( newid );
if ( null != m_adapter ) { reloadGame( newid );
m_adapter.reloadGame( newid );
}
break; break;
case NEW_GAME_PRESSED: case NEW_GAME_PRESSED:
@ -1619,6 +1617,13 @@ public class GamesListDelegate extends ListDelegateBase
} }
} }
private void reloadGame( long rowID )
{
if ( null != m_adapter ) {
m_adapter.reloadGame( rowID );
}
}
private boolean handleToggleItem( int itemID, View target ) private boolean handleToggleItem( int itemID, View target )
{ {
boolean handled; boolean handled;
@ -1898,7 +1903,7 @@ public class GamesListDelegate extends ListDelegateBase
long[] rowids = DBUtils.getRowIDsFor( m_activity, relayID ); long[] rowids = DBUtils.getRowIDsFor( m_activity, relayID );
if ( null != rowids ) { if ( null != rowids ) {
for ( long rowid : rowids ) { for ( long rowid : rowids ) {
m_adapter.reloadGame( rowid ); reloadGame( rowid );
} }
} }
} }