@@ -69,7 +69,7 @@ QgsGrassModuleStandardOptions::QgsGrassModuleStandardOptions(
69
69
, mXName( xname )
70
70
{
71
71
// QgsDebugMsgLevel( "called.", 4 );
72
- QgsDebugMsg ( QString ( " PATH = %1" ).arg ( getenv ( " PATH" ) ) );
72
+ QgsDebugMsgLevel ( QString ( " PATH = %1" ).arg ( getenv ( " PATH" ) ), 2 );
73
73
74
74
//
75
75
// Set up dynamic inside a scroll box
@@ -153,7 +153,7 @@ QgsGrassModuleStandardOptions::QgsGrassModuleStandardOptions(
153
153
}
154
154
155
155
QString optionType = confDomElement.tagName ();
156
- QgsDebugMsg ( " optionType = " + optionType );
156
+ QgsDebugMsgLevel ( " optionType = " + optionType, 3 );
157
157
158
158
if ( confDomElement.attribute ( QStringLiteral ( " advanced" ), QStringLiteral ( " no" ) ) == QLatin1String ( " yes" ) )
159
159
{
@@ -165,7 +165,7 @@ QgsGrassModuleStandardOptions::QgsGrassModuleStandardOptions(
165
165
}
166
166
167
167
QString key = confDomElement.attribute ( QStringLiteral ( " key" ) );
168
- QgsDebugMsg ( " key = " + key );
168
+ QgsDebugMsgLevel ( " key = " + key, 3 );
169
169
170
170
QDomNode gnode = QgsGrassModuleParam::nodeByKey ( descDocElem, key );
171
171
if ( gnode.isNull () )
@@ -187,7 +187,7 @@ QgsGrassModuleStandardOptions::QgsGrassModuleStandardOptions(
187
187
QString element = promptElem.attribute ( QStringLiteral ( " element" ) );
188
188
QString age = promptElem.attribute ( QStringLiteral ( " age" ) );
189
189
190
- // QgsDebugMsg ("element = " + element + " age = " + age);
190
+ // QgsDebugMsgLevel ("element = " + element + " age = " + age, 3 );
191
191
if ( age == QLatin1String ( " old" ) && ( element == QLatin1String ( " vector" ) || element == QLatin1String ( " cell" ) ||
192
192
element == QLatin1String ( " strds" ) || element == QLatin1String ( " stvds" ) ||
193
193
element == QLatin1String ( " str3ds" ) || element == QLatin1String ( " stds" ) )
@@ -218,7 +218,7 @@ QgsGrassModuleStandardOptions::QgsGrassModuleStandardOptions(
218
218
// G_OPT_DB_COLUMN may be also used for new columns (v.in.db) so we check also if there is at least one input vector
219
219
// but a vector input may also exist (v.random).
220
220
QList<QDomNode> vectorNodes = QgsGrassModuleParam::nodesByType ( descDocElem, G_OPT_V_INPUT, QStringLiteral ( " old" ) );
221
- QgsDebugMsg ( QString ( " vectorNodes.size() = %1" ).arg ( vectorNodes.size () ) );
221
+ QgsDebugMsgLevel ( QString ( " vectorNodes.size() = %1" ).arg ( vectorNodes.size () ), 3 );
222
222
if ( !vectorNodes.isEmpty () )
223
223
{
224
224
mErrors << tr ( " Option '%1' should be configured as field" ).arg ( so->key () );
@@ -309,12 +309,12 @@ QgsGrassModuleStandardOptions::QgsGrassModuleStandardOptions(
309
309
if ( !confDomElement.isNull () )
310
310
{
311
311
QString optionType = confDomElement.tagName ();
312
- QgsDebugMsg ( " optionType = " + optionType );
312
+ QgsDebugMsgLevel ( " optionType = " + optionType, 3 );
313
313
314
314
if ( optionType == QLatin1String ( " flag" ) )
315
315
{
316
316
QString name = confDomElement.attribute ( QStringLiteral ( " name" ) ).trimmed ();
317
- QgsDebugMsg ( " name = " + name );
317
+ QgsDebugMsgLevel ( " name = " + name, 3 );
318
318
mFlagNames .append ( name );
319
319
}
320
320
}
@@ -338,7 +338,7 @@ QgsGrassModuleStandardOptions::QgsGrassModuleStandardOptions(
338
338
}
339
339
if ( vectorInputs.size() == 1 )
340
340
{
341
- QgsDebugMsg ( "One input found, try to connect with column options" );
341
+ QgsDebugMsgLevel ( "One input found, try to connect with column options", 3 );
342
342
QgsGrassModuleInput *vectorInput = vectorInputs[0];
343
343
for ( QgsGrassModuleParam *param : mParams )
344
344
{
@@ -347,7 +347,7 @@ QgsGrassModuleStandardOptions::QgsGrassModuleStandardOptions(
347
347
{
348
348
if ( !moduleField->layerInput() )
349
349
{
350
- QgsDebugMsg ( "Set " + vectorInput->key() + " as layer input for " + moduleField->key() );
350
+ QgsDebugMsgLevel ( "Set " + vectorInput->key() + " as layer input for " + moduleField->key(), 3 );
351
351
moduleField->setLayerInput( vectorInput );
352
352
}
353
353
}
@@ -406,7 +406,7 @@ QStringList QgsGrassModuleStandardOptions::arguments()
406
406
// id is not used in fact, was intended for field, but key is used instead
407
407
QgsGrassModuleParam *QgsGrassModuleStandardOptions::itemByKey ( QString key )
408
408
{
409
- QgsDebugMsg ( " key = " + key );
409
+ QgsDebugMsgLevel ( " key = " + key, 3 );
410
410
411
411
for ( int i = 0 ; i < mParams .size (); i++ )
412
412
{
@@ -422,7 +422,7 @@ QgsGrassModuleParam *QgsGrassModuleStandardOptions::itemByKey( QString key )
422
422
423
423
QgsGrassModuleParam *QgsGrassModuleStandardOptions::item ( QString id )
424
424
{
425
- QgsDebugMsg ( " id = " + id );
425
+ QgsDebugMsgLevel ( " id = " + id, 3 );
426
426
427
427
for ( int i = 0 ; i < mParams .size (); i++ )
428
428
{
@@ -447,7 +447,7 @@ QStringList QgsGrassModuleStandardOptions::checkOutput()
447
447
if ( !opt )
448
448
continue ;
449
449
450
- QgsDebugMsg ( " opt->key() = " + opt->key () );
450
+ QgsDebugMsgLevel ( " opt->key() = " + opt->key (), 3 );
451
451
452
452
if ( opt->isOutput () )
453
453
{
@@ -517,16 +517,16 @@ void QgsGrassModuleStandardOptions::freezeOutput( bool freeze )
517
517
{
518
518
continue ;
519
519
}
520
- QgsDebugMsg ( " opt->key() = " + opt->key () );
520
+ QgsDebugMsgLevel ( " opt->key() = " + opt->key (), 3 );
521
521
522
522
if ( opt->outputType () == QgsGrassModuleOption::Vector )
523
523
{
524
- QgsDebugMsg ( " freeze vector layers" );
524
+ QgsDebugMsgLevel ( " freeze vector layers" , 3 );
525
525
526
526
QgsGrassObject outputObject = QgsGrass::getDefaultMapsetObject ();
527
527
outputObject.setName ( opt->value () );
528
528
outputObject.setType ( QgsGrassObject::Vector );
529
- QgsDebugMsg ( " outputObject = " + outputObject.toString () );
529
+ QgsDebugMsgLevel ( " outputObject = " + outputObject.toString (), 3 );
530
530
531
531
for ( QgsGrassProvider *provider : grassProviders () )
532
532
{
@@ -536,25 +536,25 @@ void QgsGrassModuleStandardOptions::freezeOutput( bool freeze )
536
536
{
537
537
if ( freeze )
538
538
{
539
- QgsDebugMsg ( " freeze map " + provider->dataSourceUri () );
539
+ QgsDebugMsgLevel ( " freeze map " + provider->dataSourceUri (), 3 );
540
540
provider->freeze ();
541
541
}
542
542
else
543
543
{
544
- QgsDebugMsg ( " thaw map " + provider->dataSourceUri () );
544
+ QgsDebugMsgLevel ( " thaw map " + provider->dataSourceUri (), 3 );
545
545
provider->thaw ();
546
546
}
547
547
}
548
548
}
549
549
}
550
550
else if ( opt->outputType () == QgsGrassModuleOption::Raster )
551
551
{
552
- QgsDebugMsg ( " freeze raster layers" );
552
+ QgsDebugMsgLevel ( " freeze raster layers" , 3 );
553
553
554
554
QgsGrassObject outputObject = QgsGrass::getDefaultMapsetObject ();
555
555
outputObject.setName ( opt->value () );
556
556
outputObject.setType ( QgsGrassObject::Raster );
557
- QgsDebugMsg ( " outputObject = " + outputObject.toString () );
557
+ QgsDebugMsgLevel ( " outputObject = " + outputObject.toString (), 3 );
558
558
559
559
for ( QgsGrassRasterProvider *provider : grassRasterProviders () )
560
560
{
@@ -564,12 +564,12 @@ void QgsGrassModuleStandardOptions::freezeOutput( bool freeze )
564
564
{
565
565
if ( freeze )
566
566
{
567
- QgsDebugMsg ( " freeze map " + provider->dataSourceUri () );
567
+ QgsDebugMsgLevel ( " freeze map " + provider->dataSourceUri (), 3 );
568
568
provider->freeze ();
569
569
}
570
570
else
571
571
{
572
- QgsDebugMsg ( " thaw map " + provider->dataSourceUri () );
572
+ QgsDebugMsgLevel ( " thaw map " + provider->dataSourceUri (), 3 );
573
573
provider->thaw ();
574
574
}
575
575
}
@@ -589,7 +589,7 @@ QStringList QgsGrassModuleStandardOptions::output( int type )
589
589
if ( !opt )
590
590
continue ;
591
591
592
- QgsDebugMsg ( " opt->key() = " + opt->key () );
592
+ QgsDebugMsgLevel ( " opt->key() = " + opt->key (), 3 );
593
593
594
594
if ( opt->isOutput () )
595
595
{
@@ -618,7 +618,7 @@ bool QgsGrassModuleStandardOptions::hasOutput( int type )
618
618
if ( !opt )
619
619
continue ;
620
620
621
- QgsDebugMsg ( " opt->key() = " + opt->key () );
621
+ QgsDebugMsgLevel ( " opt->key() = " + opt->key (), 3 );
622
622
623
623
if ( opt->isOutput () )
624
624
{
@@ -670,7 +670,7 @@ QStringList QgsGrassModuleStandardOptions::checkRegion()
670
670
if ( !item )
671
671
continue ;
672
672
673
- QgsDebugMsg ( " currentMap = " + item->currentMap () );
673
+ QgsDebugMsgLevel ( " currentMap = " + item->currentMap (), 3 );
674
674
// The input may be empty, it means input is not used.
675
675
676
676
if ( item->currentMap ().isEmpty () )
@@ -757,7 +757,7 @@ bool QgsGrassModuleStandardOptions::inputRegion( struct Cell_head *window, QgsCo
757
757
continue ;
758
758
}
759
759
760
- QgsDebugMsg ( " currentMap = " + item->currentMap () );
760
+ QgsDebugMsgLevel ( " currentMap = " + item->currentMap (), 3 );
761
761
// The input may be empty, it means input is not used.
762
762
if ( item->currentMap ().isEmpty () )
763
763
{
@@ -827,7 +827,7 @@ bool QgsGrassModuleStandardOptions::usesRegion()
827
827
return true ;
828
828
}
829
829
830
- QgsDebugMsg ( " NO usesRegion()" );
830
+ QgsDebugMsgLevel ( " NO usesRegion()" , 2 );
831
831
return false ;
832
832
}
833
833
@@ -838,7 +838,7 @@ bool QgsGrassModuleStandardOptions::getCurrentMapRegion( QgsGrassModuleInput *in
838
838
return false ;
839
839
}
840
840
841
- QgsDebugMsg ( " currentMap = " + input->currentMap () );
841
+ QgsDebugMsgLevel ( " currentMap = " + input->currentMap (), 3 );
842
842
if ( input->currentMap ().isEmpty () )
843
843
{
844
844
// The input may be empty, it means input is not used.
@@ -921,7 +921,7 @@ QDomDocument QgsGrassModuleStandardOptions::readInterfaceDescription( const QStr
921
921
// of the interface description (see https://github.com/qgis/QGIS/issues/14461)
922
922
QTextCodec *codec = nullptr ;
923
923
924
- QgsDebugMsg ( " trying to get encoding name from XML interface description..." );
924
+ QgsDebugMsgLevel ( " trying to get encoding name from XML interface description..." , 3 );
925
925
926
926
// XXX: getting the encoding using a regular expression works
927
927
// until GRASS will use UTF-16 or UTF-32.
@@ -932,19 +932,19 @@ QDomDocument QgsGrassModuleStandardOptions::readInterfaceDescription( const QStr
932
932
if ( reg.indexIn ( xmlDeclaration ) != -1 )
933
933
{
934
934
QByteArray enc = reg.cap ( 2 ).toLocal8Bit ();
935
- QgsDebugMsg ( QString ( " found encoding name '%1'" ).arg ( QString::fromUtf8 ( enc ) ) );
935
+ QgsDebugMsgLevel ( QString ( " found encoding name '%1'" ).arg ( QString::fromUtf8 ( enc ) ), 3 );
936
936
937
937
codec = QTextCodec::codecForName ( enc );
938
938
if ( !codec )
939
939
{
940
- QgsDebugMsg ( " unrecognized encoding name. Let's use 'System' codec" );
940
+ QgsDebugMsgLevel ( " unrecognized encoding name. Let's use 'System' codec" , 2 );
941
941
codec = QTextCodec::codecForName ( " System" );
942
942
Q_ASSERT ( codec );
943
943
}
944
944
}
945
945
else
946
946
{
947
- QgsDebugMsg ( " unable to get encoding name from XML content. Will let Qt detects encoding!" );
947
+ QgsDebugMsgLevel ( " unable to get encoding name from XML content. Will let Qt detects encoding!" , 2 );
948
948
}
949
949
950
950
bool ok = false ;
@@ -953,11 +953,11 @@ QDomDocument QgsGrassModuleStandardOptions::readInterfaceDescription( const QStr
953
953
954
954
if ( codec )
955
955
{
956
- QgsDebugMsg ( QString ( " parsing XML interface description using '%1' codec..." ).arg ( QString::fromUtf8 ( codec->name () ) ) );
956
+ QgsDebugMsgLevel ( QString ( " parsing XML interface description using '%1' codec..." ).arg ( QString::fromUtf8 ( codec->name () ) ), 3 );
957
957
ok = gDoc .setContent ( codec->toUnicode ( baDesc ), false , &err, &line, &column );
958
958
if ( !ok )
959
959
{
960
- QgsDebugMsg ( " parse FAILED. Will let Qt detects encoding" );
960
+ QgsDebugMsgLevel ( " parse FAILED. Will let Qt detects encoding" , 2 );
961
961
codec = nullptr ;
962
962
}
963
963
}
0 commit comments