Skip to content

Commit dd18891

Browse files
author
jef
committed
reduce debug output noise when not debugging
git-svn-id: http://svn.osgeo.org/qgis/trunk@10658 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 468550c commit dd18891

25 files changed

+123
-215
lines changed

src/app/composer/qgscomposer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ void QgsComposer::on_mActionExportAsImage_activated( void )
604604
}
605605

606606
myOutputFileNameQString = myQFileDialog->selectedFiles().last();
607-
qWarning( "%s", myOutputFileNameQString.toLocal8Bit().constData() );
607+
QgsDebugMsg( myOutputFileNameQString );
608608
QString myFilterString = myQFileDialog->selectedFilter();
609609
QgsDebugMsg( QString( "Selected filter: %1" ).arg( myFilterString ) );
610610
QgsDebugMsg( QString( "Image type: %1" ).arg( myFilterMap[myFilterString] ) );

src/app/legend/qgslegendlayerfilegroup.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "qgslegendlayerfile.h"
2121
#include "qgslegendsymbologygroup.h"
2222
#include "qgsmaplayer.h"
23+
#include "qgslogger.h"
2324

2425
QgsLegendLayerFileGroup::QgsLegendLayerFileGroup( QTreeWidgetItem* theItem, QString theString ): QgsLegendItem( theItem, theString )
2526
{
@@ -41,9 +42,7 @@ QgsLegendItem::DRAG_ACTION QgsLegendLayerFileGroup::accept( LEGEND_ITEM_TYPE typ
4142

4243
QgsLegendItem::DRAG_ACTION QgsLegendLayerFileGroup::accept( const QgsLegendItem* li ) const
4344
{
44-
#ifdef QGISDEBUG
45-
qWarning( "in QgsLegendLayerFileGroup::accept" );
46-
#endif
45+
QgsDebugMsg( "entered." );
4746
if ( li )
4847
{
4948
LEGEND_ITEM_TYPE type = li->type();
@@ -146,9 +145,7 @@ void QgsLegendLayerFileGroup::receive( QgsLegendItem* newChild )
146145

147146
void QgsLegendLayerFileGroup::release( QgsLegendItem* formerChild )
148147
{
149-
#ifdef QGISDEBUG
150-
qWarning( "In QgsLegendLayerFileGroup::release" );
151-
#endif
148+
QgsDebugMsg( "entered." );
152149
if ( formerChild->type() == LEGEND_LAYER_FILE )
153150
{
154151
QgsLegendLayer* ll = dynamic_cast<QgsLegendLayer*>( parent() );

src/app/legend/qgslegendvectorsymbologyitem.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ void QgsLegendVectorSymbologyItem::addSymbol( QgsSymbol* s )
3030

3131
void QgsLegendVectorSymbologyItem::handleDoubleClickEvent()
3232
{
33-
#ifdef QGISDEBUG
34-
qWarning( "in QgsLegendVectorSymbologyItem::handleDoubleClickEvent" );
35-
#endif
3633
//todo: show the dialog
3734
//QgsSiSyDialog d(0);
3835
//std::list<QgsSymbol*>::iterator iter = mSymbols.begin();

src/app/qgisapp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2024,7 +2024,7 @@ static void buildSupportedVectorFileFilter_( QString & fileFilters )
20242024

20252025
if ( !driver )
20262026
{
2027-
qWarning( "unable to get driver %d", i );
2027+
QgsDebugMsg( QString( "unable to get driver %1" ).arg( i ) );
20282028
continue;
20292029
}
20302030

src/app/qgscontinuouscolordialog.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ QgsContinuousColorDialog::QgsContinuousColorDialog( QgsVectorLayer * layer )
3333
: QDialog(), mVectorLayer( layer )
3434
{
3535
setupUi( this );
36-
#ifdef QGISDEBUG
37-
qWarning( "constructor QgsContinuousColorDialog" );
38-
#endif
36+
QgsDebugMsg( "entered." );
3937

4038
QObject::connect( btnMinValue, SIGNAL( clicked() ), this, SLOT( selectMinimumColor() ) );
4139
QObject::connect( btnMaxValue, SIGNAL( clicked() ), this, SLOT( selectMaximumColor() ) );
@@ -63,7 +61,7 @@ QgsContinuousColorDialog::QgsContinuousColorDialog( QgsVectorLayer * layer )
6361
}
6462
else
6563
{
66-
qWarning( "Warning, data provider is null in QgsContinuousColorDialog::QgsContinuousColorDialog(...)" );
64+
QgsDebugMsg( "data provider is null" );
6765
return;
6866
}
6967

@@ -139,16 +137,12 @@ QgsContinuousColorDialog::QgsContinuousColorDialog( QgsVectorLayer * layer )
139137
QgsContinuousColorDialog::QgsContinuousColorDialog()
140138
{
141139
setupUi( this );
142-
#ifdef QGISDEBUG
143-
qWarning( "constructor QgsContinuousColorDialog" );
144-
#endif
140+
QgsDebugMsg( "entered." );
145141
}
146142

147143
QgsContinuousColorDialog::~QgsContinuousColorDialog()
148144
{
149-
#ifdef QGISDEBUG
150-
qWarning( "destructor QgsContinuousColorDialog" );
151-
#endif
145+
QgsDebugMsg( "entered." );
152146
}
153147

154148
void QgsContinuousColorDialog::apply()

src/app/qgscustomprojectiondialog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@ QString QgsCustomProjectionDialog::getProjFromParameters()
987987
myStart = myProjRegExp.indexIn( myProj4String, myStart );
988988
if ( myStart == -1 )
989989
{
990-
qDebug( "proj string supplied has no +proj argument!" );
990+
QgsDebugMsg( "proj string supplied has no +proj argument!" );
991991
return NULL;
992992
}
993993
else
@@ -1000,7 +1000,7 @@ QString QgsCustomProjectionDialog::getProjFromParameters()
10001000

10011001
QString QgsCustomProjectionDialog::getEllipseFromParameters()
10021002
{
1003-
QgsLogger::debug( "QgsCustomProjectionDialog::getEllipseFromParameters()" );
1003+
QgsDebugMsg( "entered." );
10041004
QString myProj4String = leParameters->text();
10051005
QRegExp myEllipseRegExp( "\\+ellps=[a-zA-Z0-9\\-_]*" );
10061006
int myStart = 0;

src/app/qgsdbsourceselect.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ void QgsDbSourceSelect::on_btnConnect_clicked()
447447
}
448448
else
449449
{
450-
qDebug( "Unable to get list of spatially enabled tables from the database\n%s", PQerrorMessage( pd ) );
450+
QgsDebugMsg( QString( "Unable to get list of spatially enabled tables from the database\n%1" ).arg( PQerrorMessage( pd ) ) );
451451
}
452452
// BEGIN CHANGES ECOS
453453
if ( cmbConnections->count() > 0 )
@@ -494,7 +494,7 @@ void QgsDbSourceSelect::setSql( const QModelIndex& index )
494494
{
495495
if ( !index.parent().isValid() )
496496
{
497-
qWarning( "schema item found" );
497+
QgsDebugMsg( "schema item found" );
498498
return;
499499
}
500500

@@ -514,7 +514,7 @@ void QgsDbSourceSelect::setSql( const QModelIndex& index )
514514
QString schemaName = mTableModel.itemFromIndex( mProxyModel.mapToSource( schemaSibling ) )->text();
515515
QString tableName = mTableModel.itemFromIndex( mProxyModel.mapToSource( tableSibling ) )->text();
516516
QString tableString = "\"" + schemaName + "\".\"" + tableName + "\"";
517-
qWarning( "%s", tableString.toUtf8().constData() );
517+
QgsDebugMsg( tableString );
518518

519519
QString currentSql;
520520
QModelIndex sqlSibling = index.sibling( index.row(), 4 );

src/app/qgsgeomtypedialog.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "qgsgeomtypedialog.h"
2020
#include "qgsapplication.h"
2121
#include "qgisapp.h" // <- for theme icons
22+
#include "qgslogger.h"
2223
#include <QPushButton>
2324

2425
QgsGeomTypeDialog::QgsGeomTypeDialog( QWidget *parent, Qt::WFlags fl )
@@ -95,9 +96,7 @@ void QgsGeomTypeDialog::attributes( std::list<std::pair<QString, QString> >& at
9596
{
9697
QTreeWidgetItem *item = *it;
9798
at.push_back( std::make_pair( item->text( 0 ), item->text( 1 ) ) );
98-
#ifdef QGISDEBUG
99-
qWarning( "appending %s//%s", item->text( 0 ).toLocal8Bit().constData(), item->text( 1 ).toLocal8Bit().constData() );
100-
#endif
99+
QgsDebugMsg( QString( "appending %1//%2" ).arg( item->text( 0 ) ).arg( item->text( 1 ) ) );
101100
++it;
102101
}
103102
}

src/app/qgsmaptooladdfeature.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,20 +180,20 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
180180
bool isDisabledAttributeValuesDlg = settings.value( "/qgis/digitizing/disable_enter_attribute_values_dialog", false ).toBool();
181181
if ( isDisabledAttributeValuesDlg )
182182
{
183-
qDebug( "Adding feature to layer" );
183+
QgsDebugMsg( "Adding feature to layer" );
184184
vlayer->addFeature( *f );
185185
}
186186
else
187187
{
188188
QgsAttributeDialog * mypDialog = new QgsAttributeDialog( vlayer, f );
189189
if ( mypDialog->exec() )
190190
{
191-
qDebug( "Adding feature to layer" );
191+
QgsDebugMsg( "Adding feature to layer" );
192192
vlayer->addFeature( *f );
193193
}
194194
else
195195
{
196-
qDebug( "Adding feature to layer failed" );
196+
QgsDebugMsg( "Adding feature to layer failed" );
197197
delete f;
198198
}
199199
delete mypDialog;

src/app/qgsspatialitesourceselect.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Dialog to select SpatiaLite layer(s) and add it to the map canvas
44
-------------------
55
begin : Dec 2008
6-
copyright : (C) 2008 bySandro Furieri
6+
copyright : (C) 2008 by Sandro Furieri
77
email : a.furieri@lqt.it
88
***************************************************************************/
99

@@ -217,7 +217,7 @@ sqlite3 *QgsSpatiaLiteSourceSelect::openSpatiaLiteDb( const char *path )
217217
}
218218
}
219219
sqlite3_free_table( results );
220-
if ( tableName == true && geomColumn == true && type == true && coordDims == true && gcSrid == true && spatialIndex == true )
220+
if ( tableName && geomColumn && type && coordDims && gcSrid && spatialIndex )
221221
gcSpatiaLite = true;
222222

223223
// checking if table SPATIAL_REF_SYS exists and has the expected layout
@@ -244,11 +244,11 @@ sqlite3 *QgsSpatiaLiteSourceSelect::openSpatiaLiteDb( const char *path )
244244
}
245245
}
246246
sqlite3_free_table( results );
247-
if ( srsSrid == true && authName == true && authSrid == true && refSysName == true && proj4text == true )
247+
if ( srsSrid && authName && authSrid && refSysName && proj4text )
248248
rsSpatiaLite = true;
249249

250250
// OK, this one seems to be a valid SpatiaLite DB
251-
if ( gcSpatiaLite == true && rsSpatiaLite == true )
251+
if ( gcSpatiaLite && rsSpatiaLite )
252252
return handle;
253253

254254
// this one cannot be a valid SpatiaLite DB - no Spatial MetaData where found
@@ -487,12 +487,9 @@ void QgsSpatiaLiteSourceSelect::on_btnConnect_clicked()
487487
// get the list of suitable tables and columns and populate the UI
488488
geomCol details;
489489

490-
if ( getTableInfo( handle ) == true )
491-
;
492-
else
490+
if ( !getTableInfo( handle ) )
493491
{
494-
qDebug( "Unable to get list of spatially enabled tables from the database" );
495-
qDebug( "%s", sqlite3_errmsg( handle ) );
492+
QgsDebugMsg( QString( "Unable to get list of spatially enabled tables from the database\n%1" ).arg( sqlite3_errmsg( handle ) ) );
496493
}
497494
closeSpatiaLiteDb( handle );
498495

src/app/qgsuniquevaluedialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ QgsUniqueValueDialog::QgsUniqueValueDialog( QgsVectorLayer* vl ): QDialog(), mVe
4747
}
4848
else
4949
{
50-
qWarning( "Warning, data provider is null in QgsUniqueValueDialog::QgsUniqueValueDialog" );
50+
QgsDebugMsg( "data provider is null" );
5151
return;
5252
}
5353

src/core/composer/qgscomposition.cpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "qgscomposeritem.h"
1919
#include "qgscomposermap.h"
2020
#include "qgspaperitem.h"
21+
#include "qgslogger.h"
2122
#include <QDomDocument>
2223
#include <QDomElement>
2324
#include <QGraphicsRectItem>
@@ -239,7 +240,7 @@ void QgsComposition::addItemToZList( QgsComposerItem* item )
239240
return;
240241
}
241242
mItemZList.push_back( item );
242-
qWarning( "%d", mItemZList.size() );
243+
QgsDebugMsg( QString::number( mItemZList.size() ) );
243244
item->setZValue( mItemZList.size() );
244245
}
245246

@@ -522,7 +523,7 @@ void QgsComposition::updateZValues()
522523
currentItem = *it;
523524
if ( currentItem )
524525
{
525-
qWarning( "%d", counter );
526+
QgsDebugMsg( QString::number( counter ) );
526527
currentItem->setZValue( counter );
527528
}
528529
++counter;
@@ -531,13 +532,15 @@ void QgsComposition::updateZValues()
531532

532533
void QgsComposition::sortZList()
533534
{
535+
#ifdef QGISDEBUG
534536
//debug: list before sorting
535-
qWarning( "before sorting" );
537+
QgsDebugMsg( "before sorting" );
536538
QLinkedList<QgsComposerItem*>::iterator before_it = mItemZList.begin();
537539
for ( ; before_it != mItemZList.end(); ++before_it )
538540
{
539-
qWarning( "%lf", ( *before_it )->zValue() );
541+
QgsDebugMsg( QString( "%1" ).arg(( *before_it )->zValue() ) );
540542
}
543+
#endif
541544

542545
QMutableLinkedListIterator<QgsComposerItem*> it( mItemZList );
543546
int previousZ, afterZ; //z values of items before and after
@@ -584,14 +587,16 @@ void QgsComposition::sortZList()
584587
}
585588
}
586589

590+
#ifdef QGISDEBUG
587591
//debug: list after sorting
588592
//debug: list before sorting
589-
qWarning( "after sorting" );
593+
QgsDebugMsg( "after sorting" );
590594
QLinkedList<QgsComposerItem*>::iterator after_it = mItemZList.begin();
591595
for ( ; after_it != mItemZList.end(); ++after_it )
592596
{
593-
qWarning( "%lf", ( *after_it )->zValue() );
597+
QgsDebugMsg( QString( "%1" ).arg(( *after_it )->zValue() ) );
594598
}
599+
#endif
595600
}
596601

