Debug database

This commit is contained in:
Loic Guegan 2022-02-28 21:56:44 +01:00
parent bd71371bed
commit 2a167cd107
2 changed files with 8 additions and 4 deletions

View file

@ -186,7 +186,7 @@ void MainWindow::NewGame(bool useFen) {
}
}
} else {
NewGame(new Game());
NewGame(std::shared_ptr<Game>(new Game()));
}
}

View file

@ -29,13 +29,16 @@ void BaseTab::OnImport(wxCommandEvent &event) {
dia->ShowModal();
game_list->DeleteAllItems();
deleted.clear();
edited.clear();
LoadFile();
}
void BaseTab::OnDelete(wxCommandEvent &event) {
long selected =
game_list->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
if (selected >= 0) {
long selected = -1;
while ((selected = game_list->GetNextItem(selected, wxLIST_NEXT_ALL,
wxLIST_STATE_SELECTED)) !=
wxNOT_FOUND) {
wxListItem listItem;
listItem.m_itemId = selected; // sets row
listItem.m_col = 0; // sets column
@ -56,6 +59,7 @@ void BaseTab::OnSave(wxCommandEvent &event) {
edited.end()); // Add edited game (since they are also deleted)
base->Save(deleted, new_games_bases, new_games);
game_list->DeleteAllItems();
edited.clear();
deleted.clear();
LoadFile();
}