mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Columns
- Removed ColUDA::is_uda override, because it was wrong. Now in the base class a member variable is referenced.
This commit is contained in:
parent
2aa224d278
commit
8d10d81198
5 changed files with 19 additions and 15 deletions
|
@ -552,8 +552,13 @@ void A3t::findAttribute ()
|
|||
(*i)->attribute ("name", canonical);
|
||||
(*i)->attribute ("value", value);
|
||||
|
||||
if (context.columns[canonical]->modifiable ())
|
||||
std::map <std::string, Column*>::const_iterator col;
|
||||
col = context.columns.find (canonical);
|
||||
if (col != context.columns.end () &&
|
||||
col->second->modifiable ())
|
||||
{
|
||||
(*i)->tag ("MODIFIABLE");
|
||||
}
|
||||
}
|
||||
|
||||
else if (canonicalize (canonical, "uda", name))
|
||||
|
|
|
@ -43,6 +43,7 @@ ColumnUDA::ColumnUDA ()
|
|||
_type = "string";
|
||||
_style = "default";
|
||||
_label = "";
|
||||
_uda = true;
|
||||
|
||||
_hyphenate = (_type == "string") ? true : false;
|
||||
|
||||
|
@ -56,12 +57,6 @@ ColumnUDA::~ColumnUDA ()
|
|||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool ColumnUDA::is_uda () const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool ColumnUDA::validate (std::string& value)
|
||||
{
|
||||
|
|
|
@ -39,7 +39,6 @@ public:
|
|||
ColumnUDA ();
|
||||
~ColumnUDA ();
|
||||
|
||||
bool is_uda () const;
|
||||
bool validate (std::string&);
|
||||
void measure (Task&, unsigned int&, unsigned int&);
|
||||
void render (std::vector <std::string>&, Task&, int, Color&);
|
||||
|
|
|
@ -209,6 +209,7 @@ Column::Column ()
|
|||
, _label ("")
|
||||
, _report ("")
|
||||
, _modifiable (true)
|
||||
, _uda (false)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -221,6 +222,7 @@ Column::Column (const Column& other)
|
|||
_label = other._label;
|
||||
_label = other._report;
|
||||
_modifiable = other._modifiable;
|
||||
_uda = other._uda;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -234,6 +236,7 @@ Column& Column::operator= (const Column& other)
|
|||
_label = other._label;
|
||||
_report = other._report;
|
||||
_modifiable = other._modifiable;
|
||||
_uda = other._uda;
|
||||
}
|
||||
|
||||
return *this;
|
||||
|
@ -242,12 +245,13 @@ Column& Column::operator= (const Column& other)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Column::operator== (const Column& other) const
|
||||
{
|
||||
return _name == other._name &&
|
||||
_type == other._type &&
|
||||
_style == other._style &&
|
||||
_label == other._label &&
|
||||
_report == other._report &&
|
||||
_modifiable == other._modifiable;
|
||||
return _name == other._name &&
|
||||
_type == other._type &&
|
||||
_style == other._style &&
|
||||
_label == other._label &&
|
||||
_report == other._report &&
|
||||
_modifiable == other._modifiable &&
|
||||
_uda == other._uda;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -50,7 +50,7 @@ public:
|
|||
std::string label () const { return _label; }
|
||||
std::string type () const { return _type; }
|
||||
bool modifiable () const { return _modifiable; }
|
||||
bool is_uda () const { return false; }
|
||||
bool is_uda () const { return _uda; }
|
||||
std::vector <std::string> styles () const { return _styles; }
|
||||
std::vector <std::string> examples () const { return _examples; }
|
||||
|
||||
|
@ -74,6 +74,7 @@ protected:
|
|||
std::string _label;
|
||||
std::string _report;
|
||||
bool _modifiable;
|
||||
bool _uda;
|
||||
std::vector <std::string> _styles;
|
||||
std::vector <std::string> _examples;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue