Skip to content
Permalink
Browse files

GRASS 7.1 fixes

  • Loading branch information
blazek committed Nov 6, 2014
1 parent b1b0db6 commit 08e39fc98639c3bdfa599abbb4f2515db4646f58
Showing with 12 additions and 7 deletions.
  1. +8 −5 src/providers/grass/qgsgrass.cpp
  2. +4 −2 src/providers/grass/qgsgrass.h
@@ -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
{
@@ -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

/*!

0 comments on commit 08e39fc

Please sign in to comment.
You can’t perform that action at this time.