From ab931b6af24d106d2be3cbdd02cae3d8f5f45504 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 27 Aug 2011 14:29:08 -0400 Subject: [PATCH] Legacy - Added legacy warnings about use of fg: or bg:. --- src/commands/Command.cpp | 4 ++++ src/en-US.h | 4 +++- src/util.cpp | 3 --- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/commands/Command.cpp b/src/commands/Command.cpp index e0704f4d5..3f27e20d7 100644 --- a/src/commands/Command.cpp +++ b/src/commands/Command.cpp @@ -469,6 +469,10 @@ void Command::modify_task ( // By default, just add it. else task.set (name, result); + + // Legacy checks. + if (name == "fg" || name == "bg") + context.footnote (format (STRING_LEGACY_FEATURE, name)); } else throw format (STRING_CMD_ADD_BAD_ATTRIBUTE, name); diff --git a/src/en-US.h b/src/en-US.h index 80e84863c..75620ed8f 100644 --- a/src/en-US.h +++ b/src/en-US.h @@ -372,6 +372,9 @@ #define STRING_JSON_MISSING_OPEN "Error: expected '{' or '[' at position {1}" #define STRING_JSON_EXTRA_CHARACTERS "Error: extra characters found at position {1}" +// Legacy +#define STRING_LEGACY_FEATURE "Note: the '{1}' feature is deprecated." + // Lua #define STRING_LUA_BAD_HOOK_DEF "Malformed hook definition '{1}'." #define STRING_LUA_BAD_EVENT "Unrecognized hook event '{1}'." @@ -428,7 +431,6 @@ #define STRING_TASK_VALID_WAIT_RECUR "You cannot create a task that is both waiting and recurring." #define STRING_TASK_VALID_PRIORITY "Priority values may be 'H', 'M' or 'L', not '{1}'." - // Taskmod #define STRING_TASKMOD_BAD_INIT "Taskmod::getUuid(): Task object not initialized." #define STRING_TASKMOD_TIME "time " diff --git a/src/util.cpp b/src/util.cpp index 97019a17a..2072fc109 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -497,11 +497,9 @@ const std::string encode (const std::string& value) { std::string modified = value; - str_replace (modified, "\t", "&tab;"); str_replace (modified, "\"", "&dquot;"); str_replace (modified, "[", "&open;"); str_replace (modified, "]", "&close;"); - str_replace (modified, "\\", "\\\\"); return modified; } @@ -520,7 +518,6 @@ const std::string decode (const std::string& value) std::string modified = value; // Supported encodings. - str_replace (modified, "&tab;", "\t"); str_replace (modified, "&dquot;", "\""); str_replace (modified, """, "'"); str_replace (modified, "&open;", "[");