Bugfix: keeping old month's date when setting up new project list from last one

This commit is contained in:
Patrick Lipka 2022-05-02 12:58:50 +02:00
parent 3436069b7c
commit 26c0820350
1 changed files with 7 additions and 3 deletions

View File

@ -151,9 +151,13 @@ void ProjectList::load(std::string file_name, bool ignore_worktimes){
inf.read((char*) &month_len,sizeof(size_t)); inf.read((char*) &month_len,sizeof(size_t));
char *month_tmp = new char[month_len+1]; char *month_tmp = new char[month_len+1];
inf.read(month_tmp,month_len); inf.read(month_tmp,month_len);
month_tmp[month_len] = '\0'; if(!ignore_worktimes){
month = month_tmp; month_tmp[month_len] = '\0';
delete [] month_tmp; month = month_tmp;
delete [] month_tmp;
}else{
month=get_date();
}
} }
inf.read((char*) &num_projects,sizeof(int)); inf.read((char*) &num_projects,sizeof(int));