From 90b877330e64b44ab45e369747efabca003fba0b Mon Sep 17 00:00:00 2001 From: Paul RASCLE Date: Mon, 12 Jun 2017 16:23:04 +0200 Subject: [PATCH] check if QT_PLUGIN_PATH environment variable is not a valid directory or non existent before setting it empty --- bin/gui_setenv.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/gui_setenv.py b/bin/gui_setenv.py index 5a4a44be3..ec98f1bc8 100644 --- a/bin/gui_setenv.py +++ b/bin/gui_setenv.py @@ -29,7 +29,12 @@ def set_env( args ): dirs = re.split( ":|;", os.getenv( 'VTK_AUTOLOAD_PATH', vtk_overloads_dir ) ) if vtk_overloads_dir not in dirs: dirs[0:0] = [vtk_overloads_dir] os.environ['VTK_AUTOLOAD_PATH'] = os.pathsep.join(dirs) - os.environ['QT_PLUGIN_PATH'] = '' + #print 'QT_PLUGIN_PATH: ', os.environ['QT_PLUGIN_PATH'] + qt_plugin_dir = os.path.join( os.getenv( "QTDIR" ), "plugins" ) + dirs = re.split( ":|;", os.getenv( 'QT_PLUGIN_PATH', qt_plugin_dir ) ) + if qt_plugin_dir not in dirs: dirs[0:0] = [qt_plugin_dir] + dirs2 = list(set(dirs)) + os.environ['QT_PLUGIN_PATH'] = os.pathsep.join(dirs2) + #print 'QT_PLUGIN_PATH: ', os.environ['QT_PLUGIN_PATH'] + #print 'QT_QPA_PLATFORM_PLUGIN_PATH: ', os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] return - - -- 2.30.2