diff --git a/AUTHORS b/AUTHORS index f21c41f72..1776ef143 100644 --- a/AUTHORS +++ b/AUTHORS @@ -18,6 +18,7 @@ The following submitted code, packages or analysis, and deserve special thanks: Johan Friis Steven de Brouwer Pietro Cerutti + Cory Donnelly Thanks to the following, who submitted detailed bug reports and excellent suggestions: Eugene Kramer @@ -40,4 +41,4 @@ Thanks to the following, who submitted detailed bug reports and excellent sugges Ian Mortimer Zach Frazier Ivo Jimenez - + Joe Pulliam diff --git a/ChangeLog b/ChangeLog index 00526bcb2..9a07849c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,17 @@ ------ old releases ------------------------------ +1.8.4 (11/17/2009) 12c4983936d27317df100f05da8244139dd06a3f + + Fixed bug that caused wait: dates to not be properly rendered in a + readable and preferred format with the "edit" command. + + Fixed bug that caused a hang on cygwin, when a task with multiple + 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). + 1.8.3 (10/21/2009) bcdcbeeea0d92f21c3565aebfaf6332b959f4025 + Added support for Haiku R1/alpha1 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 68bf75766..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 } @@ -441,10 +441,14 @@ void Task::addAnnotation (const std::string& description) void Task::removeAnnotations () { // Erase old annotations. - Record::iterator i; - for (i = this->begin (); i != this->end (); ++i) + Record::iterator i = this->begin (); + while (i != this->end ()) + { if (i->first.substr (0, 11) == "annotation_") // No i18n - this->erase (i); + this->erase (i++); + else + i++; + } } //////////////////////////////////////////////////////////////////////////////// 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 (); diff --git a/src/command.cpp b/src/command.cpp index eba05784a..fe90eded2 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -987,6 +987,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/edit.cpp b/src/edit.cpp index c7e1e94fd..f8219e46d 100644 --- a/src/edit.cpp +++ b/src/edit.cpp @@ -150,7 +150,7 @@ static std::string formatTask (Task task) << " Due: " << formatDate (task, "due") << std::endl << " Until: " << formatDate (task, "until") << std::endl << " Recur: " << task.get ("recur") << std::endl - << " Wait until: " << task.get ("wait") << std::endl + << " Wait until: " << formatDate (task, "wait") << std::endl << " Parent: " << task.get ("parent") << std::endl << " Foreground color: " << task.get ("fg") << std::endl << " Background color: " << task.get ("bg") << std::endl @@ -543,7 +543,7 @@ void editFile (Task& task) // Complete the command line. editor += " "; - editor += file.str (); + editor += "\"" + file.str () + "\""; ARE_THESE_REALLY_HARMFUL: // Launch the editor. diff --git a/src/task.h b/src/task.h deleted file mode 100644 index 6e51f3e4b..000000000 --- a/src/task.h +++ /dev/null @@ -1,83 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// task - a command line task list manager. -// -// Copyright 2006 - 2009, Paul Beckingham. -// All rights reserved. -// -// This program is free software; you can redistribute it and/or modify it under -// the terms of the GNU General Public License as published by the Free Software -// Foundation; either version 2 of the License, or (at your option) any later -// version. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -// FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -// details. -// -// You should have received a copy of the GNU General Public License along with -// this program; if not, write to the -// -// Free Software Foundation, Inc., -// 51 Franklin Street, Fifth Floor, -// Boston, MA -// 02110-1301 -// USA -// -//////////////////////////////////////////////////////////////////////////////// -#ifndef INCLUDED_TASK -#define INCLUDED_TASK - -#include -#include "Record.h" -#include "Subst.h" -#include "Sequence.h" - -class Task : public Record -{ -public: - Task (); // Default constructor - Task (const Task&); // Copy constructor - Task& operator= (const Task&); // Assignment operator - bool operator== (const Task&); // Comparison operator - Task (const std::string&); // Parse - ~Task (); // Destructor - - void parse (const std::string&); - std::string composeCSV () const; - - // Status values. - enum status {pending, completed, deleted, recurring, waiting}; - - // Public data. - int id; - - // Series of helper functions. - static status textToStatus (const std::string&); - static std::string statusToText (status); - - void setEntry (); - - status getStatus (); - void setStatus (status); - - int getTagCount (); - bool hasTag (const std::string&); - void addTag (const std::string&); - void addTags (const std::vector &); - void getTags (std::vector&) const; - void removeTag (const std::string&); - - void getAnnotations (std::vector &) const; - void setAnnotations (const std::vector &); - void addAnnotation (const std::string&); - void removeAnnotations (); - - void validate () const; - -private: - int determineVersion (const std::string&); - void legacyParse (const std::string&); -}; - -#endif -////////////////////////////////////////////////////////////////////////////////