Skip to content

Commit

Permalink
Make QgsTask::start private
Browse files Browse the repository at this point in the history
Only allow starting tasks to be done by QgsTaskManager
  • Loading branch information
nyalldawson committed Dec 5, 2016
1 parent 297b572 commit 268e512
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
8 changes: 0 additions & 8 deletions python/core/qgstaskmanager.sip
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions src/core/qgstaskmanager.h
Expand Up @@ -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
Expand Down Expand Up @@ -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;

};

Expand Down

0 comments on commit 268e512

Please sign in to comment.