Skip to content
Permalink
Browse files

Flip some connects to new style

  • Loading branch information
nyalldawson committed Jan 31, 2017
1 parent b52b577 commit 2b470d21ef72c93277fbb939be0a70f37a2694de
@@ -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();
@@ -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 );
}
}

@@ -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 );
}
}
@@ -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 );
@@ -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 )
@@ -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();
@@ -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 );
}

@@ -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 );
@@ -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();

@@ -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();

@@ -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();
@@ -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();
@@ -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 );
@@ -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();

0 comments on commit 2b470d2

Please sign in to comment.
You can’t perform that action at this time.