Skip to content

Commit ec56c3e

Browse files
committedJul 6, 2016
Make browser less noisy on debug
1 parent 8eeceb0 commit ec56c3e

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed
 

‎src/core/qgsdataitem.cpp

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ void QgsAnimatedIcon::connectFrameChanged( const QObject * receiver, const char
8181
mCount++;
8282
}
8383
mMovie->setPaused( mCount == 0 );
84-
QgsDebugMsg( QString( "mCount = %1" ).arg( mCount ) );
84+
QgsDebugMsgLevel( QString( "mCount = %1" ).arg( mCount ), 3 );
8585
}
8686

8787
void QgsAnimatedIcon::disconnectFrameChanged( const QObject * receiver, const char * method )
@@ -91,7 +91,7 @@ void QgsAnimatedIcon::disconnectFrameChanged( const QObject * receiver, const ch
9191
mCount--;
9292
}
9393
mMovie->setPaused( mCount == 0 );
94-
QgsDebugMsg( QString( "mCount = %1" ).arg( mCount ) );
94+
QgsDebugMsgLevel( QString( "mCount = %1" ).arg( mCount ), 3 );
9595
}
9696

9797
// shared icons
@@ -248,7 +248,7 @@ QString QgsDataItem::pathComponent( const QString &string )
248248

