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.
This commit is contained in:
Paul Beckingham 2012-07-25 22:44:25 -04:00
parent 1d99260cb9
commit d89d51e7e1
15 changed files with 14 additions and 400 deletions

View file

@ -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"

View file

@ -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

View file

@ -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 <Context.h>
#include <ColBg.h>
#include <text.h>
#include <i18n.h>
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 <std::string>& lines,
Task& task,
int width,
Color& color)
{
std::string bg = task.get (_name);
std::vector <std::string> raw;
wrapText (raw, bg, width, _hyphenate);
std::vector <std::string>::iterator i;
for (i = raw.begin (); i != raw.end (); ++i)
lines.push_back (color.colorize (leftJustify (*i, width)));
}
////////////////////////////////////////////////////////////////////////////////

View file

@ -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 <vector>
#include <string>
#include <Column.h>
#include <Color.h>
#include <Task.h>
class ColumnBg : public Column
{
public:
ColumnBg ();
~ColumnBg ();
bool validate (std::string&);
void measure (Task&, int&, int&);
void render (std::vector <std::string>&, Task&, int, Color&);
private:
bool _hyphenate;
};
#endif
////////////////////////////////////////////////////////////////////////////////

View file

@ -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 <Context.h>
#include <ColFg.h>
#include <text.h>
#include <i18n.h>
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 <std::string>& lines,
Task& task,
int width,
Color& color)
{
std::string fg = task.get (_name);
std::vector <std::string> raw;
wrapText (raw, fg, width, _hyphenate);
std::vector <std::string>::iterator i;
for (i = raw.begin (); i != raw.end (); ++i)
lines.push_back (color.colorize (leftJustify (*i, width)));
}
////////////////////////////////////////////////////////////////////////////////

View file

@ -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 <vector>
#include <string>
#include <Column.h>
#include <Color.h>
#include <Task.h>
class ColumnFg : public Column
{
public:
ColumnFg ();
~ColumnFg ();
bool validate (std::string&);
void measure (Task&, int&, int&);
void render (std::vector <std::string>&, Task&, int, Color&);
private:
bool _hyphenate;
};
#endif
////////////////////////////////////////////////////////////////////////////////

View file

@ -29,13 +29,11 @@
#include <Context.h>
#include <Column.h>
#include <ColBg.h>
#include <ColDepends.h>
#include <ColDescription.h>
#include <ColDue.h>
#include <ColEnd.h>
#include <ColEntry.h>
#include <ColFg.h>
#include <ColID.h>
#include <ColIMask.h>
#include <ColMask.h>
@ -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 <std::string, Column*>& 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;

View file

@ -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 <std::string, std::string> annotations;
std::string::size_type found = 0;

View file

@ -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);

View file

@ -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);

View file

@ -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."

View file

@ -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.
}
////////////////////////////////////////////////////////////////////////////////