[QGIS Commit] r12508 - in trunk/qgis/src: core core/pal plugins/labeling

svn_qgis at osgeo.org svn_qgis at osgeo.org
Fri Dec 18 14:14:58 EST 2009


Author: wonder
Date: 2009-12-18 14:14:57 -0500 (Fri, 18 Dec 2009)
New Revision: 12508

Modified:
   trunk/qgis/src/core/pal/pal.cpp
   trunk/qgis/src/core/qgsgeometry.cpp
   trunk/qgis/src/plugins/labeling/pallabeling.cpp
Log:
Less verbosity to stdout from labeling plugin


Modified: trunk/qgis/src/core/pal/pal.cpp
===================================================================
--- trunk/qgis/src/core/pal/pal.cpp	2009-12-18 16:04:00 UTC (rev 12507)
+++ trunk/qgis/src/core/pal/pal.cpp	2009-12-18 19:14:57 UTC (rev 12508)
@@ -493,7 +493,9 @@
 
     Feats *feat;
 
-    std::cout << "FIRSST NBFT : " << prob->nbft << std::endl;
+#ifdef _VERBOSE_
+    std::cout << "FIRST NBFT : " << prob->nbft << std::endl;
+#endif
 
     // Filtering label positions against obstacles
     amin[0] = amin[1] = -DBL_MAX;

Modified: trunk/qgis/src/core/qgsgeometry.cpp
===================================================================
--- trunk/qgis/src/core/qgsgeometry.cpp	2009-12-18 16:04:00 UTC (rev 12507)
+++ trunk/qgis/src/core/qgsgeometry.cpp	2009-12-18 19:14:57 UTC (rev 12508)
@@ -4117,7 +4117,7 @@
         hasZValue = true;
       case QGis::WKBLineString:
       {
-        QgsDebugMsg( "Linestring found" );
+        QgsDebugMsgLevel( "Linestring found", 3 );
 
         QgsPolyline sequence;
 
@@ -4181,7 +4181,7 @@
         hasZValue = true;
       case QGis::WKBPolygon:
       {
-        QgsDebugMsg( "Polygon found" );
+        QgsDebugMsgLevel( "Polygon found", 3 );
 
         // get number of rings in the polygon
         numRings = ( int * )( mGeometry + 1 + sizeof( int ) );
@@ -4223,7 +4223,7 @@
         hasZValue = true;
       case QGis::WKBMultiPolygon:
       {
-        QgsDebugMsg( "Multipolygon found" );
+        QgsDebugMsgLevel( "Multipolygon found", 3 );
 
         QVector<GEOSGeometry*> polygons;
 

Modified: trunk/qgis/src/plugins/labeling/pallabeling.cpp
===================================================================
--- trunk/qgis/src/plugins/labeling/pallabeling.cpp	2009-12-18 16:04:00 UTC (rev 12507)
+++ trunk/qgis/src/plugins/labeling/pallabeling.cpp	2009-12-18 19:14:57 UTC (rev 12508)
@@ -21,6 +21,7 @@
 #include <QTime>
 #include <QPainter>
 
+#include <qgslogger.h>
 #include <qgsvectorlayer.h>
 #include <qgsmaplayerregistry.h>
 #include <qgsvectordataprovider.h>
@@ -240,7 +241,7 @@
   }
   catch ( std::exception* e )
   {
-    std::cerr << "Ignoring feature " << f.id() << " due PAL exception: " << e->what() << std::endl;
+    QgsDebugMsg( QString( "Ignoring feature %1 due PAL exception: " ).arg( f.id() ) + QString::fromLatin1( e->what() ) );
     return;
   }
 
@@ -431,7 +432,7 @@
   }
   catch ( std::exception& e )
   {
-    std::cerr << "PAL EXCEPTION :-( " << e.what() << std::endl;
+    QgsDebugMsg( "PAL EXCEPTION :-( " + QString::fromLatin1( e.what() ) );
     mActiveLayers.clear(); // clean up
     return;
   }
@@ -460,7 +461,7 @@
   // find the solution
   labels = mPal->solveProblem( problem, mShowingAllLabels );
 
-  std::cout << "LABELING work:   " << t.elapsed() << "ms  ... labels# " << labels->size() << std::endl;
+  QgsDebugMsg( QString( "LABELING work:  %1 ms ... labels# %2" ).arg( t.elapsed() ).arg( labels->size() ) );
   t.restart();
 
   painter->setRenderHint( QPainter::Antialiasing );
@@ -477,7 +478,7 @@
     drawLabel( *it, painter, xform );
   }
 
-  std::cout << "LABELING draw:   " << t.elapsed() << "ms" << std::endl;
+  QgsDebugMsg( QString( "LABELING draw:  %1 ms" ).arg( t.elapsed() ) );
 
   delete problem;
   delete labels;



More information about the QGIS-commit mailing list