Skip to content
Permalink
Browse files

Silence the lambs

  • Loading branch information
m-kuhn committed Sep 29, 2017
1 parent 8e7db54 commit f981795bec2931df3b234341cc6f10c3162d76b6
Showing with 21 additions and 23 deletions.
  1. +1 −1 src/core/qgsmaprendererjob.cpp
  2. +7 −7 src/core/qgsmaprenderersequentialjob.cpp
  3. +13 −15 src/core/qgsmapsettings.cpp
@@ -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 ) );
@@ -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;
@@ -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,22 +501,20 @@ 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;
fullExtent.setMinimal();

// 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;
}

0 comments on commit f981795

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