Skip to content

Commit cbf5e9c

Browse files
committedApr 19, 2017
Silence some annoyingly debug chatty classes
1 parent 1962c54 commit cbf5e9c

14 files changed

+86
-88
lines changed
 

‎src/app/qgsprojectproperties.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -738,13 +738,13 @@ void QgsProjectProperties::apply()
738738
QgsProject::instance()->setCrs( srs );
739739
if ( srs.isValid() )
740740
{
741-
QgsDebugMsg( QString( "Selected CRS " ) + srs.description() );
741+
QgsDebugMsgLevel( QString( "Selected CRS " ) + srs.description(), 4 );
742742
// write the currently selected projections _proj string_ to project settings
743-
QgsDebugMsg( QString( "SpatialRefSys/ProjectCRSProj4String: %1" ).arg( srs.toProj4() ) );
743+
QgsDebugMsgLevel( QString( "SpatialRefSys/ProjectCRSProj4String: %1" ).arg( srs.toProj4() ), 4 );
744744
}
745745
else
746746
{
747-
QgsDebugMsg( QString( "CRS set to no projection!" ) );
747+
QgsDebugMsgLevel( QString( "CRS set to no projection!" ), 4 );
748748
}
749749

750750
// mark selected projection for push to front
@@ -799,7 +799,7 @@ void QgsProjectProperties::apply()
799799
// If the user fields have changed, use them instead.
800800
if ( leSemiMajor->isModified() || leSemiMinor->isModified() )
801801
{
802-
QgsDebugMsg( "Using parameteric major/minor" );
802+
QgsDebugMsgLevel( "Using parameteric major/minor", 4 );
803803
major = QLocale::system().toDouble( leSemiMajor->text() );
804804
minor = QLocale::system().toDouble( leSemiMinor->text() );
805805
}
@@ -1856,7 +1856,7 @@ void QgsProjectProperties::updateEllipsoidUI( int newIndex )
18561856
// changing ellipsoid, save the modified coordinates
18571857
if ( leSemiMajor->isModified() || leSemiMinor->isModified() )
18581858
{
1859-
QgsDebugMsg( "Saving major/minor" );
1859+
QgsDebugMsgLevel( "Saving major/minor", 4 );
18601860
mEllipsoidList[ mEllipsoidIndex ].semiMajor = QLocale::system().toDouble( leSemiMajor->text() );
18611861
mEllipsoidList[ mEllipsoidIndex ].semiMinor = QLocale::system().toDouble( leSemiMinor->text() );
18621862
}
@@ -1891,7 +1891,7 @@ void QgsProjectProperties::updateEllipsoidUI( int newIndex )
18911891

18921892
void QgsProjectProperties::projectionSelectorInitialized()
18931893
{
1894-
QgsDebugMsg( "Setting up ellipsoid" );
1894+
QgsDebugMsgLevel( "Setting up ellipsoid", 4 );
18951895

18961896
// Reading ellipsoid from settings
18971897
QStringList mySplitEllipsoid = QgsProject::instance()->ellipsoid().split( ':' );

‎src/core/layertree/qgslayertreemodel.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ void QgsLayerTreeModel::setLayerTreeNodeFont( int nodeType, const QFont &font )
575575
}
576576
else
577577
{
578-
QgsDebugMsg( "invalid node type" );
578+
QgsDebugMsgLevel( "invalid node type", 4 );
579579
}
580580
}
581581

@@ -588,7 +588,7 @@ QFont QgsLayerTreeModel::layerTreeNodeFont( int nodeType ) const
588588
return mFontLayer;
589589
else
590590
{
591-
QgsDebugMsg( "invalid node type" );
591+
QgsDebugMsgLevel( "invalid node type", 4 );
592592
return QFont();
593593
}
594594
}
@@ -1509,8 +1509,6 @@ void QgsLayerTreeModel::legendInvalidateMapBasedData()
15091509

