add groups info cache inval so when empty group gets a new game it

grows an expand button
This commit is contained in:
Eric House 2014-07-11 07:31:50 -07:00
parent 8dd1771a37
commit 25d4b0a375
2 changed files with 7 additions and 5 deletions

View file

@ -814,7 +814,7 @@ public class DBUtils {
lock = new GameLock( rowid, true ).lock();
notifyListeners( rowid, GameChangeType.GAME_CREATED );
}
invalGroupsCache();
return lock;
} // saveNewGame
@ -893,8 +893,8 @@ public class DBUtils {
db.delete( DBHelper.TABLE_NAME_SUM, selection, null );
db.close();
}
invalGroupsCache();
notifyListeners( lock.getRowid(), GameChangeType.GAME_DELETED );
invalGroupsCache();
}
public static int getVisID( Context context, long rowid )

View file

@ -114,7 +114,9 @@ public class GamesListDelegate extends ListDelegateBase
alist.add( new GroupRec( groupID, ii ) );
if ( ggi.m_expanded ) {
alist.addAll( makeChildren( groupID ) );
List<Object> children = makeChildren( groupID );
alist.addAll( children );
Assert.assertTrue( nKids == children.size() );
}
}
@ -342,7 +344,7 @@ public class GamesListDelegate extends ListDelegateBase
for ( long row : rows ) {
alist.add( new GameRec( row ) );
}
DbgUtils.logf( "makeChildren(%d) => %d kids", groupID, alist.size() );
DbgUtils.logf( "GamesListDelegate.makeChildren(%d) => %d kids", groupID, alist.size() );
return alist;
}
@ -864,7 +866,7 @@ public class GamesListDelegate extends ListDelegateBase
//////////////////////////////////////////////////////////////////////
public void gameSaved( final long rowid, final GameChangeType change )
{
runOnUiThread( new Runnable() {
post( new Runnable() {
public void run() {
switch( change ) {
case GAME_DELETED: