Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Smaller header updates, switch connect style
  • Loading branch information
nyalldawson committed Dec 5, 2016
1 parent 95dbb3a commit bc37b40
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/core/qgstaskmanager.cpp
Expand Up @@ -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() )
{
Expand Down Expand Up @@ -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
{
Expand Down
17 changes: 9 additions & 8 deletions src/core/qgstaskmanager.h
Expand Up @@ -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
{
Expand All @@ -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
Expand Down Expand Up @@ -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
{
Expand Down

0 comments on commit bc37b40

Please sign in to comment.