Skip to content

Commit

Permalink
reduce debug output noise when not debugging
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@10658 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Apr 26, 2009
1 parent 2e0d652 commit 6650c0d
Show file tree
Hide file tree
Showing 25 changed files with 123 additions and 215 deletions.
2 changes: 1 addition & 1 deletion src/app/composer/qgscomposer.cpp
Expand Up @@ -604,7 +604,7 @@ void QgsComposer::on_mActionExportAsImage_activated( void )
}

myOutputFileNameQString = myQFileDialog->selectedFiles().last();
qWarning( "%s", myOutputFileNameQString.toLocal8Bit().constData() );
QgsDebugMsg( myOutputFileNameQString );
QString myFilterString = myQFileDialog->selectedFilter();
QgsDebugMsg( QString( "Selected filter: %1" ).arg( myFilterString ) );
QgsDebugMsg( QString( "Image type: %1" ).arg( myFilterMap[myFilterString] ) );
Expand Down
9 changes: 3 additions & 6 deletions src/app/legend/qgslegendlayerfilegroup.cpp
Expand Up @@ -20,6 +20,7 @@
#include "qgslegendlayerfile.h"
#include "qgslegendsymbologygroup.h"
#include "qgsmaplayer.h"
#include "qgslogger.h"

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

QgsLegendItem::DRAG_ACTION QgsLegendLayerFileGroup::accept( const QgsLegendItem* li ) const
{
#ifdef QGISDEBUG
qWarning( "in QgsLegendLayerFileGroup::accept" );
#endif
QgsDebugMsg( "entered." );
if ( li )
{
LEGEND_ITEM_TYPE type = li->type();
Expand Down Expand Up @@ -146,9 +145,7 @@ void QgsLegendLayerFileGroup::receive( QgsLegendItem* newChild )

void QgsLegendLayerFileGroup::release( QgsLegendItem* formerChild )
{
#ifdef QGISDEBUG
qWarning( "In QgsLegendLayerFileGroup::release" );
#endif
QgsDebugMsg( "entered." );
if ( formerChild->type() == LEGEND_LAYER_FILE )
{
QgsLegendLayer* ll = dynamic_cast<QgsLegendLayer*>( parent() );
Expand Down
3 changes: 0 additions & 3 deletions src/app/legend/qgslegendvectorsymbologyitem.cpp
Expand Up @@ -30,9 +30,6 @@ void QgsLegendVectorSymbologyItem::addSymbol( QgsSymbol* s )

void QgsLegendVectorSymbologyItem::handleDoubleClickEvent()
{
#ifdef QGISDEBUG
qWarning( "in QgsLegendVectorSymbologyItem::handleDoubleClickEvent" );
#endif
//todo: show the dialog
//QgsSiSyDialog d(0);
//std::list<QgsSymbol*>::iterator iter = mSymbols.begin();
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgisapp.cpp
Expand Up @@ -2024,7 +2024,7 @@ static void buildSupportedVectorFileFilter_( QString & fileFilters )

if ( !driver )
{
qWarning( "unable to get driver %d", i );
QgsDebugMsg( QString( "unable to get driver %1" ).arg( i ) );
continue;
}

Expand Down
14 changes: 4 additions & 10 deletions src/app/qgscontinuouscolordialog.cpp
Expand Up @@ -33,9 +33,7 @@ QgsContinuousColorDialog::QgsContinuousColorDialog( QgsVectorLayer * layer )
: QDialog(), mVectorLayer( layer )
{
setupUi( this );
#ifdef QGISDEBUG
qWarning( "constructor QgsContinuousColorDialog" );
#endif
QgsDebugMsg( "entered." );

QObject::connect( btnMinValue, SIGNAL( clicked() ), this, SLOT( selectMinimumColor() ) );
QObject::connect( btnMaxValue, SIGNAL( clicked() ), this, SLOT( selectMaximumColor() ) );
Expand Down Expand Up @@ -63,7 +61,7 @@ QgsContinuousColorDialog::QgsContinuousColorDialog( QgsVectorLayer * layer )
}
else
{
qWarning( "Warning, data provider is null in QgsContinuousColorDialog::QgsContinuousColorDialog(...)" );
QgsDebugMsg( "data provider is null" );
return;
}

Expand Down Expand Up @@ -139,16 +137,12 @@ QgsContinuousColorDialog::QgsContinuousColorDialog( QgsVectorLayer * layer )
QgsContinuousColorDialog::QgsContinuousColorDialog()
{
setupUi( this );
#ifdef QGISDEBUG
qWarning( "constructor QgsContinuousColorDialog" );
#endif
QgsDebugMsg( "entered." );
}

QgsContinuousColorDialog::~QgsContinuousColorDialog()
{
#ifdef QGISDEBUG
qWarning( "destructor QgsContinuousColorDialog" );
#endif
QgsDebugMsg( "entered." );
}

void QgsContinuousColorDialog::apply()
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgscustomprojectiondialog.cpp
Expand Up @@ -987,7 +987,7 @@ QString QgsCustomProjectionDialog::getProjFromParameters()
myStart = myProjRegExp.indexIn( myProj4String, myStart );
if ( myStart == -1 )
{
qDebug( "proj string supplied has no +proj argument!" );
QgsDebugMsg( "proj string supplied has no +proj argument!" );
return NULL;
}
else
Expand All @@ -1000,7 +1000,7 @@ QString QgsCustomProjectionDialog::getProjFromParameters()

QString QgsCustomProjectionDialog::getEllipseFromParameters()
{
QgsLogger::debug( "QgsCustomProjectionDialog::getEllipseFromParameters()" );
QgsDebugMsg( "entered." );
QString myProj4String = leParameters->text();
QRegExp myEllipseRegExp( "\\+ellps=[a-zA-Z0-9\\-_]*" );
int myStart = 0;
Expand Down
6 changes: 3 additions & 3 deletions src/app/qgsdbsourceselect.cpp
Expand Up @@ -447,7 +447,7 @@ void QgsDbSourceSelect::on_btnConnect_clicked()
}
else
{
qDebug( "Unable to get list of spatially enabled tables from the database\n%s", PQerrorMessage( pd ) );
QgsDebugMsg( QString( "Unable to get list of spatially enabled tables from the database\n%1" ).arg( PQerrorMessage( pd ) ) );
}
// BEGIN CHANGES ECOS
if ( cmbConnections->count() > 0 )
Expand Down Expand Up @@ -494,7 +494,7 @@ void QgsDbSourceSelect::setSql( const QModelIndex& index )
{
if ( !index.parent().isValid() )
{
qWarning( "schema item found" );
QgsDebugMsg( "schema item found" );
return;
}

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

QString currentSql;
QModelIndex sqlSibling = index.sibling( index.row(), 4 );
Expand Down
5 changes: 2 additions & 3 deletions src/app/qgsgeomtypedialog.cpp
Expand Up @@ -19,6 +19,7 @@
#include "qgsgeomtypedialog.h"
#include "qgsapplication.h"
#include "qgisapp.h" // <- for theme icons
#include "qgslogger.h"
#include <QPushButton>

QgsGeomTypeDialog::QgsGeomTypeDialog( QWidget *parent, Qt::WFlags fl )
Expand Down Expand Up @@ -95,9 +96,7 @@ void QgsGeomTypeDialog::attributes( std::list<std::pair<QString, QString> >& at
{
QTreeWidgetItem *item = *it;
at.push_back( std::make_pair( item->text( 0 ), item->text( 1 ) ) );
#ifdef QGISDEBUG
qWarning( "appending %s//%s", item->text( 0 ).toLocal8Bit().constData(), item->text( 1 ).toLocal8Bit().constData() );
#endif
QgsDebugMsg( QString( "appending %1//%2" ).arg( item->text( 0 ) ).arg( item->text( 1 ) ) );
++it;
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/app/qgsmaptooladdfeature.cpp
Expand Up @@ -180,20 +180,20 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
bool isDisabledAttributeValuesDlg = settings.value( "/qgis/digitizing/disable_enter_attribute_values_dialog", false ).toBool();
if ( isDisabledAttributeValuesDlg )
{
qDebug( "Adding feature to layer" );
QgsDebugMsg( "Adding feature to layer" );
vlayer->addFeature( *f );
}
else
{
QgsAttributeDialog * mypDialog = new QgsAttributeDialog( vlayer, f );
if ( mypDialog->exec() )
{
qDebug( "Adding feature to layer" );
QgsDebugMsg( "Adding feature to layer" );
vlayer->addFeature( *f );
}
else
{
qDebug( "Adding feature to layer failed" );
QgsDebugMsg( "Adding feature to layer failed" );
delete f;
}
delete mypDialog;
Expand Down
15 changes: 6 additions & 9 deletions src/app/qgsspatialitesourceselect.cpp
Expand Up @@ -3,7 +3,7 @@
Dialog to select SpatiaLite layer(s) and add it to the map canvas
-------------------
begin : Dec 2008
copyright : (C) 2008 bySandro Furieri
copyright : (C) 2008 by Sandro Furieri
email : a.furieri@lqt.it
***************************************************************************/

Expand Down Expand Up @@ -217,7 +217,7 @@ sqlite3 *QgsSpatiaLiteSourceSelect::openSpatiaLiteDb( const char *path )
}
}
sqlite3_free_table( results );
if ( tableName == true && geomColumn == true && type == true && coordDims == true && gcSrid == true && spatialIndex == true )
if ( tableName && geomColumn && type && coordDims && gcSrid && spatialIndex )
gcSpatiaLite = true;

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

// OK, this one seems to be a valid SpatiaLite DB
if ( gcSpatiaLite == true && rsSpatiaLite == true )
if ( gcSpatiaLite && rsSpatiaLite )
return handle;

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

if ( getTableInfo( handle ) == true )
;
else
if ( !getTableInfo( handle ) )
{
qDebug( "Unable to get list of spatially enabled tables from the database" );
qDebug( "%s", sqlite3_errmsg( handle ) );
QgsDebugMsg( QString( "Unable to get list of spatially enabled tables from the database\n%1" ).arg( sqlite3_errmsg( handle ) ) );
}
closeSpatiaLiteDb( handle );

Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsuniquevaluedialog.cpp
Expand Up @@ -47,7 +47,7 @@ QgsUniqueValueDialog::QgsUniqueValueDialog( QgsVectorLayer* vl ): QDialog(), mVe
}
else
{
qWarning( "Warning, data provider is null in QgsUniqueValueDialog::QgsUniqueValueDialog" );
QgsDebugMsg( "data provider is null" );
return;
}

Expand Down
17 changes: 11 additions & 6 deletions src/core/composer/qgscomposition.cpp
Expand Up @@ -18,6 +18,7 @@
#include "qgscomposeritem.h"
#include "qgscomposermap.h"
#include "qgspaperitem.h"
#include "qgslogger.h"
#include <QDomDocument>
#include <QDomElement>
#include <QGraphicsRectItem>
Expand Down Expand Up @@ -239,7 +240,7 @@ void QgsComposition::addItemToZList( QgsComposerItem* item )
return;
}
mItemZList.push_back( item );
qWarning( "%d", mItemZList.size() );
QgsDebugMsg( QString::number( mItemZList.size() ) );
item->setZValue( mItemZList.size() );
}

Expand Down Expand Up @@ -522,7 +523,7 @@ void QgsComposition::updateZValues()
currentItem = *it;
if ( currentItem )
{
qWarning( "%d", counter );
QgsDebugMsg( QString::number( counter ) );
currentItem->setZValue( counter );
}
++counter;
Expand All @@ -531,13 +532,15 @@ void QgsComposition::updateZValues()

void QgsComposition::sortZList()
{
#ifdef QGISDEBUG
//debug: list before sorting
qWarning( "before sorting" );
QgsDebugMsg( "before sorting" );
QLinkedList<QgsComposerItem*>::iterator before_it = mItemZList.begin();
for ( ; before_it != mItemZList.end(); ++before_it )
{
qWarning( "%lf", ( *before_it )->zValue() );
QgsDebugMsg( QString( "%1" ).arg(( *before_it )->zValue() ) );
}
#endif

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

#ifdef QGISDEBUG
//debug: list after sorting
//debug: list before sorting
qWarning( "after sorting" );
QgsDebugMsg( "after sorting" );
QLinkedList<QgsComposerItem*>::iterator after_it = mItemZList.begin();
for ( ; after_it != mItemZList.end(); ++after_it )
{
qWarning( "%lf", ( *after_it )->zValue() );
QgsDebugMsg( QString( "%1" ).arg(( *after_it )->zValue() ) );
}
#endif
}

QPointF QgsComposition::snapPointToGrid( const QPointF& scenePoint ) const
Expand Down
8 changes: 4 additions & 4 deletions src/core/qgsmaprenderer.cpp
Expand Up @@ -614,7 +614,7 @@ QgsRectangle QgsMapRenderer::layerExtentToOutputExtent( QgsMapLayer* theLayer, Q
}
catch ( QgsCsException &cse )
{
qDebug( "Transform error caught in %s line %d:\n%s", __FILE__, __LINE__, cse.what() );
QgsDebugMsg( QString( "Transform error caught: " ).arg( cse.what() ) );
}
}
else
Expand All @@ -636,7 +636,7 @@ QgsPoint QgsMapRenderer::layerToMapCoordinates( QgsMapLayer* theLayer, QgsPoint
}
catch ( QgsCsException &cse )
{
qDebug( "Transform error caught in %s line %d:\n%s", __FILE__, __LINE__, cse.what() );
QgsDebugMsg( QString( "Transform error caught:%s" ).arg( cse.what() ) );
}
}
else
Expand All @@ -657,7 +657,7 @@ QgsPoint QgsMapRenderer::mapToLayerCoordinates( QgsMapLayer* theLayer, QgsPoint
}
catch ( QgsCsException &cse )
{
qDebug( "Transform error caught in %s line %d:\n%s", __FILE__, __LINE__, cse.what() );
QgsDebugMsg( QString( "Transform error caught: %s" ).arg( cse.what() ) );
throw cse; //let client classes know there was a transformation error
}
}
Expand All @@ -679,7 +679,7 @@ QgsRectangle QgsMapRenderer::mapToLayerCoordinates( QgsMapLayer* theLayer, QgsRe
}
catch ( QgsCsException &cse )
{
qDebug( "Transform error caught in %s line %d:\n%s", __FILE__, __LINE__, cse.what() );
QgsDebugMsg( QString( "Transform error caught: %1" ).arg( cse.what() ) );
throw cse; //let client classes know there was a transformation error
}
}
Expand Down

0 comments on commit 6650c0d

Please sign in to comment.