Make CheckForErrors() clear log

It'd make sense for CheckForErrors() to clear the log itself to prevent
filling up the log with the same errors over and over again.
This commit is contained in:
prisixia 2023-05-04 19:29:13 +02:00
parent 48ab92ea6f
commit a693430acb
Signed by: prisixia
GPG Key ID: CB939A148C9B4125
3 changed files with 4 additions and 3 deletions

View File

@ -173,6 +173,8 @@ void MainPanel::DoChooseDir(wxCommandEvent &WXUNUSED(event)) {
#endif // wxUSE_DIRDLG
size_t MainPanel::CheckForErrors() {
m_errorLog.clear();
size_t errorCount = 0;
if (m_author->IsEmpty()) {

View File

@ -226,6 +226,8 @@ void StagesPanel::ClearWeightStages() {
}
size_t StagesPanel::CheckForErrors() {
m_errorLog.clear();
size_t errorCount = 0;
if (m_stagesList->GetCount() == 0) {

View File

@ -288,9 +288,6 @@ void Frame::OnFileOpen(const std::string &message, const std::string &wildcard,
#endif // wxUSE_FILEDLG
bool Frame::DoCheckErrors() {
m_panel_main->ClearErrors();
m_panel_stages->ClearErrors();
const size_t errorCount_main = m_panel_main->CheckForErrors();
const size_t errorCount_stages = m_panel_stages->CheckForErrors();
bool hasError = errorCount_main > 0 || errorCount_stages > 0;