15101510
void QgsLayerTreeModel::invalidateLegendMapBasedData()
15111511
{
1512-
QgsDebugCall;
1513-
15141512
// we have varying icon sizes, and we want icon to be centered and
15151513
// text to be left aligned, so we have to compute the max width of icons
15161514
//

‎src/core/layertree/qgslayertreeregistrybridge.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ void QgsLayerTreeRegistryBridge::layersAdded( const QList<QgsMapLayer *> &layers
7474

7575
void QgsLayerTreeRegistryBridge::layersWillBeRemoved( const QStringList &layerIds )
7676
{
77-
QgsDebugMsg( QString( "%1 layers will be removed, enabled:%2" ).arg( layerIds.count() ).arg( mEnabled ) );
77+
QgsDebugMsgLevel( QString( "%1 layers will be removed, enabled:%2" ).arg( layerIds.count() ).arg( mEnabled ), 4 );
7878

7979
if ( !mEnabled )
8080
return;
@@ -136,7 +136,7 @@ void QgsLayerTreeRegistryBridge::groupRemovedChildren()
136136
toRemove << layerId;
137137
mLayerIdsForRemoval.clear();
138138

139-
QgsDebugMsg( QString( "%1 layers will be removed" ).arg( toRemove.count() ) );
139+
QgsDebugMsgLevel( QString( "%1 layers will be removed" ).arg( toRemove.count() ), 4 );
140140

141141
// delay the removal of layers from the registry. There may be other slots connected to map layer registry's signals
142142
// that might disrupt the execution flow - e.g. a processEvents() call may force update of layer tree view with

‎src/core/qgsbrowsermodel.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,14 @@ void QgsBrowserModel::addRootItems()
132132
int capabilities = pr->capabilities();
133133
if ( capabilities == QgsDataProvider::NoDataCapabilities )
134134
{
135-
QgsDebugMsg( pr->name() + " does not have any dataCapabilities" );
135+
QgsDebugMsgLevel( pr->name() + " does not have any dataCapabilities", 4 );
136136
continue;
137137
}
138138

139139
QgsDataItem *item = pr->createDataItem( QLatin1String( "" ), nullptr ); // empty path -> top level
140140
if ( item )
141141
{
142-
QgsDebugMsg( "Add new top level item : " + item->name() );
142+
QgsDebugMsgLevel( "Add new top level item : " + item->name(), 4 );
143143
connectItem( item );
144144
providerMap.insertMulti( capabilities, item );
145145
}
@@ -298,7 +298,7 @@ QModelIndex QgsBrowserModel::findPath( QAbstractItemModel *model, const QString
298298
QString itemPath = model->data( idx, PathRole ).toString();
299299
if ( itemPath == path )
300300
{
301-
QgsDebugMsg( "Arrived " + itemPath );
301+
QgsDebugMsgLevel( "Arrived " + itemPath, 4 );
302302
return idx; // we have found the item we have been looking for
303303
}
304304

@@ -315,7 +315,7 @@ QModelIndex QgsBrowserModel::findPath( QAbstractItemModel *model, const QString
315315
if ( matchFlag == Qt::MatchStartsWith )
316316
return index;
317317

318-
QgsDebugMsg( "path not found" );
318+
QgsDebugMsgLevel( "path not found", 4 );
319319
return QModelIndex(); // not found
320320
}
321321

@@ -408,7 +408,7 @@ void QgsBrowserModel::itemStateChanged( QgsDataItem *item, QgsDataItem::State ol
408408
QModelIndex idx = findItem( item );
409409
if ( !idx.isValid() )
410410
return;
411-
QgsDebugMsg( QString( "item %1 state changed %2 -> %3" ).arg( item->path() ).arg( oldState ).arg( item->state() ) );
411+
QgsDebugMsgLevel( QString( "item %1 state changed %2 -> %3" ).arg( item->path() ).arg( oldState ).arg( item->state() ), 4 );
412412
emit stateChanged( idx, oldState );
413413
}
414414
void QgsBrowserModel::connectItem( QgsDataItem *item )
@@ -470,7 +470,7 @@ bool QgsBrowserModel::dropMimeData( const QMimeData *data, Qt::DropAction action
470470
QgsDataItem *destItem = dataItem( parent );
471471
if ( !destItem )
472472
{
473-
QgsDebugMsg( "DROP PROBLEM!" );
473+
QgsDebugMsgLevel( "DROP PROBLEM!", 4 );
474474
return false;
475475
}
476476

@@ -500,7 +500,7 @@ void QgsBrowserModel::fetchMore( const QModelIndex &parent )
500500
if ( !item || item->state() == QgsDataItem::Populating || item->state() == QgsDataItem::Populated )
501501
return;
502502

503-
QgsDebugMsg( "path = " + item->path() );
503+
QgsDebugMsgLevel( "path = " + item->path(), 4 );
504504

505505
item->populate();
506506
}
@@ -519,7 +519,7 @@ void QgsBrowserModel::refresh( const QModelIndex &index )
519519
if ( !item || item->state() == QgsDataItem::Populating )
520520
return;
521521

522-
QgsDebugMsg( "Refresh " + item->path() );
522+
QgsDebugMsgLevel( "Refresh " + item->path(), 4 );
523523

524524
item->refresh();
525525
}

‎src/core/qgscoordinatereferencesystem.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,11 @@ void QgsCoordinateReferenceSystem::setupESRIWktFix()
305305
if ( strcmp( configNew, CPLGetConfigOption( "GDAL_FIX_ESRI_WKT", "" ) ) != 0 )
306306
QgsLogger::warning( QStringLiteral( "GDAL_FIX_ESRI_WKT could not be set to %1 : %2" )
307307
.arg( configNew, CPLGetConfigOption( "GDAL_FIX_ESRI_WKT", "" ) ) );
308-
QgsDebugMsg( QString( "set GDAL_FIX_ESRI_WKT : %1" ).arg( configNew ) );
308+
QgsDebugMsgLevel( QString( "set GDAL_FIX_ESRI_WKT : %1" ).arg( configNew ), 4 );
309309
}
310310
else
311311
{
312-
QgsDebugMsg( QString( "GDAL_FIX_ESRI_WKT was already set : %1" ).arg( configNew ) );
312+
QgsDebugMsgLevel( QString( "GDAL_FIX_ESRI_WKT was already set : %1" ).arg( configNew ), 4 );
313313
}
314314
}
315315

@@ -537,7 +537,7 @@ bool QgsCoordinateReferenceSystem::loadFromDatabase( const QString &db, const QS
537537
}
538538
else
539539
{
540-
QgsDebugMsg( "failed : " + mySql );
540+
QgsDebugMsgLevel( "failed : " + mySql, 4 );
541541
}
542542
sqlite3_finalize( myPreparedStatement );
543543
sqlite3_close( myDatabase );
@@ -592,7 +592,7 @@ bool QgsCoordinateReferenceSystem::createFromWkt( const QString &wkt )
592592

593593
if ( wkt.isEmpty() )
594594
{
595-
QgsDebugMsg( "theWkt is uninitialized, operation failed" );
595+
QgsDebugMsgLevel( "theWkt is uninitialized, operation failed", 4 );
596596
return d->mIsValid;
597597
}
598598
QByteArray ba = wkt.toLatin1();
@@ -770,7 +770,7 @@ bool QgsCoordinateReferenceSystem::createFromProj4( const QString &proj4String )
770770
myStart2 = 0;
771771
myStart2 = myLat2RegExp.indexIn( proj4String, myStart2 );
772772
proj4StringModified.replace( myStart2 + LAT_PREFIX_LEN, myLength2 - LAT_PREFIX_LEN, lat1Str );
773-
QgsDebugMsg( "trying proj4string match with swapped lat_1,lat_2" );
773+
QgsDebugMsgLevel( "trying proj4string match with swapped lat_1,lat_2", 4 );
774774
myRecord = getRecord( "select * from tbl_srs where parameters=" + quotedValue( proj4StringModified.trimmed() ) + " order by deprecated" );
775775
}
776776
}
@@ -862,7 +862,7 @@ bool QgsCoordinateReferenceSystem::createFromProj4( const QString &proj4String )
862862
// if we failed to look up the projection in database, don't worry. we can still use it :)
863863
if ( !d->mIsValid )
864864
{
865-
QgsDebugMsg( "Projection is not found in databases." );
865+
QgsDebugMsgLevel( "Projection is not found in databases.", 4 );
866866
//setProj4String will set mIsValidFlag to true if there is no issue
867867
setProj4String( myProj4String );
868868
}
@@ -916,13 +916,13 @@ QgsCoordinateReferenceSystem::RecordMap QgsCoordinateReferenceSystem::getRecord(
916916
}
917917
if ( sqlite3_step( myPreparedStatement ) != SQLITE_DONE )
918918
{
919-
QgsDebugMsg( "Multiple records found in srs.db" );
919+
QgsDebugMsgLevel( "Multiple records found in srs.db", 4 );
920920
myMap.clear();
921921
}
922922
}
923923
else
924924
{
925-
QgsDebugMsg( "failed : " + sql );
925+
QgsDebugMsgLevel( "failed : " + sql, 4 );
926926
}
927927

