Skip to content

Commit 54824b7

Browse files
author
wonder
committed
Less verbosity to stdout from labeling plugin
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12508 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 9b8a836 commit 54824b7

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

src/core/pal/pal.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,9 @@ namespace pal
493493

494494
Feats *feat;
495495

496-
std::cout << "FIRSST NBFT : " << prob->nbft << std::endl;
496+
#ifdef _VERBOSE_
497+
std::cout << "FIRST NBFT : " << prob->nbft << std::endl;
498+
#endif
497499

498500
// Filtering label positions against obstacles
499501
amin[0] = amin[1] = -DBL_MAX;

src/core/qgsgeometry.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -4117,7 +4117,7 @@ bool QgsGeometry::exportWkbToGeos()
41174117
hasZValue = true;
41184118
case QGis::WKBLineString:
41194119
{
4120-
QgsDebugMsg( "Linestring found" );
4120+
QgsDebugMsgLevel( "Linestring found", 3 );
41214121

41224122
QgsPolyline sequence;
41234123

@@ -4181,7 +4181,7 @@ bool QgsGeometry::exportWkbToGeos()
41814181
hasZValue = true;
41824182
case QGis::WKBPolygon:
41834183
{
4184-
QgsDebugMsg( "Polygon found" );
4184+
QgsDebugMsgLevel( "Polygon found", 3 );
41854185

41864186
// get number of rings in the polygon
41874187
numRings = ( int * )( mGeometry + 1 + sizeof( int ) );
@@ -4223,7 +4223,7 @@ bool QgsGeometry::exportWkbToGeos()
42234223
hasZValue = true;
42244224
case QGis::WKBMultiPolygon:
42254225
{
4226-
QgsDebugMsg( "Multipolygon found" );
4226+
QgsDebugMsgLevel( "Multipolygon found", 3 );
42274227

42284228
QVector<GEOSGeometry*> polygons;
42294229

src/plugins/labeling/pallabeling.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <QTime>
2222
#include <QPainter>
2323

24+
#include <qgslogger.h>
2425
#include <qgsvectorlayer.h>
2526
#include <qgsmaplayerregistry.h>
2627
#include <qgsvectordataprovider.h>
@@ -240,7 +241,7 @@ void LayerSettings::registerFeature( QgsFeature& f )
240241
}
241242
catch ( std::exception* e )
242243
{
243-
std::cerr << "Ignoring feature " << f.id() << " due PAL exception: " << e->what() << std::endl;
244+
QgsDebugMsg( QString( "Ignoring feature %1 due PAL exception: " ).arg( f.id() ) + QString::fromLatin1( e->what() ) );
244245
return;
245246
}
246247

@@ -431,7 +432,7 @@ void PalLabeling::drawLabeling( QgsRenderContext& context )
431432
}
432433
catch ( std::exception& e )
433434
{
434-
std::cerr << "PAL EXCEPTION :-( " << e.what() << std::endl;
435+
QgsDebugMsg( "PAL EXCEPTION :-( " + QString::fromLatin1( e.what() ) );
435436
mActiveLayers.clear(); // clean up
436437
return;
437438
}
@@ -460,7 +461,7 @@ void PalLabeling::drawLabeling( QgsRenderContext& context )
460461
// find the solution
461462
labels = mPal->solveProblem( problem, mShowingAllLabels );
462463

463-
std::cout << "LABELING work: " << t.elapsed() << "ms ... labels# " << labels->size() << std::endl;
464+
QgsDebugMsg( QString( "LABELING work: %1 ms ... labels# %2" ).arg( t.elapsed() ).arg( labels->size() ) );
464465
t.restart();
465466

466467
painter->setRenderHint( QPainter::Antialiasing );
@@ -477,7 +478,7 @@ void PalLabeling::drawLabeling( QgsRenderContext& context )
477478
drawLabel( *it, painter, xform );
478479
}
479480

480-
std::cout << "LABELING draw: " << t.elapsed() << "ms" << std::endl;
481+
QgsDebugMsg( QString( "LABELING draw: %1 ms" ).arg( t.elapsed() ) );
481482

482483
delete problem;
483484
delete labels;

0 commit comments

Comments
 (0)