From 2522aefaf0881192e6ee92b9ff67a2beae81d542 Mon Sep 17 00:00:00 2001 From: Guenter Obiltschnig Date: Sat, 13 Feb 2016 20:22:02 +0100 Subject: [PATCH] fix comment; don't send TaskProgressNotification if progress does not change Conflicts: Foundation/src/Task.cpp --- Foundation/include/Poco/TaskNotification.h | 2 +- Foundation/src/Task.cpp | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Foundation/include/Poco/TaskNotification.h b/Foundation/include/Poco/TaskNotification.h index 6958395c0..3c0b6ad5f 100644 --- a/Foundation/include/Poco/TaskNotification.h +++ b/Foundation/include/Poco/TaskNotification.h @@ -102,7 +102,7 @@ private: class Foundation_API TaskProgressNotification: public TaskNotification /// This notification is posted by the TaskManager for - /// every task that has failed with an exception. + /// a task when its progress changes. { public: TaskProgressNotification(Task* pTask, float progress); diff --git a/Foundation/src/Task.cpp b/Foundation/src/Task.cpp index c8289d1ec..aeba58d03 100644 --- a/Foundation/src/Task.cpp +++ b/Foundation/src/Task.cpp @@ -95,9 +95,12 @@ void Task::setProgress(float progress) { FastMutex::ScopedLock lock(_mutex); - _progress = progress; - if (_pOwner) - _pOwner->taskProgress(this, _progress); + if (_progress != taskProgress) + { + _progress = taskProgress; + if (_pOwner) + _pOwner->taskProgress(this, _progress); + } }