octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #53419] GUI crashes if QT_PLUGIN_PATH is not s


From: Rik
Subject: [Octave-bug-tracker] [bug #53419] GUI crashes if QT_PLUGIN_PATH is not set
Date: Tue, 27 Mar 2018 19:57:31 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Update of bug #53419 (project octave):

                  Status:             In Progress => Fixed                  

    _______________________________________________________

Follow-up Comment #10:

I checked in a change for octave.bat.  This sets QT_PLUGIN_PATH and also
simplifies the way we processed arguments.


changeset:   4645:56a712112482
tag:         tip
user:        Rik <address@hidden>
date:        Tue Mar 27 16:56:01 2018 -0700
summary:     octave.bat: Rewrite to set QT_PLUGIN_PATH (bug #53419).

diff -r c3950e2b4066 -r 56a712112482 installer-files/octave.bat
--- a/installer-files/octave.bat        Tue Mar 27 09:53:22 2018 -0700
+++ b/installer-files/octave.bat        Tue Mar 27 16:56:01 2018 -0700
@@ -3,21 +3,27 @@ Rem   Find Octave's install directory th
 Rem   This batch file should reside in Octaves installation subdir!
 Rem
 Rem   This trick finds the location where the batch file resides.
-Rem   Note: the result ends with a backslash
+Rem   Note: the result ends with a backslash.
 set OCT_HOME=%~dp0
-Rem Coonvert to 8.3 format so dont have to worry about spaces
+Rem Convert to 8.3 format so we don't have to worry about spaces.
 for %%I in ("%OCT_HOME%") do set OCT_HOME=%%~sI
 
-Rem   Set up PATH. Make sure the octave bin dir
-Rem   comes first.
+Rem   Set up PATH.  Make sure the octave bin dir comes first.
 
 set PATH=%OCT_HOME%qt5\bin;%OCT_HOME%bin;%PATH%
 
-Rem   Set up any environment vars we may need
+Rem   Set up any environment vars we may need.
 
 set TERM=cygwin
 set GNUTERM=wxt
 set GS=gs.exe
+ 
+Rem QT_PLUGIN_PATH must be set to avoid segfault (bug #53419).
+IF EXIST "%OCT_HOME%\qt5\bin\" (
+  set QT_PLUGIN_PATH=%OCT_HOME%\qt5\plugins
+) ELSE (
+  set QT_PLUGIN_PATH=%OCT_HOME%\plugins
+)
 
 Rem set home if not already set
 if "%HOME%"=="" set HOME=%USERPROFILE%
@@ -25,27 +31,34 @@ if "%HOME%"=="" set HOME=%HOMEDRIVE%%HOM
 Rem set HOME to 8.3 format
 for %%I in ("%HOME%") do set HOME=%%~sI
 
-Rem   Check for args to see if we are told to start GUI
-Rem   with the --force-gui option or not (--no-gui)
-Rem   Otherwise assume starting as command line
+Rem   Check for args to see if we are told to start GUI (--gui, --force-gui)
+Rem   or not (--no-gui).
+Rem   If nothing is specified, start the GUI.
 set GUI_MODE=1
 :checkargs
-if -%1-==-- goto noargs
-  if NOT %1==--force-gui goto notguiarg
-    set GUI_MODE=1
-:notguiarg
-  if NOT %1==--no-gui goto notnoguiarg
-    set GUI_MODE=0
-:notnoguiarg
-  shift
-  goto  checkargs
-:noargs
+if -%1-==-- goto args_done
+
+if %1==--gui (
+  set GUI_MODE=1
+) else (
+if %1==--force-gui (
+  set GUI_MODE=1
+) else (
+if %1==--no-gui (
+  set GUI_MODE=0
+)))
+
+Rem move to next argument and continue processing
+shift
+goto checkargs
+
+:args_done
 
 Rem   Start Octave (this detaches and immediately returns):
 if %GUI_MODE%==1 (
-start octave-gui.exe --gui %*
+  start octave-gui.exe --gui %*
 ) else (
-start octave-cli.exe %*
+  start octave-cli.exe %*
 )
 
 Rem   Close the batch file's cmd.exe window





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?53419>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]