Skip to content

Commit bc37b40

Browse files
committedDec 5, 2016
Smaller header updates, switch connect style
1 parent 95dbb3a commit bc37b40

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed
 

‎src/core/qgstaskmanager.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ long QgsTaskManager::addTask( QgsTask* task, const QgsTaskList& dependencies )
138138
QMutexLocker ml( mTaskMutex );
139139
mTasks.insert( mNextTaskId, task );
140140

141-
connect( task, SIGNAL( progressChanged( double ) ), this, SLOT( taskProgressChanged( double ) ) );
142-
connect( task, SIGNAL( statusChanged( int ) ), this, SLOT( taskStatusChanged( int ) ) );
141+
connect( task, &QgsTask::progressChanged, this, &QgsTaskManager::taskProgressChanged );
142+
connect( task, &QgsTask::statusChanged, this, &QgsTaskManager::taskStatusChanged );
143143

144144
if ( !dependencies.isEmpty() )
145145
{
@@ -397,8 +397,8 @@ bool QgsTaskManager::cleanupAndDeleteTask( QgsTask *task )
397397
{
398398
task->cancel();
399399
// delete task when it's terminated
400-
connect( task, SIGNAL( taskCompleted() ), task, SLOT( deleteLater() ) );
401-
connect( task, SIGNAL( taskStopped() ), task, SLOT( deleteLater() ) );
400+
connect( task, &QgsTask::taskCompleted, task, &QgsTask::deleteLater );
401+
connect( task, &QgsTask::taskStopped, task, &QgsTask::deleteLater );
402402
}
403403
else
404404
{

‎src/core/qgstaskmanager.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@
2323
#include <QAbstractItemModel>
2424
#include <QFuture>
2525

26-
/** \ingroup core
26+
/**
27+
* \ingroup core
2728
* \class QgsTask
2829
* \brief Interface class for long running background tasks. Tasks can be controlled directly,
2930
* or added to a QgsTaskManager for automatic management.
30-
* \note Added in version 2.16
31+
* \note Added in version 3.0
3132
*/
3233
class CORE_EXPORT QgsTask : public QObject
3334
{
@@ -38,11 +39,11 @@ class CORE_EXPORT QgsTask : public QObject
3839
//! Status of tasks
3940
enum TaskStatus
4041
{
41-
Queued, /*!< Task is queued and has not begun */
42-
OnHold, /*!< Task is queued but on hold and will not be started */
43-
Running, /*!< Task is currently running */
44-
Complete, /*!< Task successfully completed */
45-
Terminated, /*!< Task was terminated or errored */
42+
Queued, //!< Task is queued and has not begun
43+
OnHold, //!< Task is queued but on hold and will not be started
44+
Running, //!< Task is currently running
45+
Complete, //!< Task successfully completed
46+
Terminated, //!< Task was terminated or errored
4647
};
4748

4849
//! Task flags
@@ -173,7 +174,7 @@ typedef QList< QgsTask* > QgsTaskList;
173174
* \class QgsTaskManager
174175
* \brief Task manager for managing a set of long-running QgsTask tasks. This class can be created directly,
175176
* or accessed via a global instance.
176-
* \note Added in version 2.16
177+
* \note Added in version 3.0
177178
*/
178179
class CORE_EXPORT QgsTaskManager : public QObject
179180
{

0 commit comments

Comments
 (0)
Please sign in to comment.