@@ -366,7 +366,7 @@ bool QgsGrass::init( void )
366
366
}
367
367
G_CATCH ( QgsGrass::Exception &e )
368
368
{
369
- mInitError = tr ( " Problem in GRASS initialization, GRASS provider and plugin will not work" ) + " : " + e.what ();
369
+ mInitError = tr ( " Problem in GRASS initialization, GRASS provider and plugin will not work : %1 " ). arg ( e.what () );
370
370
QgsDebugMsg ( mInitError );
371
371
mNonInitializable = true ;
372
372
unlock ();
@@ -699,7 +699,7 @@ void QgsGrass::removeMapsetFromSearchPath( const QString & mapset, QString& erro
699
699
}
700
700
catch ( QgsGrass::Exception &e )
701
701
{
702
- error = tr ( " Cannot remove mapset %1 from search path:" ).arg ( mapset ) + " " + e.what ();
702
+ error = tr ( " Cannot remove mapset %1 from search path: %2 " ).arg ( mapset, e.what () );
703
703
}
704
704
}
705
705
@@ -959,7 +959,7 @@ QString QgsGrass::openMapset( const QString& gisdbase,
959
959
960
960
if ( process.exitStatus () != QProcess::NormalExit || process.exitCode () != 0 )
961
961
{
962
- QString message = QObject::tr ( " Mapset lock failed" ) + " ( " + processResult + " ) " ;
962
+ QString message = QObject::tr ( " Mapset lock failed (%1) " ). arg ( processResult ) ;
963
963
return message;
964
964
}
965
965
@@ -1857,7 +1857,7 @@ bool QgsGrass::mapRegion( QgsGrassObject::Type type, QString gisdbase,
1857
1857
if ( type == QgsGrassObject::Raster )
1858
1858
{
1859
1859
1860
- QString error = tr ( " Cannot read raster map region" ) + " ( " + gisdbase + " / " + location + " / " + mapset + " ) " ;
1860
+ QString error = tr ( " Cannot read raster map region (%1/%2/%3) " ). arg ( gisdbase, location, mapset ) ;
1861
1861
#if GRASS_VERSION_MAJOR < 7
1862
1862
if ( G_get_cellhd ( map.toUtf8 ().data (),
1863
1863
mapset.toUtf8 ().data (), window ) < 0 )
@@ -2173,7 +2173,7 @@ QgsCoordinateReferenceSystem QgsGrass::crs( const QString& gisdbase, const QStri
2173
2173
}
2174
2174
catch ( QgsGrass::Exception &e )
2175
2175
{
2176
- error = tr ( " Cannot get projection " ) + " \n " + e.what ();
2176
+ error = tr ( " Cannot get projection" ) + " \n " + e.what ();
2177
2177
QgsDebugMsg ( error );
2178
2178
}
2179
2179
@@ -2583,8 +2583,7 @@ void QgsGrass::insertRow( dbDriver *driver, const QString tableName,
2583
2583
db_free_string ( &dbstr );
2584
2584
if ( result != DB_OK )
2585
2585
{
2586
- throw QgsGrass::Exception ( QObject::tr ( " Cannot insert, statement" ) + " : " + sql
2587
- + QObject::tr ( " error" ) + " : " + QString::fromLatin1 ( db_get_error_msg () ) );
2586
+ throw QgsGrass::Exception ( QObject::tr ( " Cannot insert, statement: '%1' error: '%2'" ).arg ( sql, QString::fromLatin1 ( db_get_error_msg () ) ) );
2588
2587
}
2589
2588
}
2590
2589
@@ -2621,7 +2620,7 @@ void QgsGrass::adjustCellHead( struct Cell_head *cellhd, int row_flag, int col_f
2621
2620
char * err = G_adjust_Cell_head ( cellhd, row_flag, col_flag );
2622
2621
if ( err )
2623
2622
{
2624
- throw QgsGrass::Exception ( QObject::tr ( " Cannot adjust region" ) + QString ( err ) );
2623
+ throw QgsGrass::Exception ( QObject::tr ( " Cannot adjust region, error: '%1' " ). arg ( err ) );
2625
2624
}
2626
2625
#else
2627
2626
G_FATAL_THROW ( G_adjust_Cell_head ( cellhd, row_flag, col_flag ) );
0 commit comments