928928
if ( myMap.empty() )
@@ -961,13 +961,13 @@ QgsCoordinateReferenceSystem::RecordMap QgsCoordinateReferenceSystem::getRecord(
961961

962962
if ( sqlite3_step( myPreparedStatement ) != SQLITE_DONE )
963963
{
964-
QgsDebugMsg( "Multiple records found in srs.db" );
964+
QgsDebugMsgLevel( "Multiple records found in srs.db", 4 );
965965
myMap.clear();
966966
}
967967
}
968968
else
969969
{
970-
QgsDebugMsg( "failed : " + sql );
970+
QgsDebugMsgLevel( "failed : " + sql, 4 );
971971
}
972972
}
973973
sqlite3_finalize( myPreparedStatement );
@@ -1099,7 +1099,7 @@ void QgsCoordinateReferenceSystem::setProj4String( const QString &proj4String )
10991099
projPJ proj = pj_init_plus( proj4String.trimmed().toLatin1().constData() );
11001100
if ( !proj )
11011101
{
1102-
QgsDebugMsg( "proj.4 string rejected by pj_init_plus()" );
1102+
QgsDebugMsgLevel( "proj.4 string rejected by pj_init_plus()", 4 );
11031103
d->mIsValid = false;
11041104
}
11051105
else
@@ -1190,9 +1190,9 @@ long QgsCoordinateReferenceSystem::findMatchingProj()
11901190
if ( d->mEllipsoidAcronym.isNull() || d->mProjectionAcronym.isNull()
11911191
|| !d->mIsValid )
11921192
{
1193-
QgsDebugMsg( "QgsCoordinateReferenceSystem::findMatchingProj will only "
1194-
"work if prj acr ellipsoid acr and proj4string are set"
1195-
" and the current projection is valid!" );
1193+
QgsDebugMsgLevel( "QgsCoordinateReferenceSystem::findMatchingProj will only "
1194+
"work if prj acr ellipsoid acr and proj4string are set"
1195+
" and the current projection is valid!", 4 );
11961196
return 0;
11971197
}
11981198

