Skip to content

Commit 366331c

Browse files
committedSep 23, 2015
[GRASS] avoid warning dialog in init
1 parent 7dd5302 commit 366331c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎src/providers/grass/qgsgrass.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,8 @@ QString QgsGrass::shortPath( const QString &path )
293293

294294
bool QgsGrass::init( void )
295295
{
296+
// Do not show warning dialog in this function, it may cause problems in non interactive tests etc.
297+
296298
// Warning!!!
297299
// G_set_error_routine() once called from plugin
298300
// is not valid in provider -> call it always
@@ -347,7 +349,8 @@ bool QgsGrass::init( void )
347349
}
348350
G_CATCH( QgsGrass::Exception &e )
349351
{
350-
warning( tr( "Problem in GRASS initialization, GRASS provider and plugin will not work" ) + " : " + e.what() );
352+
error_message = tr( "Problem in GRASS initialization, GRASS provider and plugin will not work" ) + " : " + e.what();
353+
QgsDebugMsg( error_message );
351354
nonInitializable = true;
352355
unlock();
353356
return false;
@@ -549,9 +552,9 @@ bool QgsGrass::init( void )
549552
putEnv( "GRASS_PAGER", pager );
550553
}
551554
}
555+
initialized = 1;
552556
}
553557

554-
initialized = 1;
555558
unlock();
556559
return valid;
557560
}

0 commit comments

Comments
 (0)
Please sign in to comment.