Bugfix: Removal of working time fixed

This commit is contained in:
Patrick Lipka 2022-01-25 11:11:58 +01:00
parent f071bd190d
commit fb5b4eaced
2 changed files with 4 additions and 4 deletions

View File

@ -3,7 +3,7 @@
#include <string>
#define TT_VERSION 1.0.0
#define TT_VERSION 1.0.1
// global variables:
extern std::string user_name;

View File

@ -521,14 +521,14 @@ void command_rt(std::string input, int wtime, ProjectList *proj_list){
std::cout << "Task " << proj_list->active_project->name << "/" << proj_name << " does not exist." << std::endl;
return ;
}
proj_list->active_project->active_task->add_time(-wtime);
proj_list->active_project->active_task->add_time(-1*wtime);
std::cout << wtime << "s removed from task " << proj_list->active_project->name << "/" << proj_list->active_project->active_task->name << std::endl;
command_save(proj_list);
return;
}else{
int id=proj_list->active_project->find_task_id_by_name(trim(underscore_to_space(proj_name)));
if (id >= 0){
proj_list->active_project->tasks[id].add_time(-wtime);
proj_list->active_project->tasks[id].add_time(-1*wtime);
std::cout << wtime << "s removed from task " << proj_list->active_project->name << "/" << proj_list->active_project->tasks[id].name << std::endl;
command_save(proj_list);
return;
@ -545,7 +545,7 @@ void command_rt(std::string input, int wtime, ProjectList *proj_list){
}
int id=proj->find_task_id_by_name(trim(underscore_to_space(task_name)));
if(id >= 0){
proj->tasks[id].add_time(wtime);
proj->tasks[id].add_time(-1*wtime);
std::cout << wtime << "s removed from task " << proj->name << "/" << proj->tasks[id].name << std::endl;
command_save(proj_list);
}else{