From 26c0820350b73d30f736e2422e1db1826c2c16ef Mon Sep 17 00:00:00 2001 From: Patrick Lipka Date: Mon, 2 May 2022 12:58:50 +0200 Subject: [PATCH] Bugfix: keeping old month's date when setting up new project list from last one --- src/project.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/project.cpp b/src/project.cpp index 11edbd9..09aacf7 100644 --- a/src/project.cpp +++ b/src/project.cpp @@ -151,9 +151,13 @@ void ProjectList::load(std::string file_name, bool ignore_worktimes){ inf.read((char*) &month_len,sizeof(size_t)); char *month_tmp = new char[month_len+1]; inf.read(month_tmp,month_len); - month_tmp[month_len] = '\0'; - month = month_tmp; - delete [] month_tmp; + if(!ignore_worktimes){ + month_tmp[month_len] = '\0'; + month = month_tmp; + delete [] month_tmp; + }else{ + month=get_date(); + } } inf.read((char*) &num_projects,sizeof(int));