@@ -1593,7 +1593,7 @@ bool QgsCoordinateReferenceSystem::saveAsUserCrs( const QString &name )
15931593
{
15941594
if ( !d->mIsValid )
15951595
{
1596-
QgsDebugMsg( "Can't save an invalid CRS!" );
1596+
QgsDebugMsgLevel( "Can't save an invalid CRS!", 4 );
15971597
return false;
15981598
}
15991599

@@ -1933,7 +1933,7 @@ int QgsCoordinateReferenceSystem::syncDatabase()
19331933
QRegExp projRegExp( "\\+proj=(\\S+)" );
19341934
if ( projRegExp.indexIn( proj4 ) < 0 )
19351935
{
1936-
QgsDebugMsg( QString( "EPSG %1: no +proj argument found [%2]" ).arg( it.key() ).arg( proj4 ) );
1936+
QgsDebugMsgLevel( QString( "EPSG %1: no +proj argument found [%2]" ).arg( it.key() ).arg( proj4 ), 4 );
19371937
continue;
19381938
}
19391939

@@ -2053,7 +2053,7 @@ int QgsCoordinateReferenceSystem::syncDatabase()
20532053
}
20542054
else
20552055
{
2056-
QgsDebugMsg( QString( "could not retrieve proj string for %1 from PROJ" ).arg( input ) );
2056+
QgsDebugMsgLevel( QString( "could not retrieve proj string for %1 from PROJ" ).arg( input ), 4 );
20572057
}
20582058
}
20592059
else

‎src/core/qgscoordinatetransform_p.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class QgsCoordinateTransformPrivate : public QSharedData
109109
{
110110
// Pass through with no projection since we have no idea what the layer
111111
// coordinates are and projecting them may not be appropriate
112-
QgsDebugMsg( "Source CRS is invalid!" );
112+
QgsDebugMsgLevel( "Source CRS is invalid!", 4 );
113113
return false;
114114
}
115115

@@ -118,7 +118,7 @@ class QgsCoordinateTransformPrivate : public QSharedData
118118
//No destination projection is set so we set the default output projection to
119119
//be the same as input proj.
120120
mDestCRS = mSourceCRS;
121-
QgsDebugMsg( "Destination CRS is invalid!" );
121+
QgsDebugMsgLevel( "Destination CRS is invalid!", 4 );
122122
return false;
123123
}
124124

‎src/core/qgsdistancearea.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -768,10 +768,10 @@ double QgsDistanceArea::convertLengthMeasurement( double length, QgsUnitTypes::D
768768
double factorUnits = QgsUnitTypes::fromUnitToUnitFactor( measureUnits, toUnits );
769769

770770
double result = length * factorUnits;
771-
QgsDebugMsg( QString( "Converted length of %1 %2 to %3 %4" ).arg( length )
772-
.arg( QgsUnitTypes::toString( measureUnits ) )
773-
.arg( result )
774-
.arg( QgsUnitTypes::toString( toUnits ) ) );
771+
QgsDebugMsgLevel( QString( "Converted length of %1 %2 to %3 %4" ).arg( length )
772+
.arg( QgsUnitTypes::toString( measureUnits ) )
773+
.arg( result )
774+
.arg( QgsUnitTypes::toString( toUnits ) ), 3 );
775775
return result;
776776
}
777777

