changeset 33374:f2314b4a9b1a

allow to change the application name by env variable (bug #65499) * main-gui.cc (main): check for env variable OCTAVE_GUI_SETTINGS and if present, set application name to its contents leading to a different name of the used settings file
author Torsten Lilge <ttl-octave@mailbox.org>
date Thu, 11 Apr 2024 18:24:08 +0200
parents 2399268f5167
children a45ccf01d41b
files src/main-gui.cc
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/main-gui.cc	Thu Apr 11 08:44:23 2024 -0400
+++ b/src/main-gui.cc	Thu Apr 11 18:24:08 2024 +0200
@@ -144,7 +144,12 @@
 
   octave::sys::env::set_program_name (argv[0]);
 
-  octave::qt_application app ("octave", "octave-gui", OCTAVE_VERSION,
+  std::string app_name ("octave-gui");
+  std::string settings_file = octave::sys::env::getenv ("OCTAVE_GUI_SETTINGS");
+  if (! settings_file.empty ())
+    app_name = settings_file;
+
+  octave::qt_application app ("octave", app_name, OCTAVE_VERSION,
                               argc, argv);
 
   int ret = app.execute ();