Silence of the lambs

This commit is contained in:
Matthias Kuhn 2017-09-29 14:13:51 +02:00
parent e3de218c07
commit 44ce819ca2
No known key found for this signature in database
GPG Key ID: A0E766808764D73F
3 changed files with 21 additions and 23 deletions

View File

@ -219,7 +219,7 @@ LayerRenderJobs QgsMapRendererJob::prepareJobs( QPainter *painter, QgsLabelingEn
{
bool cacheValid = mCache->init( mSettings.visibleExtent(), mSettings.scale() );
Q_UNUSED( cacheValid );
QgsDebugMsg( QString( "CACHE VALID: %1" ).arg( cacheValid ) );
QgsDebugMsgLevel( QString( "CACHE VALID: %1" ).arg( cacheValid ), 4 );
}
bool requiresLabelRedraw = !( mCache && mCache->hasCacheImage( LABEL_CACHE_ID ) );

View File

@ -23,7 +23,7 @@ QgsMapRendererSequentialJob::QgsMapRendererSequentialJob( const QgsMapSettings &
: QgsMapRendererQImageJob( settings )
{
QgsDebugMsg( "SEQUENTIAL construct" );
QgsDebugMsgLevel( "SEQUENTIAL construct", 5 );
mImage = QImage( mSettings.outputSize(), mSettings.outputImageFormat() );
mImage.setDotsPerMeterX( 1000 * settings.outputDpi() / 25.4 );
@ -33,11 +33,11 @@ QgsMapRendererSequentialJob::QgsMapRendererSequentialJob( const QgsMapSettings &
QgsMapRendererSequentialJob::~QgsMapRendererSequentialJob()
{
QgsDebugMsg( "SEQUENTIAL destruct" );
QgsDebugMsgLevel( "SEQUENTIAL destruct", 5 );
if ( isActive() )
{
// still running!
QgsDebugMsg( "SEQUENTIAL destruct -- still running! (canceling)" );
QgsDebugMsgLevel( "SEQUENTIAL destruct -- still running! (canceling)", 5 );
cancel();
}
@ -56,7 +56,7 @@ void QgsMapRendererSequentialJob::start()
mErrors.clear();
QgsDebugMsg( "SEQUENTIAL START" );
QgsDebugMsgLevel( "SEQUENTIAL START", 5 );
Q_ASSERT( !mInternalJob && !mPainter );
@ -76,7 +76,7 @@ void QgsMapRendererSequentialJob::cancel()
if ( !isActive() )
return;
QgsDebugMsg( "sequential - cancel internal" );
QgsDebugMsgLevel( "sequential - cancel internal", 5 );
mInternalJob->cancel();
Q_ASSERT( !mInternalJob && !mPainter );
@ -87,7 +87,7 @@ void QgsMapRendererSequentialJob::cancelWithoutBlocking()
if ( !isActive() )
return;
QgsDebugMsg( "sequential - cancel internal" );
QgsDebugMsgLevel( "sequential - cancel internal", 5 );
mInternalJob->cancelWithoutBlocking();
}
@ -127,7 +127,7 @@ QImage QgsMapRendererSequentialJob::renderedImage()
void QgsMapRendererSequentialJob::internalFinished()
{
QgsDebugMsg( "SEQUENTIAL finished" );
QgsDebugMsgLevel( "SEQUENTIAL finished", 5 );
mPainter->end();
delete mPainter;

View File

@ -206,14 +206,14 @@ void QgsMapSettings::updateDerived()
}
#endif
QgsDebugMsg( QString( "Map units per pixel (x,y) : %1, %2" ).arg( qgsDoubleToString( mapUnitsPerPixelX ), qgsDoubleToString( mapUnitsPerPixelY ) ) );
QgsDebugMsg( QString( "Pixmap dimensions (x,y) : %1, %2" ).arg( qgsDoubleToString( mSize.width() ), qgsDoubleToString( mSize.height() ) ) );
QgsDebugMsg( QString( "Extent dimensions (x,y) : %1, %2" ).arg( qgsDoubleToString( mExtent.width() ), qgsDoubleToString( mExtent.height() ) ) );
QgsDebugMsg( mExtent.toString() );
QgsDebugMsg( QString( "Adjusted map units per pixel (x,y) : %1, %2" ).arg( qgsDoubleToString( mVisibleExtent.width() / myWidth ), qgsDoubleToString( mVisibleExtent.height() / myHeight ) ) );
QgsDebugMsg( QString( "Recalced pixmap dimensions (x,y) : %1, %2" ).arg( qgsDoubleToString( mVisibleExtent.width() / mMapUnitsPerPixel ), qgsDoubleToString( mVisibleExtent.height() / mMapUnitsPerPixel ) ) );
QgsDebugMsg( QString( "Scale (assuming meters as map units) = 1:%1" ).arg( qgsDoubleToString( mScale ) ) );
QgsDebugMsg( QString( "Rotation: %1 degrees" ).arg( mRotation ) );
QgsDebugMsgLevel( QString( "Map units per pixel (x,y) : %1, %2" ).arg( qgsDoubleToString( mapUnitsPerPixelX ), qgsDoubleToString( mapUnitsPerPixelY ) ), 5 );
QgsDebugMsgLevel( QString( "Pixmap dimensions (x,y) : %1, %2" ).arg( qgsDoubleToString( mSize.width() ), qgsDoubleToString( mSize.height() ) ), 5 );
QgsDebugMsgLevel( QString( "Extent dimensions (x,y) : %1, %2" ).arg( qgsDoubleToString( mExtent.width() ), qgsDoubleToString( mExtent.height() ) ), 5 );
QgsDebugMsgLevel( mExtent.toString(), 5 );
QgsDebugMsgLevel( QString( "Adjusted map units per pixel (x,y) : %1, %2" ).arg( qgsDoubleToString( mVisibleExtent.width() / myWidth ), qgsDoubleToString( mVisibleExtent.height() / myHeight ) ), 5 );
QgsDebugMsgLevel( QString( "Recalced pixmap dimensions (x,y) : %1, %2" ).arg( qgsDoubleToString( mVisibleExtent.width() / mMapUnitsPerPixel ), qgsDoubleToString( mVisibleExtent.height() / mMapUnitsPerPixel ) ), 5 );
QgsDebugMsgLevel( QString( "Scale (assuming meters as map units) = 1:%1" ).arg( qgsDoubleToString( mScale ) ), 5 );
QgsDebugMsgLevel( QString( "Rotation: %1 degrees" ).arg( mRotation ), 5 );
mValid = true;
}
@ -501,8 +501,6 @@ QgsRectangle QgsMapSettings::mapToLayerCoordinates( const QgsMapLayer *layer, Qg
QgsRectangle QgsMapSettings::fullExtent() const
{
QgsDebugMsg( "called." );
// reset the map canvas extent since the extent may now be smaller
// We can't use a constructor since QgsRectangle normalizes the rectangle upon construction
QgsRectangle fullExtent;
@ -510,13 +508,13 @@ QgsRectangle QgsMapSettings::fullExtent() const
// iterate through the map layers and test each layers extent
// against the current min and max values
QgsDebugMsg( QString( "Layer count: %1" ).arg( mLayers.count() ) );
QgsDebugMsgLevel( QString( "Layer count: %1" ).arg( mLayers.count() ), 5 );
Q_FOREACH ( const QgsWeakMapLayerPointer &layerPtr, mLayers )
{
if ( QgsMapLayer *lyr = layerPtr.data() )
{
QgsDebugMsg( "Updating extent using " + lyr->name() );
QgsDebugMsg( "Input extent: " + lyr->extent().toString() );
QgsDebugMsgLevel( "Updating extent using " + lyr->name(), 5 );
QgsDebugMsgLevel( "Input extent: " + lyr->extent().toString(), 5 );
if ( lyr->extent().isNull() )
continue;
@ -525,7 +523,7 @@ QgsRectangle QgsMapSettings::fullExtent() const
// layer. The extent must be projected to the canvas CS
QgsRectangle extent = layerExtentToOutputExtent( lyr, lyr->extent() );
QgsDebugMsg( "Output extent: " + extent.toString() );
QgsDebugMsgLevel( "Output extent: " + extent.toString(), 5 );
fullExtent.combineExtentWith( extent );
}
}
@ -554,7 +552,7 @@ QgsRectangle QgsMapSettings::fullExtent() const
}
}
QgsDebugMsg( "Full extent: " + fullExtent.toString() );
QgsDebugMsgLevel( "Full extent: " + fullExtent.toString(), 5 );
return fullExtent;
}