Skip to content
Permalink
Browse files

use QgsDebugMsg

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12427 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Dec 13, 2009
1 parent 59197fc commit 7a0a3fb600d5142366c966face561bf5202f4d7d
@@ -139,7 +139,7 @@ void QgsNewConnection::testConnection()
QgsDataSourceURI uri;
uri.setConnection( txtHost->text(), txtPort->text(), txtDatabase->text(), txtUsername->text(), txtPassword->text(), ( QgsDataSourceURI::SSLmode ) cbxSSLmode->currentIndex() );

QgsLogger::debug( "PQconnectdb(" + uri.connectionInfo() + ");" );
QgsDebugMsg( "PQconnectdb(" + uri.connectionInfo() + ");" );

PGconn *pd = PQconnectdb( uri.connectionInfo().toLocal8Bit().data() );
if ( PQstatus( pd ) == CONNECTION_OK )
@@ -359,7 +359,7 @@ bool QgsMapLayer::isValid()

void QgsMapLayer::invalidTransformInput()
{
QgsLogger::warning( "QgsMapLayer::invalidTransformInput() called" );
QgsDebugMsg( "called" );
// TODO: emit a signal - it will be used to update legend
}

@@ -180,16 +180,10 @@ void QgsMapRenderer::adjustExtentToSize()
dymax = mExtent.yMaximum() + whitespace;
}

#ifdef QGISDEBUG
QString myMessage = "+-------------------MapRenderer--------------------------------+\n";
myMessage += QString( "Map units per pixel (x,y) : %1, %2\n" ).arg( mapUnitsPerPixelX ).arg( mapUnitsPerPixelY );
myMessage += QString( "Pixmap dimensions (x,y) : %1, %2\n" ).arg( myWidth ).arg( myHeight );
myMessage += QString( "Extent dimensions (x,y) : %1, %2\n" ).arg( mExtent.width() ).arg( mExtent.height() );
myMessage += mExtent.toString();
std::cout << myMessage.toLocal8Bit().constData() << std::endl; // OK

#endif

QgsDebugMsg( QString("Map units per pixel (x,y) : %1, %2\n" ).arg( mapUnitsPerPixelX ).arg( mapUnitsPerPixelY ) );
QgsDebugMsg( QString("Pixmap dimensions (x,y) : %1, %2\n" ).arg( myWidth ).arg( myHeight ) );
QgsDebugMsg( QString("Extent dimensions (x,y) : %1, %2\n" ).arg( mExtent.width() ).arg( mExtent.height() ) );
QgsDebugMsg( mExtent.toString() );

// update extent
mExtent.setXMinimum( dxmin );
@@ -200,9 +194,7 @@ void QgsMapRenderer::adjustExtentToSize()
// update the scale
updateScale();

#ifdef QGISDEBUG
QgsLogger::debug( "Scale (assuming meters as map units) = 1", mScale, 1, __FILE__, __FUNCTION__, __LINE__ );
#endif
QgsDebugMsg( QString("Scale (assuming meters as map units) = 1:%1").arg( mScale ) );

newCoordXForm.setParameters( mMapUnitsPerPixel, dxmin, dymin, myHeight );
mRenderContext.setMapToPixel( newCoordXForm );
@@ -221,7 +213,7 @@ void QgsMapRenderer::render( QPainter* painter )

if ( mExtent.isEmpty() )
{
QgsLogger::debug( "empty extent... not rendering" );
QgsDebugMsg( "empty extent... not rendering" );
return;
}

@@ -343,7 +335,7 @@ void QgsMapRenderer::render( QPainter* painter )

if ( !ml )
{
QgsLogger::warning( "Layer not found in registry!" );
QgsDebugMsg( "Layer not found in registry!" );
continue;
}

@@ -472,8 +464,9 @@ void QgsMapRenderer::render( QPainter* painter )
}
else
{
QgsDebugMsg( "\n\n\nLayer rendered without issues\n\n\n" );
QgsDebugMsg( "Layer rendered without issues" );
}

if ( split )
{
mRenderContext.setExtent( r2 );
@@ -708,7 +701,7 @@ bool QgsMapRenderer::splitLayersExtent( QgsMapLayer* layer, QgsRectangle& extent
catch ( QgsCsException &cse )
{
Q_UNUSED( cse );
QgsLogger::warning( "Transform error caught in " + QString( __FILE__ ) + ", line " + QString::number( __LINE__ ) );
QgsDebugMsg( "Transform error caught" );
extent = QgsRectangle( -DBL_MAX, -DBL_MAX, DBL_MAX, DBL_MAX );
r2 = QgsRectangle( -DBL_MAX, -DBL_MAX, DBL_MAX, DBL_MAX );
}
@@ -752,7 +745,7 @@ QgsPoint QgsMapRenderer::layerToMapCoordinates( QgsMapLayer* theLayer, QgsPoint
catch ( QgsCsException &cse )
{
Q_UNUSED( cse );
QgsDebugMsg( QString( "Transform error caught:%s" ).arg( cse.what() ) );
QgsDebugMsg( QString( "Transform error caught: %1" ).arg( cse.what() ) );
}
}
else
@@ -773,7 +766,7 @@ QgsPoint QgsMapRenderer::mapToLayerCoordinates( QgsMapLayer* theLayer, QgsPoint
}
catch ( QgsCsException &cse )
{
QgsDebugMsg( QString( "Transform error caught: %s" ).arg( cse.what() ) );
QgsDebugMsg( QString( "Transform error caught: %1" ).arg( cse.what() ) );
throw cse; //let client classes know there was a transformation error
}
}
@@ -820,7 +813,7 @@ void QgsMapRenderer::updateFullExtent()
QgsMapLayer * lyr = registry->mapLayer( *it );
if ( lyr == NULL )
{
QgsLogger::warning( "WARNING: layer '" + ( *it ) + "' not found in map layer registry!" );
QgsDebugMsg( QString("WARNING: layer '%1' not found in map layer registry!").arg( *it ) );
}
else
{
@@ -376,7 +376,7 @@ QgsGPSData* QgsGPSData::getData( const QString& fileName )
return 0;
}
QgsGPSData* data = new QgsGPSData;
QgsLogger::debug( "Loading file " + fileName );
QgsDebugMsg( "Loading file " + fileName );
QgsGPXHandler handler( *data );
bool failed = false;

@@ -412,7 +412,7 @@ QgsGPSData* QgsGPSData::getData( const QString& fileName )
dataObjects[fileName] = std::pair<QgsGPSData*, unsigned>( data, 0 );
}
else
QgsLogger::debug( fileName + " is already loaded" );
QgsDebugMsg( fileName + " is already loaded" );

// return a pointer and increase the reference count for that file name
DataMap::iterator iter = dataObjects.find( fileName );
@@ -429,10 +429,10 @@ void QgsGPSData::releaseData( const QString& fileName )
DataMap::iterator iter = dataObjects.find( fileName );
if ( iter != dataObjects.end() )
{
QgsLogger::debug( "unrefing " + fileName );
QgsDebugMsg( "unrefing " + fileName );
if ( --( iter->second.second ) == 0 )
{
QgsLogger::debug( "No one's using " + fileName + ", I'll erase it" );
QgsDebugMsg( "No one's using " + fileName + ", I'll erase it" );
delete iter->second.first;
dataObjects.erase( iter );
}
@@ -301,7 +301,7 @@ bool QgsGPXProvider::nextFeature( QgsFeature& feature )
const QgsTrack* trk;
trk = &( *mTrkIter );

QgsLogger::debug( "GPX feature track segments: ", trk->segments.size(), __FILE__, __FUNCTION__, __LINE__ );
QgsDebugMsg( QString("GPX feature track segments: %1").arg( trk->segments.size() ) );
if ( trk->segments.size() == 0 )
continue;

@@ -1325,7 +1325,7 @@ QString createFilters( QString type )
{
// NOP, we don't know anything about the current driver
// with regards to a proper file filter string
QgsLogger::debug( "fileVectorFilters, unknown driver: " + driverName );
QgsDebugMsg( "fileVectorFilters, unknown driver: " + driverName );
}

} // each loaded GDAL driver
@@ -1534,8 +1534,7 @@ QGISEXTERN bool createEmptyDataSource( const QString &uri,
break;
default:
{
QgsLogger::debug( "Unknown vector type of: ", ( int )( vectortype ), 1,
__FILE__, __FUNCTION__, __LINE__ );
QgsDebugMsg( QString("Unknown vector type of: %1").arg( ( int )( vectortype ) ) );
return false;
break;
}

0 comments on commit 7a0a3fb

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