@@ -782,9 +782,9 @@ double QgsDistanceArea::convertAreaMeasurement( double area, QgsUnitTypes::AreaU
782782
double factorUnits = QgsUnitTypes::fromUnitToUnitFactor( measureUnits, toUnits );
783783

784784
double result = area * factorUnits;
785-
QgsDebugMsg( QString( "Converted area of %1 %2 to %3 %4" ).arg( area )
786-
.arg( QgsUnitTypes::toString( measureUnits ) )
787-
.arg( result )
788-
.arg( QgsUnitTypes::toString( toUnits ) ) );
785+
QgsDebugMsgLevel( QString( "Converted area of %1 %2 to %3 %4" ).arg( area )
786+
.arg( QgsUnitTypes::toString( measureUnits ) )
787+
.arg( result )
788+
.arg( QgsUnitTypes::toString( toUnits ) ), 3 );
789789
return result;
790790
}

‎src/core/qgsellipsoidutils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ QgsEllipsoidUtils::EllipsoidParameters QgsEllipsoidUtils::ellipsoidParameters( c
151151
return params;
152152
}
153153

154-
QgsDebugMsg( QString( "setEllipsoid: a=%1, b=%2, 1/f=%3" ).arg( params.semiMajor ).arg( params.semiMinor ).arg( params.inverseFlattening ) );
154+
QgsDebugMsgLevel( QString( "setEllipsoid: a=%1, b=%2, 1/f=%3" ).arg( params.semiMajor ).arg( params.semiMinor ).arg( params.inverseFlattening ), 4 );
155155

156156

157157
// get spatial ref system for ellipsoid

