Skip to content

Commit 268e512

Browse files
committedDec 5, 2016
Make QgsTask::start private
Only allow starting tasks to be done by QgsTaskManager
1 parent 297b572 commit 268e512

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed
 

‎python/core/qgstaskmanager.sip

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,6 @@ class QgsTask : QObject
8686
*/
8787
double progress() const;
8888

89-
/**
90-
* Starts the task. Should only be called for tasks which are not being
91-
* handled by a QgsTaskManager. If the task is managed by a QgsTaskManager
92-
* then this method should not be called directly, instead it is left to the
93-
* task manager to start the task when appropriate.
94-
*/
95-
void start();
96-
9789
/**
9890
* Notifies the task that it should terminate. Calling this is not guaranteed
9991
* to immediately end the task, rather it sets the isCancelled() flag which

‎src/core/qgstaskmanager.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,6 @@ class CORE_EXPORT QgsTask : public QObject
117117
*/
118118
double progress() const { return mTotalProgress; }
119119

120-
/**
121-
* Starts the task. Should only be called for tasks which are not being
122-
* handled by a QgsTaskManager. If the task is managed by a QgsTaskManager
123-
* then this method should not be called directly, instead it is left to the
124-
* task manager to start the task when appropriate.
125-
*/
126-
void start();
127-
128120
/**
129121
* Notifies the task that it should terminate. Calling this is not guaranteed
130122
* to immediately end the task, rather it sets the isCancelled() flag which
@@ -323,13 +315,21 @@ class CORE_EXPORT QgsTask : public QObject
323315
};
324316
QList< SubTask > mSubTasks;
325317

318+
319+
/**
320+
* Starts the task. Should not be public as only QgsTaskManagers can initiate tasks.
321+
*/
322+
void start();
323+
326324
void processSubTasksForCompletion();
327325

328326
void processSubTasksForTermination();
329327

330328
void processSubTasksForHold();
331329

332330
friend class QgsTaskManager;
331+
friend class QgsTaskRunnableWrapper;
332+
friend class TestQgsTaskManager;
333333

334334
};
335335

0 commit comments

Comments
 (0)
Please sign in to comment.