mirror of
https://github.com/wiiu-env/launchiine.git
synced 2024-11-21 17:29:18 +01:00
Remove titles from the GuiIconGrid which were removed from the GameList
This commit is contained in:
parent
7ef3e4dc2e
commit
b4cdf11f6a
@ -75,6 +75,28 @@ uint64_t GuiIconGrid::getSelectedGame(void) {
|
||||
void GuiIconGrid::OnGameTitleListUpdated(GameList * gameList) {
|
||||
containerMutex.lock();
|
||||
gameList->lock();
|
||||
// At first delete the ones that were deleted;
|
||||
auto it = gameInfoContainers.begin();
|
||||
while (it != gameInfoContainers.end()) {
|
||||
bool wasFound = false;
|
||||
for(int32_t i = 0; i < gameList->size(); i++) {
|
||||
gameInfo * info = gameList->at(i);
|
||||
if(info != NULL && info->titleId == it->first) {
|
||||
wasFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!wasFound) {
|
||||
DEBUG_FUNCTION_LINE("Removing %016llX\n", it->first);
|
||||
remove(it->second->button);
|
||||
delete it->second;
|
||||
it = gameInfoContainers.erase(it);
|
||||
} else {
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
||||
for(int32_t i = 0; i < gameList->size(); i++) {
|
||||
gameInfo * info = gameList->at(i);
|
||||
GameInfoContainer * container = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user