mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-10 15:05:49 +02:00
Code Cleanup - obsolete code
- Removed obsolete T::removeAttributes. - Removed obsolete T::sequenceContains. - Modified handleInfo so it no longer uses T::sequenceContains, and instead uses filterSequence.
This commit is contained in:
parent
8fa38fc4c3
commit
0eff6fa2b1
5 changed files with 218 additions and 231 deletions
|
@ -42,6 +42,14 @@ public:
|
|||
virtual std::string composeCSV () = 0;
|
||||
void parse (const std::string&);
|
||||
|
||||
/*
|
||||
void getAttributes (std::map<std::string, std::string>&);
|
||||
const std::string getAttribute (const std::string&);
|
||||
void setAttribute (const std::string&, const std::string&);
|
||||
void setAttributes (const std::map <std::string, std::string>&);
|
||||
void removeAttribute (const std::string&);
|
||||
*/
|
||||
|
||||
private:
|
||||
std::vector <Att> mAtts;
|
||||
};
|
||||
|
|
16
src/T.cpp
16
src/T.cpp
|
@ -230,12 +230,6 @@ void T::setAttributes (const std::map <std::string, std::string>& attributes)
|
|||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void T::removeAttributes ()
|
||||
{
|
||||
mAttributes.clear ();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
void T::removeAttribute (const std::string& name)
|
||||
{
|
||||
|
@ -290,16 +284,6 @@ void T::addAnnotation (const std::string& description)
|
|||
mAnnotations[time (NULL)] = sanitized;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool T::sequenceContains (int id) const
|
||||
{
|
||||
foreach (seq, mSequence)
|
||||
if (*seq == id)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// uuid status [tags] [attributes] [annotations] description
|
||||
//
|
||||
|
|
2
src/T.h
2
src/T.h
|
@ -79,12 +79,10 @@ public:
|
|||
void setAttribute (const std::string&, const std::string&);
|
||||
void setAttributes (const std::map <std::string, std::string>&);
|
||||
void removeAttribute (const std::string&);
|
||||
void removeAttributes ();
|
||||
|
||||
void getAnnotations (std::map <time_t, std::string>&) const;
|
||||
void setAnnotations (const std::map <time_t, std::string>&);
|
||||
void addAnnotation (const std::string&);
|
||||
bool sequenceContains (int) const;
|
||||
|
||||
const std::string compose () const;
|
||||
const std::string composeCSV ();
|
||||
|
|
|
@ -41,6 +41,8 @@ public:
|
|||
std::string composeF4 ();
|
||||
std::string composeCSV ();
|
||||
|
||||
// TODO Series of helper functions.
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
|
|
|
@ -314,16 +314,12 @@ std::string handleInfo (TDB& tdb, T& task, Config& conf)
|
|||
// Get all the tasks.
|
||||
std::vector <T> tasks;
|
||||
tdb.allPendingT (tasks);
|
||||
filterSequence (tasks, task);
|
||||
|
||||
// Find the task.
|
||||
int count = 0;
|
||||
for (unsigned int i = 0; i < tasks.size (); ++i)
|
||||
foreach (t, tasks)
|
||||
{
|
||||
T refTask (tasks[i]);
|
||||
|
||||
if (refTask.getId () == task.getId () || task.sequenceContains (refTask.getId ()))
|
||||
{
|
||||
++count;
|
||||
T refTask (*t);
|
||||
|
||||
Table table;
|
||||
table.setTableWidth (width);
|
||||
|
@ -532,9 +528,8 @@ std::string handleInfo (TDB& tdb, T& task, Config& conf)
|
|||
<< table.render ()
|
||||
<< std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
if (! count)
|
||||
if (! tasks.size ())
|
||||
out << "No matches." << std::endl;
|
||||
|
||||
return out.str ();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue