Skip to content

Commit

Permalink
Flip some connects to new style
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jan 31, 2017
1 parent b52b577 commit 2b470d2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions src/core/qgsmaprenderercache.cpp
Expand Up @@ -41,7 +41,7 @@ void QgsMapRendererCache::clearInternal()
QgsMapLayer* layer = QgsProject::instance()->mapLayer( it.key() );
if ( layer )
{
disconnect( layer, SIGNAL( repaintRequested() ), this, SLOT( layerRequestedRepaint() ) );
disconnect( layer, &QgsMapLayer::repaintRequested, this, &QgsMapRendererCache::layerRequestedRepaint );
}
}
mCachedImages.clear();
Expand Down Expand Up @@ -74,7 +74,7 @@ void QgsMapRendererCache::setCacheImage( const QString& layerId, const QImage& i
QgsMapLayer* layer = QgsProject::instance()->mapLayer( layerId );
if ( layer )
{
connect( layer, SIGNAL( repaintRequested() ), this, SLOT( layerRequestedRepaint() ) );
connect( layer, &QgsMapLayer::repaintRequested, this, &QgsMapRendererCache::layerRequestedRepaint );
}
}

Expand All @@ -100,6 +100,6 @@ void QgsMapRendererCache::clearCacheImage( const QString& layerId )
QgsMapLayer* layer = QgsProject::instance()->mapLayer( layerId );
if ( layer )
{
disconnect( layer, SIGNAL( repaintRequested() ), this, SLOT( layerRequestedRepaint() ) );
disconnect( layer, &QgsMapLayer::repaintRequested, this, &QgsMapRendererCache::layerRequestedRepaint );
}
}
8 changes: 4 additions & 4 deletions src/core/qgsmaprenderercustompainterjob.cpp
Expand Up @@ -95,7 +95,7 @@ void QgsMapRendererCustomPainterJob::start()
}

// now we are ready to start rendering!
connect( &mFutureWatcher, SIGNAL( finished() ), SLOT( futureFinished() ) );
connect( &mFutureWatcher, &QFutureWatcher<void>::finished, this, &QgsMapRendererCustomPainterJob::futureFinished );

mFuture = QtConcurrent::run( staticRender, this );
mFutureWatcher.setFuture( mFuture );
Expand All @@ -111,7 +111,7 @@ void QgsMapRendererCustomPainterJob::cancel()
}

QgsDebugMsg( "QPAINTER canceling" );
disconnect( &mFutureWatcher, SIGNAL( finished() ), this, SLOT( futureFinished() ) );
disconnect( &mFutureWatcher, &QFutureWatcher<void>::finished, this, &QgsMapRendererCustomPainterJob::futureFinished );

mLabelingRenderContext.setRenderingStopped( true );
for ( LayerRenderJobs::iterator it = mLayerJobs.begin(); it != mLayerJobs.end(); ++it )
Expand All @@ -138,7 +138,7 @@ void QgsMapRendererCustomPainterJob::waitForFinished()
if ( !isActive() )
return;

disconnect( &mFutureWatcher, SIGNAL( finished() ), this, SLOT( futureFinished() ) );
disconnect( &mFutureWatcher, &QFutureWatcher<void>::finished, this, &QgsMapRendererCustomPainterJob::futureFinished );

QTime t;
t.start();
Expand Down Expand Up @@ -168,7 +168,7 @@ QgsLabelingResults* QgsMapRendererCustomPainterJob::takeLabelingResults()
void QgsMapRendererCustomPainterJob::waitForFinishedWithEventLoop( QEventLoop::ProcessEventsFlags flags )
{
QEventLoop loop;
connect( &mFutureWatcher, SIGNAL( finished() ), &loop, SLOT( quit() ) );
connect( &mFutureWatcher, &QFutureWatcher<void>::finished, &loop, &QEventLoop::quit );
loop.exec( flags );
}

Expand Down
12 changes: 6 additions & 6 deletions src/core/qgsmaprendererparalleljob.cpp
Expand Up @@ -68,7 +68,7 @@ void QgsMapRendererParallelJob::start()

// start async job

connect( &mFutureWatcher, SIGNAL( finished() ), SLOT( renderLayersFinished() ) );
connect( &mFutureWatcher, &QFutureWatcher<void>::finished, this, &QgsMapRendererParallelJob::renderLayersFinished );

mFuture = QtConcurrent::map( mLayerJobs, renderLayerStatic );
mFutureWatcher.setFuture( mFuture );
Expand All @@ -91,7 +91,7 @@ void QgsMapRendererParallelJob::cancel()

if ( mStatus == RenderingLayers )
{
disconnect( &mFutureWatcher, SIGNAL( finished() ), this, SLOT( renderLayersFinished() ) );
disconnect( &mFutureWatcher, &QFutureWatcher<void>::finished, this, &QgsMapRendererParallelJob::renderLayersFinished );

mFutureWatcher.waitForFinished();

Expand All @@ -100,7 +100,7 @@ void QgsMapRendererParallelJob::cancel()

if ( mStatus == RenderingLabels )
{
disconnect( &mLabelingFutureWatcher, SIGNAL( finished() ), this, SLOT( renderingFinished() ) );
disconnect( &mLabelingFutureWatcher, &QFutureWatcher<void>::finished, this, &QgsMapRendererParallelJob::renderingFinished );

mLabelingFutureWatcher.waitForFinished();

Expand All @@ -117,7 +117,7 @@ void QgsMapRendererParallelJob::waitForFinished()

if ( mStatus == RenderingLayers )
{
disconnect( &mFutureWatcher, SIGNAL( finished() ), this, SLOT( renderLayersFinished() ) );
disconnect( &mFutureWatcher, &QFutureWatcher<void>::finished, this, &QgsMapRendererParallelJob::renderLayersFinished );

QTime t;
t.start();
Expand All @@ -131,7 +131,7 @@ void QgsMapRendererParallelJob::waitForFinished()

if ( mStatus == RenderingLabels )
{
disconnect( &mLabelingFutureWatcher, SIGNAL( finished() ), this, SLOT( renderingFinished() ) );
disconnect( &mLabelingFutureWatcher, &QFutureWatcher<void>::finished, this, &QgsMapRendererParallelJob::renderingFinished );

QTime t;
t.start();
Expand Down Expand Up @@ -184,7 +184,7 @@ void QgsMapRendererParallelJob::renderLayersFinished()
{
mStatus = RenderingLabels;

connect( &mLabelingFutureWatcher, SIGNAL( finished() ), this, SLOT( renderingFinished() ) );
connect( &mLabelingFutureWatcher, &QFutureWatcher<void>::finished, this, &QgsMapRendererParallelJob::renderingFinished );

// now start rendering of labeling!
mLabelingFuture = QtConcurrent::run( renderLabelsStatic, this );
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsmapoverviewcanvas.cpp
Expand Up @@ -227,14 +227,14 @@ void QgsMapOverviewCanvas::setLayers( const QList<QgsMapLayer*>& layers )
{
Q_FOREACH ( QgsMapLayer* ml, mSettings.layers() )
{
disconnect( ml, SIGNAL( repaintRequested() ), this, SLOT( layerRepaintRequested() ) );
disconnect( ml, &QgsMapLayer::repaintRequested, this, &QgsMapOverviewCanvas::layerRepaintRequested );
}

mSettings.setLayers( layers );

Q_FOREACH ( QgsMapLayer* ml, mSettings.layers() )
{
connect( ml, SIGNAL( repaintRequested() ), this, SLOT( layerRepaintRequested() ) );
connect( ml, &QgsMapLayer::repaintRequested, this, &QgsMapOverviewCanvas::layerRepaintRequested );
}

updateFullExtent();
Expand Down

0 comments on commit 2b470d2

Please sign in to comment.