mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Columns
- Implemented ColPriority, with 'default' and 'long' formats. - Implemented ColProject 'parent' format.
This commit is contained in:
parent
dd1be996a6
commit
9fd819e3a0
9 changed files with 195 additions and 16 deletions
|
@ -28,19 +28,34 @@
|
|||
#include <Context.h>
|
||||
#include <Column.h>
|
||||
#include <ColID.h>
|
||||
#include <ColPriority.h>
|
||||
#include <ColProject.h>
|
||||
#include <text.h>
|
||||
|
||||
extern Context context;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// TODO Supports the new complete column definition:
|
||||
//
|
||||
// <type>[.<format>][.<key>[.<direction>][.<break>]]
|
||||
//
|
||||
Column* Column::factory (const std::string& name)
|
||||
{
|
||||
if (name == "id") return new ColumnID ();
|
||||
if (name == "project") return new ColumnProject ();
|
||||
// TODO Decompose name into type, format, key, direction and break.
|
||||
|
||||
throw std::string ("Unrecognized column type '") + name + "'";
|
||||
return NULL;
|
||||
Column* column;
|
||||
if (name == "id") column = new ColumnID ();
|
||||
else if (name == "priority") column = new ColumnPriority ();
|
||||
else if (name == "project") column = new ColumnProject ();
|
||||
else
|
||||
throw std::string ("Unrecognized column type '") + name + "'";
|
||||
|
||||
// TODO Set format.
|
||||
// TODO Set key.
|
||||
// TODO Set direction.
|
||||
// TODO Set break.
|
||||
|
||||
return column;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue