Skip to content
Permalink
Browse files

reduce debugging noise

  • Loading branch information
jef-n committed Oct 27, 2011
1 parent 63949b5 commit 306efcb23bc5923a2cdd03a9d22a6ffc0572c3ee
Showing with 14 additions and 11 deletions.
  1. +1 −1 src/core/qgsscalecalculator.cpp
  2. +13 −10 src/providers/postgres/qgspostgresprovider.cpp
@@ -45,7 +45,7 @@ void QgsScaleCalculator::setMapUnits( QGis::UnitType mapUnits )

QGis::UnitType QgsScaleCalculator::mapUnits() const
{
QgsDebugMsgLevel( QString( "Map units returned as %1" ).arg( QString::number( mMapUnits ) ), 3 );
QgsDebugMsgLevel( QString( "Map units returned as %1" ).arg( QString::number( mMapUnits ) ), 4 );
return mMapUnits;
}

@@ -186,12 +186,13 @@ QgsVectorLayerImport::ImportError QgsPostgresProvider::createEmptyLayer(
if ( primaryKeyType.isEmpty() )
{
primaryKeyType = "serial";
/* TODO
// check the feature count to choose if create a serial8 pk field
#if 0
// TODO: check the feature count to choose if create a serial8 pk field
if ( layer->featureCount() > 0xFFFFFF )
{
primaryKeyType = "serial8";
}*/
}
#endif
}

try
@@ -1153,13 +1154,15 @@ qint64 QgsPostgresProvider::getBinaryInt( PGresult *queryResult, int row, int co
char *p = PQgetvalue( queryResult, row, col );
size_t s = PQgetlength( queryResult, row, col );

#ifdef QGISDEBUG
QString buf = "";
for ( size_t i = 0; i < s; i++ )
{
buf += QString( "%1 " ).arg( *( unsigned char * )( p + i ), 0, 16, QLatin1Char( ' ' ) );
}

QgsDebugMsgLevel( QString( "int in hex:%1" ).arg( buf ), 3 );
QgsDebugMsgLevel( QString( "int in hex:%1" ).arg( buf ), 4 );
#endif

switch ( s )
{
@@ -1191,18 +1194,18 @@ qint64 QgsPostgresProvider::getBinaryInt( PGresult *queryResult, int row, int co

if ( swapEndian )
{
QgsDebugMsg( QString( "swap oid0:%1 oid1:%2" ).arg( oid0 ).arg( oid1 ) );
QgsDebugMsgLevel( QString( "swap oid0:%1 oid1:%2" ).arg( oid0 ).arg( oid1 ), 4 );
oid0 = ntohl( oid0 );
oid1 = ntohl( oid1 );
}

QgsDebugMsg( QString( "oid0:%1 oid1:%2" ).arg( oid0 ).arg( oid1 ) );
QgsDebugMsgLevel( QString( "oid0:%1 oid1:%2" ).arg( oid0 ).arg( oid1 ), 4 );
oid = oid0;
QgsDebugMsg( QString( "oid:%1" ).arg( oid ) );
QgsDebugMsgLevel( QString( "oid:%1" ).arg( oid ), 4 );
oid <<= 32;
QgsDebugMsg( QString( "oid:%1" ).arg( oid ) );
QgsDebugMsgLevel( QString( "oid:%1" ).arg( oid ), 4 );
oid |= oid1;
QgsDebugMsg( QString( "oid:%1" ).arg( oid ) );
QgsDebugMsgLevel( QString( "oid:%1" ).arg( oid ), 4 );
}
break;

@@ -1226,7 +1229,7 @@ bool QgsPostgresProvider::getFeature( PGresult *queryResult, int row, bool fetch
try
{
QgsFeatureId oid = getBinaryInt( queryResult, row, 0 );
QgsDebugMsgLevel( QString( "oid=%1" ).arg( oid ), 3 );
QgsDebugMsgLevel( QString( "oid=%1" ).arg( oid ), 4 );

feature.setFeatureId( oid );
feature.clearAttributeMap();

0 comments on commit 306efcb

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