GRASS 7.1 fixes

This commit is contained in:
Radim Blazek 2014-11-06 11:55:32 +01:00
parent b1b0db6b7b
commit 08e39fc986
2 changed files with 12 additions and 7 deletions

View File

@ -53,6 +53,9 @@ extern "C"
#if GRASS_VERSION_MAJOR >= 7
#define G_suppress_masking Rast_suppress_masking
#define BOUND_BOX bound_box
#if GRASS_VERSION_MINOR >= 1
#define G_available_mapsets G_get_available_mapsets
#endif
#endif
#if !defined(GRASS_VERSION_MAJOR) || \
@ -439,14 +442,14 @@ int QgsGrass::error_routine( const char *msg, int fatal )
lastError = FATAL;
#if (GRASS_VERSION_MAJOR == 7) && (GRASS_VERSION_MINOR == 0)
// G_fatal_error in GRASS 7.0.0beta1 always exists the second time it is called.
if ( QString( GRASS_VERSION_RELEASE_STRING ) == "0beta1" )
{
QMessageBox::warning( 0, QObject::tr( "Warning" ), QObject::tr( "Fatal error occurred in GRASS library. QGIS gets over the error but any next fatal error will cause QGIS exit without warning. This is a problem of GRASS 7.0.0beta1 and hopefully will be fixed in higher GRASS versions. Error message: %1" ).arg( msg ) );
}
// G_fatal_error in GRASS 7.0.0beta1 always exits the second time it is called. This was fixed in 7.1.
QMessageBox::warning( 0, QObject::tr( "Warning" ), QObject::tr( "Fatal error occurred in GRASS library. QGIS gets over the error but any next fatal error will cause QGIS exit without warning. This is a problem of GRASS 7.0.0beta1 but it is fixed in GRASS 7.1 and higher. Error message: %1" ).arg( msg ) );
#endif
#if (GRASS_VERSION_MAJOR < 7) || (GRASS_VERSION_MAJOR == 7 && GRASS_VERSION_MINOR == 0)
// longjump() is called by G_fatal_error in GRASS >= 7.1
longjmp( QgsGrass::jumper, 1 );
#endif
}
else
{

View File

@ -42,9 +42,11 @@ class QgsRectangle;
#define EXPAND(x) STR(x)
#define GRASS_VERSION_RELEASE_STRING EXPAND( GRASS_VERSION_RELEASE )
#if (GRASS_VERSION_MAJOR < 7) || (GRASS_VERSION_MAJOR == 7 && GRASS_VERSION_MINOR == 0)
#define G_TRY try { if( !setjmp( QgsGrass::jumper ) )
// Ready for > 7.0.beta1
//#define G_TRY try { if( !setjmp(*G_fatal_longjmp(1)) )
#else
#define G_TRY try { if( !setjmp(*G_fatal_longjmp(1)) )
#endif
#define G_CATCH else { throw QgsGrass::Exception( QgsGrass::errorMessage() ); } } catch
/*!