249249
void QgsDataItem::deleteLater()
250250
{
251-
QgsDebugMsg( "path = " + path() );
251+
QgsDebugMsgLevel( "path = " + path(), 3 );
252252
setParent( nullptr ); // also disconnects parent
253253
Q_FOREACH ( QgsDataItem *child, mChildren )
254254
{
@@ -287,7 +287,7 @@ void QgsDataItem::moveToThread( QThread * targetThread )
287287
{
288288
if ( !child ) // should not happen
289289
continue;
290-
QgsDebugMsg( "moveToThread child " + child->path() );
290+
QgsDebugMsgLevel( "moveToThread child " + child->path(), 3 );
291291
child->QObject::setParent( nullptr ); // to be sure
292292
child->moveToThread( targetThread );
293293
}
@@ -341,7 +341,7 @@ void QgsDataItem::emitStateChanged( QgsDataItem* item, QgsDataItem::State oldSta
341341
{
342342
if ( !item )
343343
return;
344-
QgsDebugMsg( QString( "item %1 state changed %2 -> %3" ).arg( item->path() ).arg( oldState ).arg( item->state() ) );
344+
QgsDebugMsgLevel( QString( "item %1 state changed %2 -> %3" ).arg( item->path() ).arg( oldState ).arg( item->state() ), 2 );
345345
emit stateChanged( item, oldState );
346346
}
347347

@@ -355,7 +355,7 @@ void QgsDataItem::populate( bool foreground )
355355
if ( state() == Populated || state() == Populating )
356356
return;
357357

358-
QgsDebugMsg( "mPath = " + mPath );
358+
QgsDebugMsgLevel( "mPath = " + mPath, 2 );
359359

360360
if ( capabilities2() & QgsDataItem::Fast || foreground )
361361
{
@@ -377,27 +377,27 @@ void QgsDataItem::populate( bool foreground )
377377
// This is expected to be run in a separate thread
378378
QVector<QgsDataItem*> QgsDataItem::runCreateChildren( QgsDataItem* item )
379379
{
380-
QgsDebugMsg( "path = " + item->path() );
380+
QgsDebugMsgLevel( "path = " + item->path(), 2 );
381381
QTime time;
382382
time.start();
383383
QVector <QgsDataItem*> children = item->createChildren();
384-
QgsDebugMsg( QString( "%1 children created in %2 ms" ).arg( children.size() ).arg( time.elapsed() ) );
384+
QgsDebugMsgLevel( QString( "%1 children created in %2 ms" ).arg( children.size() ).arg( time.elapsed() ), 3 );
385385
// Children objects must be pushed to main thread.
386386
Q_FOREACH ( QgsDataItem* child, children )
387387
{
388388
if ( !child ) // should not happen
389389
continue;
390-
QgsDebugMsg( "moveToThread child " + child->path() );
390+
QgsDebugMsgLevel( "moveToThread child " + child->path(), 2 );
391391
if ( qApp )
392392
child->moveToThread( qApp->thread() ); // moves also children
393393
}
394-
QgsDebugMsg( QString( "finished path %1: %2 children" ).arg( item->path() ).arg( children.size() ) );
394+
QgsDebugMsgLevel( QString( "finished path %1: %2 children" ).arg( item->path() ).arg( children.size() ), 3 );
395395
return children;
396396
}
397397

398398
void QgsDataItem::childrenCreated()
399399
{
400-
QgsDebugMsg( QString( "path = %1 children.size() = %2" ).arg( path() ).arg( mFutureWatcher->result().size() ) );
400+
QgsDebugMsgLevel( QString( "path = %1 children.size() = %2" ).arg( path() ).arg( mFutureWatcher->result().size() ), 3 );
401401

402402
if ( deferredDelete() )
403403
{
@@ -420,7 +420,7 @@ void QgsDataItem::childrenCreated()
420420

421421
void QgsDataItem::populate( const QVector<QgsDataItem*>& children )
422422
{
423-
QgsDebugMsg( "mPath = " + mPath );
423+
QgsDebugMsgLevel( "mPath = " + mPath, 3 );
424424

425425
Q_FOREACH ( QgsDataItem *child, children )
426426
{
@@ -434,11 +434,11 @@ void QgsDataItem::populate( const QVector<QgsDataItem*>& children )
434434

435435
void QgsDataItem::depopulate()
436436
{
437-
QgsDebugMsg( "mPath = " + mPath );
437+
QgsDebugMsgLevel( "mPath = " + mPath, 3 );
438438

439439
Q_FOREACH ( QgsDataItem *child, mChildren )
440440
{
441-
QgsDebugMsg( "remove " + child->path() );
441+
QgsDebugMsgLevel( "remove " + child->path(), 3 );
442442
child->depopulate(); // recursive
443443
deleteChildItem( child );
444444
}
@@ -450,7 +450,7 @@ void QgsDataItem::refresh()
450450
if ( state() == Populating )
451451
return;
452452

453-
QgsDebugMsg( "mPath = " + mPath );
453+
QgsDebugMsgLevel( "mPath = " + mPath, 3 );
454454

455455
if ( capabilities2() & QgsDataItem::Fast )
456456
{
@@ -484,7 +484,7 @@ void QgsDataItem::refresh( QVector<QgsDataItem*> children )
484484
}
485485
Q_FOREACH ( QgsDataItem *child, remove )
486486
{
487-
QgsDebugMsg( "remove " + child->path() );
487+
QgsDebugMsgLevel( "remove " + child->path(), 3 );
488488
deleteChildItem( child );
489489
}
490490

@@ -548,7 +548,7 @@ void QgsDataItem::setParent( QgsDataItem* parent )
548548
void QgsDataItem::addChildItem( QgsDataItem * child, bool refresh )
549549
{
550550
Q_ASSERT( child );
551-
QgsDebugMsg( QString( "path = %1 add child #%2 - %3 - %4" ).arg( mPath ).arg( mChildren.size() ).arg( child->mName ).arg( child->mType ) );
551+
QgsDebugMsgLevel( QString( "path = %1 add child #%2 - %3 - %4" ).arg( mPath ).arg( mChildren.size() ).arg( child->mName ).arg( child->mType ), 3 );
552552

553553
//calculate position to insert child
554554
int i;
@@ -642,7 +642,7 @@ QgsDataItem::State QgsDataItem::state() const
642642

643643
void QgsDataItem::setState( State state )
644644
{
645-
QgsDebugMsg( QString( "item %1 set state %2 -> %3" ).arg( path() ).arg( this->state() ).arg( state ) );
645+
QgsDebugMsgLevel( QString( "item %1 set state %2 -> %3" ).arg( path() ).arg( this->state() ).arg( state ), 3 );
646646
if ( state == mState )
647647
return;
648648

@@ -919,11 +919,11 @@ bool QgsDirectoryItem::hiddenPath( QString path )
919919

920920
void QgsDirectoryItem::childrenCreated()
921921
{
922-
QgsDebugMsg( QString( "mRefreshLater = %1" ).arg( mRefreshLater ) );
922+
QgsDebugMsgLevel( QString( "mRefreshLater = %1" ).arg( mRefreshLater ), 3 );
923923

924924
if ( mRefreshLater )
925925
{
926-
QgsDebugMsg( "directory changed during createChidren() -> refresh() again" );
926+
QgsDebugMsgLevel( "directory changed during createChidren() -> refresh() again", 3 );
927927
mRefreshLater = false;
928928
setState( Populated );
929929
refresh();
@@ -1245,7 +1245,7 @@ void QgsZipItem::init()
12451245
for ( i = keys.begin(); i != keys.end(); ++i )
12461246
{
12471247
QString k( *i );
1248-
QgsDebugMsg( "provider " + k );
1248+
QgsDebugMsgLevel( "provider " + k, 3 );
12491249
// some providers hangs with empty uri (Postgis) etc...
12501250
// -> using libraries directly
12511251
QLibrary *library = QgsProviderRegistry::instance()->providerLibrary( k );

0 commit comments

Comments
 (0)
Please sign in to comment.