‎src/core/qgsproject.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ bool QgsProject::_getMapLayers( const QDomDocument &doc, QList<QDomNode> &broken
679679
bool QgsProject::addLayer( const QDomElement &layerElem, QList<QDomNode> &brokenNodes )
680680
{
681681
QString type = layerElem.attribute( QStringLiteral( "type" ) );
682-
QgsDebugMsg( "Layer type is " + type );
682+
QgsDebugMsgLevel( "Layer type is " + type, 4 );
683683
QgsMapLayer *mapLayer = nullptr;
684684

685685
if ( type == QLatin1String( "vector" ) )

‎src/core/qgsscalecalculator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ double QgsScaleCalculator::calculate( const QgsRectangle &mapExtent, int canvasW
8383
return 0;
8484
}
8585
double scale = ( delta * conversionFactor ) / ( static_cast< double >( canvasWidth ) / mDpi );
86-
QgsDebugMsg( QString( "scale = %1 conversionFactor = %2" ).arg( scale ).arg( conversionFactor ) );
86+
QgsDebugMsgLevel( QString( "scale = %1 conversionFactor = %2" ).arg( scale ).arg( conversionFactor ), 4 );
8787
return scale;
8888
}
8989

@@ -126,7 +126,7 @@ double QgsScaleCalculator::calculateGeographicDistance( const QgsRectangle &mapE
126126
pow( 1.0 - E * E * sin( lat * RADS ) * sin( lat * RADS ), 1.5 );
127127
double meters = ( mapExtent.xMaximum() - mapExtent.xMinimum() ) / 180.0 * radius * c;
128128

129-
QgsDebugMsg( "Distance across map extent (m): " + QString::number( meters ) );
129+
QgsDebugMsgLevel( "Distance across map extent (m): " + QString::number( meters ), 4 );
130130

131131
return meters;
132132
}

‎src/gui/qgsadvanceddigitizingdockwidget.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -593,11 +593,11 @@ bool QgsAdvancedDigitizingDockWidget::applyConstraints( QgsMapMouseEvent *e )
593593
{
594594
bool res = true;
595595

596-
QgsDebugMsg( "Constraints (locked / relative / value" );
597-
QgsDebugMsg( QString( "Angle: %1 %2 %3" ).arg( mAngleConstraint->isLocked() ).arg( mAngleConstraint->relative() ).arg( mAngleConstraint->value() ) );
598-
QgsDebugMsg( QString( "Distance: %1 %2 %3" ).arg( mDistanceConstraint->isLocked() ).arg( mDistanceConstraint->relative() ).arg( mDistanceConstraint->value() ) );
599-
QgsDebugMsg( QString( "X: %1 %2 %3" ).arg( mXConstraint->isLocked() ).arg( mXConstraint->relative() ).arg( mXConstraint->value() ) );
600-
QgsDebugMsg( QString( "Y: %1 %2 %3" ).arg( mYConstraint->isLocked() ).arg( mYConstraint->relative() ).arg( mYConstraint->value() ) );
596+
QgsDebugMsgLevel( "Constraints (locked / relative / value", 4 );
597+
QgsDebugMsgLevel( QString( "Angle: %1 %2 %3" ).arg( mAngleConstraint->isLocked() ).arg( mAngleConstraint->relative() ).arg( mAngleConstraint->value() ), 4 );
598+
QgsDebugMsgLevel( QString( "Distance: %1 %2 %3" ).arg( mDistanceConstraint->isLocked() ).arg( mDistanceConstraint->relative() ).arg( mDistanceConstraint->value() ), 4 );
599+
QgsDebugMsgLevel( QString( "X: %1 %2 %3" ).arg( mXConstraint->isLocked() ).arg( mXConstraint->relative() ).arg( mXConstraint->value() ), 4 );
600+
QgsDebugMsgLevel( QString( "Y: %1 %2 %3" ).arg( mYConstraint->isLocked() ).arg( mYConstraint->relative() ).arg( mYConstraint->value() ), 4 );
601601

602602
QgsPoint point = e->snapPoint( mSnappingMode );
603603

@@ -829,9 +829,9 @@ bool QgsAdvancedDigitizingDockWidget::applyConstraints( QgsMapMouseEvent *e )
829829

830830
// *****************************
831831
// ---- calculate CAD values
832-
QgsDebugMsg( QString( "point: %1 %2" ).arg( point.x() ).arg( point.y() ) );
833-
QgsDebugMsg( QString( "previous point: %1 %2" ).arg( previousPt.x() ).arg( previousPt.y() ) );
834-
QgsDebugMsg( QString( "penultimate point: %1 %2" ).arg( penultimatePt.x() ).arg( penultimatePt.y() ) );
832+
QgsDebugMsgLevel( QString( "point: %1 %2" ).arg( point.x() ).arg( point.y() ), 4 );
833+
QgsDebugMsgLevel( QString( "previous point: %1 %2" ).arg( previousPt.x() ).arg( previousPt.y() ), 4 );
834+
QgsDebugMsgLevel( QString( "penultimate point: %1 %2" ).arg( penultimatePt.x() ).arg( penultimatePt.y() ), 4 );
835835
//QgsDebugMsg( QString( "dx: %1 dy: %2" ).arg( point.x() - previousPt.x() ).arg( point.y() - previousPt.y() ) );
836836
//QgsDebugMsg( QString( "ddx: %1 ddy: %2" ).arg( previousPt.x() - penultimatePt.x() ).arg( previousPt.y() - penultimatePt.y() ) );
837837

‎src/gui/qgsbrowsertreeview.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ void QgsBrowserTreeView::saveState()
5656
QgsSettings settings;
5757
QStringList expandedPaths = expandedPathsList( QModelIndex() );
5858
settings.setValue( expandedPathsKey(), expandedPaths );
59-
QgsDebugMsg( "expandedPaths = " + expandedPaths.join( " " ) );
59+
QgsDebugMsgLevel( "expandedPaths = " + expandedPaths.join( " " ), 4 );
6060
}
6161

6262
void QgsBrowserTreeView::restoreState()
6363
{
6464
QgsSettings settings;
6565
mExpandPaths = settings.value( expandedPathsKey(), QVariant() ).toStringList();
6666

67-
QgsDebugMsg( "mExpandPaths = " + mExpandPaths.join( " " ) );
67+
QgsDebugMsgLevel( "mExpandPaths = " + mExpandPaths.join( " " ), 4 );
6868
if ( !mExpandPaths.isEmpty() )
6969
{
7070
QSet<QModelIndex> expandIndexSet;
@@ -75,7 +75,7 @@ void QgsBrowserTreeView::restoreState()
7575
expandIndexSet.insert( expandIndex );
7676
else
7777
{
78-
QgsDebugMsg( "index for path " + path + " not found" );
78+
QgsDebugMsgLevel( "index for path " + path + " not found", 4 );
7979
}
8080
}
8181
Q_FOREACH ( const QModelIndex &expandIndex, expandIndexSet )
@@ -96,7 +96,7 @@ void QgsBrowserTreeView::expandTree( const QModelIndex &index )
9696
if ( !model() )
9797
return;
9898

99-
QgsDebugMsg( "itemPath = " + model()->data( index, QgsBrowserModel::PathRole ).toString() );
99+
QgsDebugMsgLevel( "itemPath = " + model()->data( index, QgsBrowserModel::PathRole ).toString(), 4 );
100100

101101
expand( index );
102102
QModelIndex parentIndex = model()->parent( index );

‎src/gui/qgsoptionsdialogbase.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,10 @@ void QgsOptionsDialogBase::searchText( const QString &text )
237237
rsw.first->reset();
238238
if ( !text.isEmpty() && rsw.first->searchHighlight( text ) )
239239
{
240-
QgsDebugMsg( QString( "Found %1 in %2 (tab: %3)" )
241-
.arg( text )
242-
.arg( rsw.first->isValid() ? rsw.first->widget()->objectName() : "no widget" )
243-
.arg( mOptListWidget->item( rsw.second )->text() ) );
240+
QgsDebugMsgLevel( QString( "Found %1 in %2 (tab: %3)" )
241+
.arg( text )
242+
.arg( rsw.first->isValid() ? rsw.first->widget()->objectName() : "no widget" )
243+
.arg( mOptListWidget->item( rsw.second )->text() ), 4 );
244244
mOptListWidget->setRowHidden( rsw.second, false );
245245
}
246246
}
@@ -274,7 +274,7 @@ void QgsOptionsDialogBase::registerTextSearchWidgets()
274274
QgsSearchHighlightOptionWidget *shw = new QgsSearchHighlightOptionWidget( w );
275275
if ( shw->isValid() )
276276
{
277-
QgsDebugMsg( QString( "Registering: %1" ).arg( w->objectName() ) );
277+
QgsDebugMsgLevel( QString( "Registering: %1" ).arg( w->objectName() ), 4 );
278278
mRegisteredSearchWidgets.append( qMakePair( shw, i ) );
279279
}
280280
else
@@ -436,7 +436,7 @@ QgsSearchHighlightOptionWidget::QgsSearchHighlightOptionWidget( QWidget *widget
436436
if ( mValid )
437437
{
438438
mStyleSheet.prepend( "/*!search!*/" ).append( "/*!search!*/" );
439-
QgsDebugMsg( mStyleSheet );
439+
QgsDebugMsgLevel( mStyleSheet, 4 );
440440
connect( mWidget, &QWidget::destroyed, this, &QgsSearchHighlightOptionWidget::widgetDestroyed );
441441
}
442442
}

‎src/gui/qgsprojectionselectiontreewidget.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ QString QgsProjectionSelectionTreeWidget::ogcWmsCrsFilterAsSqlExpression( QSet<Q
202202
sqlExpression += ')';
203203
}
204204

205-
QgsDebugMsg( "exiting with '" + sqlExpression + "'." );
205+
QgsDebugMsgLevel( "exiting with '" + sqlExpression + "'.", 4 );
206206

207207
return sqlExpression;
208208
}
@@ -233,12 +233,12 @@ void QgsProjectionSelectionTreeWidget::applySelection( int column, QString value
233233
QList<QTreeWidgetItem *> nodes = lstCoordinateSystems->findItems( value, Qt::MatchExactly | Qt::MatchRecursive, column );
234234
if ( !nodes.isEmpty() )
235235
{
236-
QgsDebugMsg( QString( "found %1,%2" ).arg( column ).arg( value ) );
236+
QgsDebugMsgLevel( QString( "found %1,%2" ).arg( column ).arg( value ), 4 );
237237
lstCoordinateSystems->setCurrentItem( nodes.first() );
238238
}
239239
else
240240
{
241-
QgsDebugMsg( QString( "nothing found for %1,%2" ).arg( column ).arg( value ) );
241+
QgsDebugMsgLevel( QString( "nothing found for %1,%2" ).arg( column ).arg( value ), 4 );
242242
// deselect the selected item to avoid confusing the user
243243
lstCoordinateSystems->clearSelection();
244244
lstRecent->clearSelection();
@@ -298,8 +298,8 @@ QString QgsProjectionSelectionTreeWidget::selectedProj4String()
298298

299299
QString srsId = item->text( QgisCrsIdColumn );
300300

301-
QgsDebugMsg( "srsId = " + srsId );
302-
QgsDebugMsg( "USER_CRS_START_ID = " + QString::number( USER_CRS_START_ID ) );
301+
QgsDebugMsgLevel( "srsId = " + srsId, 4 );
302+
QgsDebugMsgLevel( "USER_CRS_START_ID = " + QString::number( USER_CRS_START_ID ), 4 );
303303

304304
//
305305
// Determine if this is a user projection or a system on
@@ -317,7 +317,7 @@ QString QgsProjectionSelectionTreeWidget::selectedProj4String()
317317
databaseFileName = mSrsDatabaseFileName;
318318
}
319319

320-
QgsDebugMsg( "db = " + databaseFileName );
320+
QgsDebugMsgLevel( "db = " + databaseFileName, 4 );
321321

322322
sqlite3 *database = nullptr;
323323
int rc = sqlite3_open_v2( databaseFileName.toUtf8().data(), &database, SQLITE_OPEN_READONLY, nullptr );
@@ -332,7 +332,7 @@ QString QgsProjectionSelectionTreeWidget::selectedProj4String()
332332
sqlite3_stmt *stmt = nullptr;
333333
QString sql = QStringLiteral( "select parameters from tbl_srs where srs_id=%1" ).arg( srsId );
334334

335-
QgsDebugMsg( "Selection sql: " + sql );
335+
QgsDebugMsgLevel( "Selection sql: " + sql, 4 );
336336

337337
rc = sqlite3_prepare( database, sql.toUtf8(), sql.toUtf8().length(), &stmt, &tail );
338338
// XXX Need to free memory from the error msg if one is set
@@ -405,7 +405,7 @@ QString QgsProjectionSelectionTreeWidget::getSelectedExpression( const QString &
405405
.arg( expression,
406406
lvi->text( QgisCrsIdColumn ) );
407407

408-
QgsDebugMsg( QString( "Finding selected attribute using : %1" ).arg( sql ) );
408+
QgsDebugMsgLevel( QString( "Finding selected attribute using : %1" ).arg( sql ), 4 );
409409
rc = sqlite3_prepare( database, sql.toUtf8(), sql.toUtf8().length(), &stmt, &tail );
410410
// XXX Need to free memory from the error msg if one is set
411411
QString attributeValue;
@@ -479,7 +479,7 @@ void QgsProjectionSelectionTreeWidget::loadUserCrsList( QSet<QString> *crsFilter
479479
if ( mUserProjListDone )
480480
return;
481481

482-
QgsDebugMsg( "Fetching user projection list..." );
482+
QgsDebugMsgLevel( "Fetching user projection list...", 4 );
483483

484484
// convert our Coordinate Reference System filter into the SQL expression
485485
QString sqlFilter = ogcWmsCrsFilterAsSqlExpression( crsFilter );
@@ -695,11 +695,11 @@ void QgsProjectionSelectionTreeWidget::loadCrsList( QSet<QString> *crsFilter )
695695
// New coordinate system selected from the list
696696
void QgsProjectionSelectionTreeWidget::on_lstCoordinateSystems_currentItemChanged( QTreeWidgetItem *current, QTreeWidgetItem * )
697697
{
698-
QgsDebugMsg( "Entered." );
698+
QgsDebugMsgLevel( "Entered.", 4 );
699699

700700
if ( !current )
701701
{
702-
QgsDebugMsg( "no current item" );
702+
QgsDebugMsgLevel( "no current item", 4 );
703703
return;
704704
}
705705

@@ -718,12 +718,12 @@ void QgsProjectionSelectionTreeWidget::on_lstCoordinateSystems_currentItemChange
718718
QList<QTreeWidgetItem *> nodes = lstRecent->findItems( current->text( QgisCrsIdColumn ), Qt::MatchExactly, QgisCrsIdColumn );
719719
if ( !nodes.isEmpty() )
720720
{
721-
QgsDebugMsg( QString( "found srs %1 in recent" ).arg( current->text( QgisCrsIdColumn ) ) );
721+
QgsDebugMsgLevel( QString( "found srs %1 in recent" ).arg( current->text( QgisCrsIdColumn ) ), 4 );
722722
lstRecent->setCurrentItem( nodes.first() );
723723
}
724724
else
725725
{
726-
QgsDebugMsg( QString( "srs %1 not recent" ).arg( current->text( QgisCrsIdColumn ) ) );
726+
QgsDebugMsgLevel( QString( "srs %1 not recent" ).arg( current->text( QgisCrsIdColumn ) ), 4 );
727727
lstRecent->clearSelection();
728728
lstCoordinateSystems->setFocus( Qt::OtherFocusReason );
729729
}
@@ -742,11 +742,11 @@ void QgsProjectionSelectionTreeWidget::on_lstCoordinateSystems_itemDoubleClicked
742742
{
743743
Q_UNUSED( column );
744744

745-
QgsDebugMsg( "Entered." );
745+
QgsDebugMsgLevel( "Entered.", 4 );
746746

747747
if ( !current )
748748
{
749-
QgsDebugMsg( "no current item" );
749+
QgsDebugMsgLevel( "no current item", 4 );
750750
return;
751751
}
752752

@@ -758,11 +758,11 @@ void QgsProjectionSelectionTreeWidget::on_lstCoordinateSystems_itemDoubleClicked
758758

759759
void QgsProjectionSelectionTreeWidget::on_lstRecent_currentItemChanged( QTreeWidgetItem *current, QTreeWidgetItem * )
760760
{
761-
QgsDebugMsg( "Entered." );
761+
QgsDebugMsgLevel( "Entered.", 4 );
762762

763763
if ( !current )
764764
{
765-
QgsDebugMsg( "no current item" );
765+
QgsDebugMsgLevel( "no current item", 4 );
766766
return;
767767
}
768768

@@ -777,11 +777,11 @@ void QgsProjectionSelectionTreeWidget::on_lstRecent_itemDoubleClicked( QTreeWidg
777777
{
778778
Q_UNUSED( column );
779779

780-
QgsDebugMsg( "Entered." );
780+
QgsDebugMsgLevel( "Entered.", 4 );
781781

782782
if ( !current )
783783
{
784-
QgsDebugMsg( "no current item" );
784+
QgsDebugMsgLevel( "no current item", 4 );
785785
return;
786786
}
787787

0 commit comments

Comments
 (0)
Please sign in to comment.