Skip to content
Permalink
Browse files
Make QgsTask::start private
Only allow starting tasks to be done by QgsTaskManager
  • Loading branch information
nyalldawson committed Dec 5, 2016
1 parent 297b572 commit 268e5127f2ad5eb87d187cd9d014a449eda1371b
Showing with 8 additions and 16 deletions.
  1. +0 −8 python/core/qgstaskmanager.sip
  2. +8 −8 src/core/qgstaskmanager.h
@@ -86,14 +86,6 @@ class QgsTask : QObject
*/
double progress() const;

/**
* Starts the task. Should only be called for tasks which are not being
* handled by a QgsTaskManager. If the task is managed by a QgsTaskManager
* then this method should not be called directly, instead it is left to the
* task manager to start the task when appropriate.
*/
void start();

/**
* Notifies the task that it should terminate. Calling this is not guaranteed
* to immediately end the task, rather it sets the isCancelled() flag which
@@ -117,14 +117,6 @@ class CORE_EXPORT QgsTask : public QObject
*/
double progress() const { return mTotalProgress; }

/**
* Starts the task. Should only be called for tasks which are not being
* handled by a QgsTaskManager. If the task is managed by a QgsTaskManager
* then this method should not be called directly, instead it is left to the
* task manager to start the task when appropriate.
*/
void start();

/**
* Notifies the task that it should terminate. Calling this is not guaranteed
* to immediately end the task, rather it sets the isCancelled() flag which
@@ -323,13 +315,21 @@ class CORE_EXPORT QgsTask : public QObject
};
QList< SubTask > mSubTasks;


/**
* Starts the task. Should not be public as only QgsTaskManagers can initiate tasks.
*/
void start();

void processSubTasksForCompletion();

void processSubTasksForTermination();

void processSubTasksForHold();

friend class QgsTaskManager;
friend class QgsTaskRunnableWrapper;
friend class TestQgsTaskManager;

};

0 comments on commit 268e512

Please sign in to comment.