597602
QPointF QgsComposition::snapPointToGrid( const QPointF& scenePoint ) const

src/core/qgsmaprenderer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ QgsRectangle QgsMapRenderer::layerExtentToOutputExtent( QgsMapLayer* theLayer, Q
614614
}
615615
catch ( QgsCsException &cse )
616616
{
617-
qDebug( "Transform error caught in %s line %d:\n%s", __FILE__, __LINE__, cse.what() );
617+
QgsDebugMsg( QString( "Transform error caught: " ).arg( cse.what() ) );
618618
}
619619
}
620620
else
@@ -636,7 +636,7 @@ QgsPoint QgsMapRenderer::layerToMapCoordinates( QgsMapLayer* theLayer, QgsPoint
636636
}
637637
catch ( QgsCsException &cse )
638638
{
639-
qDebug( "Transform error caught in %s line %d:\n%s", __FILE__, __LINE__, cse.what() );
639+
QgsDebugMsg( QString( "Transform error caught:%s" ).arg( cse.what() ) );
640640
}
641641
}
642642
else
@@ -657,7 +657,7 @@ QgsPoint QgsMapRenderer::mapToLayerCoordinates( QgsMapLayer* theLayer, QgsPoint
657657
}
658658
catch ( QgsCsException &cse )
659659
{
660-
qDebug( "Transform error caught in %s line %d:\n%s", __FILE__, __LINE__, cse.what() );
660+
QgsDebugMsg( QString( "Transform error caught: %s" ).arg( cse.what() ) );
661661
throw cse; //let client classes know there was a transformation error
662662
}
663663
}
@@ -679,7 +679,7 @@ QgsRectangle QgsMapRenderer::mapToLayerCoordinates( QgsMapLayer* theLayer, QgsRe
679679
}
680680
catch ( QgsCsException &cse )
681681
{
682-
qDebug( "Transform error caught in %s line %d:\n%s", __FILE__, __LINE__, cse.what() );
682+
QgsDebugMsg( QString( "Transform error caught: %1" ).arg( cse.what() ) );
683683
throw cse; //let client classes know there was a transformation error
684684
}
685685
}

0 commit comments

Comments
 (0)