Skip to content
Permalink
Browse files

reduce debug output noise when not debugging

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@10658 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Apr 26, 2009
1 parent 2e0d652 commit 6650c0db07135fe9677743b231db02a0da5b3420
@@ -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] ) );
@@ -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 )
{
@@ -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();
@@ -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() );
@@ -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();
@@ -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;
}

@@ -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() ) );
@@ -63,7 +61,7 @@ QgsContinuousColorDialog::QgsContinuousColorDialog( QgsVectorLayer * layer )
}
else
{
qWarning( "Warning, data provider is null in QgsContinuousColorDialog::QgsContinuousColorDialog(...)" );
QgsDebugMsg( "data provider is null" );
return;
}

@@ -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()
@@ -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
@@ -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;
@@ -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 )
@@ -494,7 +494,7 @@ void QgsDbSourceSelect::setSql( const QModelIndex& index )
{
if ( !index.parent().isValid() )
{
qWarning( "schema item found" );
QgsDebugMsg( "schema item found" );
return;
}

@@ -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 );
@@ -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 )
@@ -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;
}
}
@@ -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;
@@ -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
***************************************************************************/

@@ -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
@@ -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
@@ -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 );

@@ -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;
}

@@ -18,6 +18,7 @@
#include "qgscomposeritem.h"
#include "qgscomposermap.h"
#include "qgspaperitem.h"
#include "qgslogger.h"
#include <QDomDocument>
#include <QDomElement>
#include <QGraphicsRectItem>
@@ -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() );
}

@@ -522,7 +523,7 @@ void QgsComposition::updateZValues()
currentItem = *it;
if ( currentItem )
{
qWarning( "%d", counter );
QgsDebugMsg( QString::number( counter ) );
currentItem->setZValue( counter );
}
++counter;
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
}
}
@@ -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
}
}

0 comments on commit 6650c0d

Please sign in to comment.
You can’t perform that action at this time.