From 4960366be8575e23ddea041188a21de0cad7b253 Mon Sep 17 00:00:00 2001
From: Tobias Hunger <tobias.hunger@nokia.com>
Date: Wed, 4 Aug 2010 14:56:32 +0200
Subject: [PATCH] Null task

 * Add a way to have a null-task which is invalid for evaluation
---
 src/plugins/projectexplorer/task.cpp | 11 ++++++-----
 src/plugins/projectexplorer/task.h   |  2 ++
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/plugins/projectexplorer/task.cpp b/src/plugins/projectexplorer/task.cpp
index 947628ba823..2016a644ccf 100644
--- a/src/plugins/projectexplorer/task.cpp
+++ b/src/plugins/projectexplorer/task.cpp
@@ -32,12 +32,10 @@
 namespace ProjectExplorer
 {
 
-unsigned int Task::s_nextId = 0;
+unsigned int Task::s_nextId = 1;
 
-Task::Task() : taskId(s_nextId), type(Unknown), line(-1)
-{
-    ++s_nextId;
-}
+Task::Task() : taskId(0), type(Unknown), line(-1)
+{ }
 
 Task::Task(TaskType type_, const QString &description_,
            const QString &file_, int line_, const QString &category_) :
@@ -47,6 +45,9 @@ Task::Task(TaskType type_, const QString &description_,
     ++s_nextId;
 }
 
+bool Task::isNull() const
+{ return taskId == 0; }
+
 //
 // functions
 //
diff --git a/src/plugins/projectexplorer/task.h b/src/plugins/projectexplorer/task.h
index db6fa228e09..4373a3a87d7 100644
--- a/src/plugins/projectexplorer/task.h
+++ b/src/plugins/projectexplorer/task.h
@@ -52,6 +52,8 @@ public:
     Task(TaskType type_, const QString &description_,
          const QString &file_, int line_, const QString &category_);
 
+    bool isNull() const;
+
     unsigned int taskId;
     TaskType type;
     QString description;
-- 
GitLab