From bc40ab63b3ee89b4e97cbace8d137f65509b3071 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Mon, 16 Nov 2009 23:24:47 -0500 Subject: [PATCH] Bug Fix - #312 Changing one task changes another - Added a warning when modifying recurring tasks, that all instances of that task may be modified. When task confirms a bulk edit the recurrence is again indicated (thanks to Cory Donnelly). --- ChangeLog | 3 +++ src/Permission.cpp | 11 +++++++++-- src/Task.cpp | 2 +- src/command.cpp | 7 +++++++ src/task.h | 2 +- 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index f5a64adb9..5458ec98c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,9 @@ annotations was edited (thanks to Joe Pulliam). + Fixed bug #314 where the edit command fails when data.location includes directories containing spaces (thanks to Cory Donnelly). + + Added a warning (issue #312) when modifying recurring tasks, that all + instances of that task may be modified. When task confirms a bulk edit + the recurrence is again indicated (thanks to Cory Donnelly). ------ old releases ------------------------------ diff --git a/src/Permission.cpp b/src/Permission.cpp index 6058cbd03..d70c22b1d 100644 --- a/src/Permission.cpp +++ b/src/Permission.cpp @@ -57,8 +57,15 @@ bool Permission::confirmed (const Task& task, const std::string& question) << task.id << " \"" << task.get ("description") - << "\"" - << std::endl; + << "\""; + + if (task.getStatus () == Task::recurring || + task.has ("parent")) + { + std::cout << " (Recurring)"; + } + + std::cout << std::endl; int answer = confirm3 (question); if (answer == 2) diff --git a/src/Task.cpp b/src/Task.cpp index 2d184cfde..c8c9d6e07 100644 --- a/src/Task.cpp +++ b/src/Task.cpp @@ -134,7 +134,7 @@ void Task::setEntry () } //////////////////////////////////////////////////////////////////////////////// -Task::status Task::getStatus () +Task::status Task::getStatus () const { return textToStatus (get ("status")); // No i18n } diff --git a/src/command.cpp b/src/command.cpp index fd893f79e..490a7bac2 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -958,6 +958,13 @@ int handleModify (std::string &outs) task->get ("parent") == other->get ("parent")) || // Sibling other->get ("uuid") == task->get ("parent")) // Parent { + if (task->has ("parent")) + std::cout << "Task " + << task->id + << " is a recurring task, and all other instances of this" + << " task may be modified." + << std::endl; + Task before (*other); // A non-zero value forces a file write. diff --git a/src/task.h b/src/task.h index 6e51f3e4b..d9162422c 100644 --- a/src/task.h +++ b/src/task.h @@ -57,7 +57,7 @@ public: void setEntry (); - status getStatus (); + status getStatus () const; void setStatus (status); int getTagCount ();