Improve import

This commit is contained in:
Loic Guegan 2022-12-26 16:57:14 +01:00
parent 8a9b920a5e
commit aae19085bb
4 changed files with 21 additions and 4 deletions

View file

@ -34,10 +34,13 @@ void GameListManager::DisplayRow(long id){
BG_OPEN(index);
if(std::find(deleted_games.begin(), deleted_games.end(), row.id) != deleted_games.end())
BG_DELETE(index);
if(std::find(imported_games.begin(), imported_games.end(), row.id) != imported_games.end())
BG_IMPORT(index);
}
void GameListManager::Clear(){
game_list->DeleteAllItems();
imported_games.clear();
deleted_games.clear();
opened_games.clear();
rows.clear();
@ -58,6 +61,11 @@ void GameListManager::MarkItemAsDeleted(long item){
BG_DELETE(item);
}
void GameListManager::MarkItemAsImported(long item){
imported_games.push_back(rows[item].id);
BG_IMPORT(item);
}
void GameListManager::SortBy(short col){
ClearDisplayedRow();
switch(col){