From d89d51e7e19032bf3213b412367612a86328d2e3 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Wed, 25 Jul 2012 22:44:25 -0400 Subject: [PATCH] Deprecation - Removed deprecated 'fg:' and 'bg:' attributes, which involves code, documentation and tests. - Cleaned out NEWS file. - Cleaned out config import synonyms, which should have been deleted a while ago. - Removed unused localized strings, but left the 'deprecated' one behind, because it will be needed. --- ChangeLog | 1 + NEWS | 29 ++++-------- doc/man/task.1.in | 8 ---- src/Config.cpp | 16 ------- src/columns/CMakeLists.txt | 2 - src/columns/ColBg.cpp | 88 ----------------------------------- src/columns/ColBg.h | 53 --------------------- src/columns/ColFg.cpp | 88 ----------------------------------- src/columns/ColFg.h | 53 --------------------- src/columns/Column.cpp | 8 +--- src/commands/CmdEdit.cpp | 36 +------------- src/commands/CmdInfo.cpp | 18 ------- src/commands/CmdTimesheet.cpp | 4 +- src/en-US.h | 6 --- src/legacy.cpp | 4 +- 15 files changed, 14 insertions(+), 400 deletions(-) delete mode 100644 src/columns/ColBg.cpp delete mode 100644 src/columns/ColBg.h delete mode 100644 src/columns/ColFg.cpp delete mode 100644 src/columns/ColFg.h diff --git a/ChangeLog b/ChangeLog index 2df7263d1..8c1e601fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ Features + Stop consider new tasks after quitting a bulk change. + + Removed deprecated 'fg:' and 'bg:' attributes. Bugs + Fixed bug #1038, which prints blank lines with bulk changes and when the diff --git a/NEWS b/NEWS index 589ef17e3..7ea25adfc 100644 --- a/NEWS +++ b/NEWS @@ -1,34 +1,21 @@ -New Features in taskwarrior 2.1.0 +New Features in taskwarrior 2.2.0 - - The new 'project.indented' format is available and used in the 'projects' - and 'summary' commands. - - Support for the 'scheduled' date for a task, which represent the earliest - opportunity to work on a task. - - All tasks may now be given an 'until' date, after which they will expire - and are deleted. - - Improved UTF8 handling for wide characters. - - User defined attributes. - - Partial UUIDs must now be at least 14 characters, up from 9. This - disambiguates a commonly date format. + - Deprectated 'fg' and 'bg' attributes removed. Any residual use of those + will appear as orphaned UDAs. Please refer to the ChangeLog file for full details. There are too many to list here. -New commands in taskwarrior 2.1.0 +New commands in taskwarrior 2.2.0 - - New 'ready' report that lists tasks ready for work, sorted by urgency. - - New 'udas' command shows UDA details and warnings. - - New '_udas' helper command lists UDA names for completion purposes. + - -New configuration options in taskwarrior 2.1.0 +New configuration options in taskwarrior 2.2.0 - - urgency.scheduled.coefficient - - urgency.uda..coefficient - - color.scheduled - - color.blocking + - -Newly deprecated features in taskwarrior 2.1.0 +Newly deprecated features in taskwarrior 2.2.0 - None diff --git a/doc/man/task.1.in b/doc/man/task.1.in index 8e868ef72..8e4192603 100644 --- a/doc/man/task.1.in +++ b/doc/man/task.1.in @@ -571,14 +571,6 @@ Specifies the date after which a task can be accomplished. .B until: Specifies the expiration date of a task, after which it will be deleted. -.TP -.B fg: -Specifies foreground color. Deprecated. - -.TP -.B bg: -Specifies background color. Deprecated. - .TP .B limit: Specifies the desired number of tasks a report should show, if a positive diff --git a/src/Config.cpp b/src/Config.cpp index 05849df2c..236ce3445 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -300,22 +300,6 @@ std::string Config::_defaults = "#merge.default.uri=user@host.xz:.task/ # URI for merge\n" "#pull.default.uri=rsync://host.xz/task-backup/ # URI for pull\n" "\n" - "# Import heuristics - alternate names for fields (comma-separated list of names)\n" - "#import.synonym.bg=?\n" - "#import.synonym.description=?\n" - "#import.synonym.due=?\n" - "#import.synonym.end=?\n" - "#import.synonym.entry=?\n" - "#import.synonym.fg=?\n" - "#import.synonym.id=?\n" - "#import.synonym.priority=?\n" - "#import.synonym.project=?\n" - "#import.synonym.recur=?\n" - "#import.synonym.start=?\n" - "#import.synonym.status=?\n" - "#import.synonym.tags=?\n" - "#import.synonym.uuid=?\n" - "\n" "# Aliases - alternate names for commands\n" "alias.rm=delete # Alias for the delete command\n" "alias.history=history.monthly # Prefer monthly over annual history reports\n" diff --git a/src/columns/CMakeLists.txt b/src/columns/CMakeLists.txt index 9b0cb464e..4ef0a7145 100644 --- a/src/columns/CMakeLists.txt +++ b/src/columns/CMakeLists.txt @@ -6,14 +6,12 @@ include_directories (${CMAKE_SOURCE_DIR} ${TASK_INCLUDE_DIRS}) set (columns_SRCS Column.cpp Column.h - ColBg.cpp ColBg.h ColDate.cpp ColDate.h ColDepends.cpp ColDepends.h ColDescription.cpp ColDescription.h ColDue.cpp ColDue.h ColEnd.cpp ColEnd.h ColEntry.cpp ColEntry.h - ColFg.cpp ColFg.h ColID.cpp ColID.h ColIMask.cpp ColIMask.h ColMask.cpp ColMask.h diff --git a/src/columns/ColBg.cpp b/src/columns/ColBg.cpp deleted file mode 100644 index 9283c5b29..000000000 --- a/src/columns/ColBg.cpp +++ /dev/null @@ -1,88 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// taskwarrior - a command line task list manager. -// -// Copyright 2006-2012, Paul Beckingham, Federico Hernandez. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// http://www.opensource.org/licenses/mit-license.php -// -//////////////////////////////////////////////////////////////////////////////// - -#define L10N // Localization complete. - -#include -#include -#include -#include - -extern Context context; - -//////////////////////////////////////////////////////////////////////////////// -ColumnBg::ColumnBg () -{ - _name = "bg"; - _type = "string"; - _style = "default"; - _label = STRING_COLUMN_LABEL_BG; - - _styles.push_back ("default"); - - _examples.push_back ("'on red'"); -} - -//////////////////////////////////////////////////////////////////////////////// -ColumnBg::~ColumnBg () -{ -} - -//////////////////////////////////////////////////////////////////////////////// -bool ColumnBg::validate (std::string& value) -{ - return true; -} - -//////////////////////////////////////////////////////////////////////////////// -// Set the minimum and maximum widths for the value. -void ColumnBg::measure (Task& task, int& minimum, int& maximum) -{ - std::string bg = task.get (_name); - - minimum = longestWord (bg); - maximum = bg.length (); -} - -//////////////////////////////////////////////////////////////////////////////// -void ColumnBg::render ( - std::vector & lines, - Task& task, - int width, - Color& color) -{ - std::string bg = task.get (_name); - - std::vector raw; - wrapText (raw, bg, width, _hyphenate); - - std::vector ::iterator i; - for (i = raw.begin (); i != raw.end (); ++i) - lines.push_back (color.colorize (leftJustify (*i, width))); -} - -//////////////////////////////////////////////////////////////////////////////// diff --git a/src/columns/ColBg.h b/src/columns/ColBg.h deleted file mode 100644 index 884d8bd05..000000000 --- a/src/columns/ColBg.h +++ /dev/null @@ -1,53 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// taskwarrior - a command line task list manager. -// -// Copyright 2006-2012, Paul Beckingham, Federico Hernandez. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// http://www.opensource.org/licenses/mit-license.php -// -//////////////////////////////////////////////////////////////////////////////// - -#ifndef INCLUDED_COLBG -#define INCLUDED_COLBG -#define L10N // Localization complete. - -#include -#include -#include -#include -#include - -class ColumnBg : public Column -{ -public: - ColumnBg (); - ~ColumnBg (); - - bool validate (std::string&); - void measure (Task&, int&, int&); - void render (std::vector &, Task&, int, Color&); - -private: - bool _hyphenate; -}; - -#endif -//////////////////////////////////////////////////////////////////////////////// diff --git a/src/columns/ColFg.cpp b/src/columns/ColFg.cpp deleted file mode 100644 index ab584bf3d..000000000 --- a/src/columns/ColFg.cpp +++ /dev/null @@ -1,88 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// taskwarrior - a command line task list manager. -// -// Copyright 2006-2012, Paul Beckingham, Federico Hernandez. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// http://www.opensource.org/licenses/mit-license.php -// -//////////////////////////////////////////////////////////////////////////////// - -#define L10N // Localization complete. - -#include -#include -#include -#include - -extern Context context; - -//////////////////////////////////////////////////////////////////////////////// -ColumnFg::ColumnFg () -{ - _name = "fg"; - _type = "string"; - _style = "default"; - _label = STRING_COLUMN_LABEL_FG; - - _styles.push_back ("default"); - - _examples.push_back ("red"); -} - -//////////////////////////////////////////////////////////////////////////////// -ColumnFg::~ColumnFg () -{ -} - -//////////////////////////////////////////////////////////////////////////////// -bool ColumnFg::validate (std::string& value) -{ - return true; -} - -//////////////////////////////////////////////////////////////////////////////// -// Set the minimum and maximum widths for the value. -void ColumnFg::measure (Task& task, int& minimum, int& maximum) -{ - std::string fg = task.get (_name); - - minimum = longestWord (fg); - maximum = fg.length (); -} - -//////////////////////////////////////////////////////////////////////////////// -void ColumnFg::render ( - std::vector & lines, - Task& task, - int width, - Color& color) -{ - std::string fg = task.get (_name); - - std::vector raw; - wrapText (raw, fg, width, _hyphenate); - - std::vector ::iterator i; - for (i = raw.begin (); i != raw.end (); ++i) - lines.push_back (color.colorize (leftJustify (*i, width))); -} - -//////////////////////////////////////////////////////////////////////////////// diff --git a/src/columns/ColFg.h b/src/columns/ColFg.h deleted file mode 100644 index aaa58b278..000000000 --- a/src/columns/ColFg.h +++ /dev/null @@ -1,53 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// taskwarrior - a command line task list manager. -// -// Copyright 2006-2012, Paul Beckingham, Federico Hernandez. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. -// -// http://www.opensource.org/licenses/mit-license.php -// -//////////////////////////////////////////////////////////////////////////////// - -#ifndef INCLUDED_COLFG -#define INCLUDED_COLFG -#define L10N // Localization complete. - -#include -#include -#include -#include -#include - -class ColumnFg : public Column -{ -public: - ColumnFg (); - ~ColumnFg (); - - bool validate (std::string&); - void measure (Task&, int&, int&); - void render (std::vector &, Task&, int, Color&); - -private: - bool _hyphenate; -}; - -#endif -//////////////////////////////////////////////////////////////////////////////// diff --git a/src/columns/Column.cpp b/src/columns/Column.cpp index a00d4ba4d..4c4069fe8 100644 --- a/src/columns/Column.cpp +++ b/src/columns/Column.cpp @@ -29,13 +29,11 @@ #include #include -#include #include #include #include #include #include -#include #include #include #include @@ -81,13 +79,11 @@ Column* Column::factory (const std::string& name, const std::string& report) } Column* c; - if (column_name == "bg") c = new ColumnBg (); - else if (column_name == "depends") c = new ColumnDepends (); + if (column_name == "depends") c = new ColumnDepends (); else if (column_name == "description") c = new ColumnDescription (); else if (column_name == "due") c = new ColumnDue (); else if (column_name == "end") c = new ColumnEnd (); else if (column_name == "entry") c = new ColumnEntry (); - else if (column_name == "fg") c = new ColumnFg (); else if (column_name == "id") c = new ColumnID (); else if (column_name == "imask") c = new ColumnIMask (); else if (column_name == "mask") c = new ColumnMask (); @@ -125,13 +121,11 @@ void Column::factory (std::map & all) { Column* c; - c = new ColumnBg (); all[c->_name] = c; c = new ColumnDepends (); all[c->_name] = c; c = new ColumnDescription (); all[c->_name] = c; c = new ColumnDue (); all[c->_name] = c; c = new ColumnEnd (); all[c->_name] = c; c = new ColumnEntry (); all[c->_name] = c; - c = new ColumnFg (); all[c->_name] = c; c = new ColumnID (); all[c->_name] = c; c = new ColumnIMask (); all[c->_name] = c; c = new ColumnMask (); all[c->_name] = c; diff --git a/src/commands/CmdEdit.cpp b/src/commands/CmdEdit.cpp index 2893aa2dd..aba5e3531 100644 --- a/src/commands/CmdEdit.cpp +++ b/src/commands/CmdEdit.cpp @@ -210,9 +210,7 @@ std::string CmdEdit::formatTask (Task task, const std::string& dateformat) << " Until: " << formatDate (task, "until", dateformat) << "\n" << " Recur: " << task.get ("recur") << "\n" << " Wait until: " << formatDate (task, "wait", dateformat) << "\n" - << " Parent: " << task.get ("parent") << "\n" - << " Foreground color: " << task.get ("fg") << "\n" - << " Background color: " << task.get ("bg") << "\n"; + << " Parent: " << task.get ("parent") << "\n"; if (verbose) before << "# " << STRING_EDIT_HEADER_13 << "\n" @@ -613,38 +611,6 @@ void CmdEdit::parseTask (Task& task, const std::string& after, const std::string } } - // fg - value = findValue (after, "\n Foreground color:"); - if (value != task.get ("fg")) - { - if (value != "") - { - context.footnote (STRING_EDIT_FG_MOD); - task.set ("fg", value); - } - else - { - context.footnote (STRING_EDIT_FG_DEL); - task.remove ("fg"); - } - } - - // bg - value = findValue (after, "\n Background color:"); - if (value != task.get ("bg")) - { - if (value != "") - { - context.footnote (STRING_EDIT_BG_MOD); - task.set ("bg", value); - } - else - { - context.footnote (STRING_EDIT_BG_DEL); - task.remove ("bg"); - } - } - // Annotations std::map annotations; std::string::size_type found = 0; diff --git a/src/commands/CmdInfo.cpp b/src/commands/CmdInfo.cpp index 23eeedea5..fb7790ed0 100644 --- a/src/commands/CmdInfo.cpp +++ b/src/commands/CmdInfo.cpp @@ -300,24 +300,6 @@ int CmdInfo::execute (std::string& output) view.set (row, 1, entry + " (" + age + ")"); - // fg TODO deprecated 2.0 - std::string color = task->get ("fg"); - if (color != "") - { - row = view.addRow (); - view.set (row, 0, STRING_COLUMN_LABEL_FG); - view.set (row, 1, color); - } - - // bg TODO deprecated 2.0 - color = task->get ("bg"); - if (color != "") - { - row = view.addRow (); - view.set (row, 0, STRING_COLUMN_LABEL_BG); - view.set (row, 1, color); - } - // Task::urgency row = view.addRow (); view.set (row, 0, STRING_COLUMN_LABEL_URGENCY); diff --git a/src/commands/CmdTimesheet.cpp b/src/commands/CmdTimesheet.cpp index 2c4a00231..ba84d9d42 100644 --- a/src/commands/CmdTimesheet.cpp +++ b/src/commands/CmdTimesheet.cpp @@ -111,7 +111,7 @@ int CmdTimesheet::execute (std::string& output) Date compDate (task->get_date ("end")); if (compDate >= start && compDate < end) { - Color c (task->get ("fg") + " " + task->get ("bg")); + Color c; if (context.color ()) autoColorize (*task, c); @@ -168,7 +168,7 @@ int CmdTimesheet::execute (std::string& output) Date startDate (task->get_date ("start")); if (startDate >= start && startDate < end) { - Color c (task->get ("fg") + " " + task->get ("bg")); + Color c; if (context.color ()) autoColorize (*task, c); diff --git a/src/en-US.h b/src/en-US.h index 0334a4579..fea3ceb2e 100644 --- a/src/en-US.h +++ b/src/en-US.h @@ -176,8 +176,6 @@ #define STRING_COLUMN_LABEL_MASK "Mask" #define STRING_COLUMN_LABEL_MASK_IDX "Mask Index" #define STRING_COLUMN_LABEL_PARENT "Parent task" -#define STRING_COLUMN_LABEL_FG "Foreground color" -#define STRING_COLUMN_LABEL_BG "Background color" #define STRING_COLUMN_LABEL_DATE "Date" #define STRING_COLUMN_LABEL_COLUMN "Columns" #define STRING_COLUMN_LABEL_STYLES "Supported Formats" @@ -650,10 +648,6 @@ #define STRING_EDIT_WAIT_DEL "Wait date removed." #define STRING_EDIT_PARENT_MOD "Parent UUID modified." #define STRING_EDIT_PARENT_DEL "Parent UUID removed." -#define STRING_EDIT_FG_MOD "Foreground color modified." -#define STRING_EDIT_FG_DEL "Foreground color removed." -#define STRING_EDIT_BG_MOD "Background color modified." -#define STRING_EDIT_BG_DEL "Background color removed." #define STRING_EDIT_UDA_MOD "UDA {1} modified." #define STRING_EDIT_UDA_DEL "UDA {1} deleted." diff --git a/src/legacy.cpp b/src/legacy.cpp index 0b970a1e5..4c56316d0 100644 --- a/src/legacy.cpp +++ b/src/legacy.cpp @@ -37,9 +37,7 @@ extern Context context; //////////////////////////////////////////////////////////////////////////////// void legacyAttributeCheck (const std::string& name) { - // Legacy checks. - if (name == "fg" || name == "bg") - context.footnote (format (STRING_LEGACY_FEATURE, name)); + // 2012-07-25: Deprecated "fg" and "bg" removed. } ////////////////////////////////////////////////////////////////////////////////