Skip to content

Commit

Permalink
Silence the lambs
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Sep 29, 2017
1 parent 8e7db54 commit f981795
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/core/qgsmaprendererjob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) );
Expand Down
14 changes: 7 additions & 7 deletions src/core/qgsmaprenderersequentialjob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand All @@ -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();
}

Expand All @@ -56,7 +56,7 @@ void QgsMapRendererSequentialJob::start()

mErrors.clear();

QgsDebugMsg( "SEQUENTIAL START" );
QgsDebugMsgLevel( "SEQUENTIAL START", 5 );

Q_ASSERT( !mInternalJob && !mPainter );

Expand All @@ -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 );
Expand All @@ -87,7 +87,7 @@ void QgsMapRendererSequentialJob::cancelWithoutBlocking()
if ( !isActive() )
return;

QgsDebugMsg( "sequential - cancel internal" );
QgsDebugMsgLevel( "sequential - cancel internal", 5 );
mInternalJob->cancelWithoutBlocking();
}

Expand Down Expand Up @@ -127,7 +127,7 @@ QImage QgsMapRendererSequentialJob::renderedImage()

void QgsMapRendererSequentialJob::internalFinished()
{
QgsDebugMsg( "SEQUENTIAL finished" );
QgsDebugMsgLevel( "SEQUENTIAL finished", 5 );

mPainter->end();
delete mPainter;
Expand Down
28 changes: 13 additions & 15 deletions src/core/qgsmapsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand All @@ -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 );
}
}
Expand Down Expand Up @@ -554,7 +552,7 @@ QgsRectangle QgsMapSettings::fullExtent() const
}
}

QgsDebugMsg( "Full extent: " + fullExtent.toString() );
QgsDebugMsgLevel( "Full extent: " + fullExtent.toString(), 5 );
return fullExtent;
}

Expand Down

0 comments on commit f981795

Please sign in to comment.