mirror of https://github.com/PatrickLipka/tt.git
Bugfix: Removal of working time fixed
This commit is contained in:
parent
f071bd190d
commit
fb5b4eaced
2
src/tt.h
2
src/tt.h
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#define TT_VERSION 1.0.0
|
#define TT_VERSION 1.0.1
|
||||||
|
|
||||||
// global variables:
|
// global variables:
|
||||||
extern std::string user_name;
|
extern std::string user_name;
|
||||||
|
|
|
@ -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;
|
std::cout << "Task " << proj_list->active_project->name << "/" << proj_name << " does not exist." << std::endl;
|
||||||
return ;
|
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;
|
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);
|
command_save(proj_list);
|
||||||
return;
|
return;
|
||||||
}else{
|
}else{
|
||||||
int id=proj_list->active_project->find_task_id_by_name(trim(underscore_to_space(proj_name)));
|
int id=proj_list->active_project->find_task_id_by_name(trim(underscore_to_space(proj_name)));
|
||||||
if (id >= 0){
|
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;
|
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);
|
command_save(proj_list);
|
||||||
return;
|
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)));
|
int id=proj->find_task_id_by_name(trim(underscore_to_space(task_name)));
|
||||||
if(id >= 0){
|
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;
|
std::cout << wtime << "s removed from task " << proj->name << "/" << proj->tasks[id].name << std::endl;
|
||||||
command_save(proj_list);
|
command_save(proj_list);
|
||||||
}else{
|
}else{
|
||||||
|
|
Loading…
Reference in New Issue