Index: src/core/qgscoordinatetransform.cpp =================================================================== --- src/core/qgscoordinatetransform.cpp (revision 12612) +++ src/core/qgscoordinatetransform.cpp (working copy) @@ -22,7 +22,6 @@ //qt includes #include #include -#include #include #include "qgslogger.h" @@ -227,7 +226,7 @@ catch ( QgsCsException &cse ) { // rethrow the exception - QgsLogger::warning( "Throwing exception " + QString( __FILE__ ) + QString::number( __LINE__ ) ); + QgsDebugMsg( "rethrowing exception" ); throw cse; } @@ -244,7 +243,7 @@ catch ( QgsCsException &cse ) { // rethrow the exception - QgsLogger::warning( "Throwing exception " + QString( __FILE__ ) + QString::number( __LINE__ ) ); + QgsDebugMsg( "rethrowing exception" ); throw cse; } } @@ -270,7 +269,7 @@ catch ( QgsCsException &cse ) { // rethrow the exception - QgsLogger::warning( "Throwing exception " + QString( __FILE__ ) + QString::number( __LINE__ ) ); + QgsDebugMsg( "rethrowing exception" ); throw cse; } @@ -304,7 +303,7 @@ catch ( QgsCsException &cse ) { // rethrow the exception - QgsLogger::warning( "Throwing exception " + QString( __FILE__ ) + QString::number( __LINE__ ) ); + QgsDebugMsg( "rethrowing exception" ); throw cse; } } @@ -330,7 +329,7 @@ catch ( QgsCsException &cse ) { // rethrow the exception - QgsLogger::warning( "Throwing exception " + QString( __FILE__ ) + QString::number( __LINE__ ) ); + QgsDebugMsg( "rethrowing exception" ); throw cse; } } @@ -394,7 +393,7 @@ catch ( QgsCsException &cse ) { // rethrow the exception - QgsLogger::warning( "Throwing exception " + QString( __FILE__ ) + QString::number( __LINE__ ) ); + QgsDebugMsg( "rethrowing exception" ); throw cse; } @@ -454,42 +453,44 @@ if ( direction == ReverseTransform ) { projResult = pj_transform( mDestinationProjection, mSourceProjection, numPoints, 0, x, y, z ); - dir = "inverse"; + dir = tr( "inverse" ); } else { assert( mSourceProjection != 0 ); assert( mDestinationProjection != 0 ); projResult = pj_transform( mSourceProjection, mDestinationProjection, numPoints, 0, x, y, z ); - dir = "forward"; + dir = tr( "forward" ); } if ( projResult != 0 ) { //something bad happened.... - QString msg; - QTextStream pjErr( &msg ); + QString points; - pjErr << tr( "Failed" ) << " " << dir << " " << tr( "transform of" ) << '\n'; for ( int i = 0; i < numPoints; ++i ) { if ( direction == ForwardTransform ) { - pjErr << "(" << x[i] << ", " << y[i] << ")\n"; + points += QString("(%1, %2)\n").arg( x[i] ).arg( y[i] ); } else { - pjErr << "(" << x[i] * RAD_TO_DEG << ", " << y[i] * RAD_TO_DEG << ")\n"; + points += QString("(%1, %2)\n").arg( x[i]*RAD_TO_DEG ).arg( y[i]*RAD_TO_DEG ); } } - pjErr << tr( "with error: " ) << QString::fromUtf8( pj_strerrno( projResult ) ) << '\n'; + QString msg = tr("%1 transform of\n%2\nfailed with error: %3\n") + .arg( dir ) + .arg( points ) + .arg( QString::fromUtf8( pj_strerrno( projResult ) ) ) ); - QgsDebugMsg( "Projection failed emitting invalid transform signal: " + QString( msg.toLocal8Bit().data() ) ); + QgsDebugMsg( "Projection failed emitting invalid transform signal: " + msg ); emit invalidTransformInput(); - QgsLogger::warning( "Throwing exception " + QString( __FILE__ ) + QString::number( __LINE__ ) ); + QgsDebugMsg( "throwing exception" ); + throw QgsCsException( msg ); }