Task: Add clear method

Avoid needless increments of the task id counter for Task().

Change-Id: I6243b4fe9e8fd91653e236722282fa8f8a9ed82d
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Tobias Hunger
2013-05-03 15:58:01 +02:00
parent b2a355725f
commit fa9d57fb68
2 changed files with 12 additions and 0 deletions

View File

@@ -59,6 +59,17 @@ void Task::addMark(TextEditor::BaseTextMark *mark)
bool Task::isNull() const
{ return taskId == 0; }
void Task::clear()
{
taskId = 0;
description.clear();
file = Utils::FileName();
line = -1;
movedLine = -1;
category = Core::Id();
type = Task::Unknown;
}
//
// functions
//

View File

@@ -57,6 +57,7 @@ public:
const Utils::FileName &file_, int line_, const Core::Id &category_);
bool isNull() const;
void clear();
unsigned int taskId;
TaskType type;