Skip to content
Permalink
Browse files
Smaller header updates, switch connect style
  • Loading branch information
nyalldawson committed Dec 5, 2016
1 parent 95dbb3a commit bc37b40179aeb3fc3c0427dc677ba49ee85b19cc
Showing with 13 additions and 12 deletions.
  1. +4 −4 src/core/qgstaskmanager.cpp
  2. +9 −8 src/core/qgstaskmanager.h
@@ -138,8 +138,8 @@ long QgsTaskManager::addTask( QgsTask* task, const QgsTaskList& dependencies )
QMutexLocker ml( mTaskMutex );
mTasks.insert( mNextTaskId, task );

connect( task, SIGNAL( progressChanged( double ) ), this, SLOT( taskProgressChanged( double ) ) );
connect( task, SIGNAL( statusChanged( int ) ), this, SLOT( taskStatusChanged( int ) ) );
connect( task, &QgsTask::progressChanged, this, &QgsTaskManager::taskProgressChanged );
connect( task, &QgsTask::statusChanged, this, &QgsTaskManager::taskStatusChanged );

if ( !dependencies.isEmpty() )
{
@@ -397,8 +397,8 @@ bool QgsTaskManager::cleanupAndDeleteTask( QgsTask *task )
{
task->cancel();
// delete task when it's terminated
connect( task, SIGNAL( taskCompleted() ), task, SLOT( deleteLater() ) );
connect( task, SIGNAL( taskStopped() ), task, SLOT( deleteLater() ) );
connect( task, &QgsTask::taskCompleted, task, &QgsTask::deleteLater );
connect( task, &QgsTask::taskStopped, task, &QgsTask::deleteLater );
}
else
{
@@ -23,11 +23,12 @@
#include <QAbstractItemModel>
#include <QFuture>

/** \ingroup core
/**
* \ingroup core
* \class QgsTask
* \brief Interface class for long running background tasks. Tasks can be controlled directly,
* or added to a QgsTaskManager for automatic management.
* \note Added in version 2.16
* \note Added in version 3.0
*/
class CORE_EXPORT QgsTask : public QObject
{
@@ -38,11 +39,11 @@ class CORE_EXPORT QgsTask : public QObject
//! Status of tasks
enum TaskStatus
{
Queued, /*!< Task is queued and has not begun */
OnHold, /*!< Task is queued but on hold and will not be started */
Running, /*!< Task is currently running */
Complete, /*!< Task successfully completed */
Terminated, /*!< Task was terminated or errored */
Queued, //!< Task is queued and has not begun
OnHold, //!< Task is queued but on hold and will not be started
Running, //!< Task is currently running
Complete, //!< Task successfully completed
Terminated, //!< Task was terminated or errored
};

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

0 comments on commit bc37b40

Please sign in to comment.